gio1961 Posted March 6, 2020 Report Share Posted March 6, 2020 Hi Guys, I have a problem. For needs, I have 2 menus, one in app_top.php (for users who log in to the site) and the other app_top1.php (for users who visit the site). I use the Crewcenter skin where the underneath code is in the layout.php file, to hide the header / menu on the login and registration pages. <?php // var_dump($_SERVER['REQUEST_URI']); if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } } ?> <div id="content"> <?php echo $page_content; ?> </div> <?php if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') { if(Auth::LoggedIn()) { Template::Show('app_bottom.php'); } } ?> I tried to insert this code, but the menu of the app_top1.php file is also displayed on the login / registration pages. <?php // var_dump($_SERVER['REQUEST_URI']); if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/login' || ltrim($_SERVER['REQUEST_URI'],'/') !== SITE_URL.'/index.php/registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } } else { Template::Show('app_top1.php'); } ?> I don't understand where the problem is Thanks for a possible reply. Sincerely Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted March 7, 2020 Members Report Share Posted March 7, 2020 Try bellow code if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } else { Template::Show('app_top1.php'); } } <?php // var_dump($_SERVER['REQUEST_URI']); if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } } ?> <div id="content"> <?php echo $page_content; ?> </div> <?php if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_bottom.php'); } } ?> Quote Link to comment Share on other sites More sharing options...
gio1961 Posted March 7, 2020 Author Report Share Posted March 7, 2020 1 hour ago, Vangelis said: Try bellow code if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } else { Template::Show('app_top1.php'); } } <?php // var_dump($_SERVER['REQUEST_URI']); if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } } ?> <div id="content"> <?php echo $page_content; ?> </div> <?php if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_bottom.php'); } } ?> Thanks for the reply. I tried this code but unfortunately it doesn't work. The app_top1.php file menu is not displayed <?php // var_dump($_SERVER['REQUEST_URI']); if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_top.php'); } else { Template::Show('app_top1.php'); } } ?> <div id="content"> <?php echo $page_content; ?> </div> <?php if($this->get->page == 'login' or $this->get->page == 'registration') { if(Auth::LoggedIn()) { Template::Show('app_bottom.php'); } } ?> Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted March 7, 2020 Members Report Share Posted March 7, 2020 if you do a print_r($this->get->page); what result do you get ? i do not remember if the modules started with a capital letter 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.