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
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'); } } ?\>
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'); } } ?\>
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