koon0789 Posted November 18, 2014 Share Posted November 18, 2014 I have dynamic images that have the "Like" button, it's basically like a wishlist. The way I want it to work is that when a user is not logged in, the 'Like' button will navigate them to a login popup (which I already made). This is my code for the sign in/register <?php if(isset($logged_user)){ ?> <a href="<?php echo SITE_URL; ?>user/account" id="namebutton">Hello, <?php echo ucfirst($logged_user->first_name); ?></a> <a href="<?php echo SITE_URL; ?>user/logout" id="logoutbutton">Log Out</a> <?php }else{ ?> <a class="loglink" href="javascript:void(0)" onclick="toggle_visibility('popupBoxTwoPosition');">Sign in</a> <a class="reglink" href="javascript:void(0)" onclick="toggle_visibility('popupBoxOnePosition');">Register</a> <?php } ?> This is my code for the Like button: <?php if(count($model->wish) > 0){ ?> <a href="<?php echo SITE_URL; ?>category/wishlist_delete?id=<?php echo $model->wish{0}->id; ?>"><img src="<?= SITE_IMG ?>heart_icon2.png" alt="hearticon" class="hearticon2" /></a> <?php }else{ ?> <a href="<?php echo SITE_URL; ?>category/wishlist_post?id=<?php echo $products{0}->id; ?>"><img src="<?= SITE_IMG ?>heart_icon4.png" alt="hearticon" class="hearticon4" /></a> <?php } ?> How do I combine the two if statements together? Link to comment https://forums.phpfreaks.com/topic/292548-how-do-i-navigate-users-to-the-login-popup-when-they-click-on-a-like-button-and-not-logged-in-at-the-same-time/ Share on other sites More sharing options...
koon0789 Posted November 18, 2014 Author Share Posted November 18, 2014 NVM I resolved it Link to comment https://forums.phpfreaks.com/topic/292548-how-do-i-navigate-users-to-the-login-popup-when-they-click-on-a-like-button-and-not-logged-in-at-the-same-time/#findComment-1496926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.