The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Users Only - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27) +--- Thread: Users Only (/showthread.php?tid=1168) |
Users Only - KyleJ1445566 - 10-10-2018 Hey, I am trying to get the some of the content on the index page for logged in users only and I am having difficulty. I have supplied a screen shot of the content I wish for only logged in users. Any help would be appreciated and thank you in advance. RE: Users Only - mudmin - 10-10-2018 (10-10-2018, 03:27 AM)KyleJ1445566 Wrote: Hey, I'm not seeing a screenshot, but basically what you have to do is to wrap the two sections (logged in vs logged out) in this if/else statement PHP Code: if(isset($user) && $user->isLoggedIn()){ RE: Users Only - KyleJ1445566 - 10-10-2018 I have attempted this and i am getting an error on line 45. I have enclosed the code below: Code: <div class="row"> RE: Users Only - Brandin - 10-10-2018 What error are you getting? RE: Users Only - mudmin - 10-10-2018 if(isset($user) && $user->isLoggedIn()){ You need to close your php tags before switching back to html so if(isset($user) && $user->isLoggedIn()){ ?> <div class = "row"> Other html here <?php } //closing if statement ?> RE: Users Only - KyleJ1445566 - 10-10-2018 Sorry for the late reply. I have now got it, thank you for helping. It is much appreciated. |