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? Quote Link to comment Share on other sites More sharing options...
koon0789 Posted November 18, 2014 Author Share Posted November 18, 2014 NVM I resolved it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.