ncd200 Posted August 9, 2016 Report Share Posted August 9, 2016 (edited) Hello, I am using a custom dropdown menu. It is working great, only when i am trying to insert the options to see items only when logged in I recieve errors and the site stupped working. I am using an own CSS for the menu, I have added that script to. Anyone that can no why the login authenticate function wont work? Thanks in advance. .clearfix:after { display:block; clear:both; } /*----- Menu Outline -----*/ .menu-wrap { width:40%; } .menu { width:100%; margin:0px auto; } .menu li { margin:0px; list-style:none; font-family:'Ek Mukta'; } .menu a { transition:all linear 0.15s; color:#e80218; } .menu li:hover > a, .menu .current-item > a { text-decoration:none; color:#0079bf; } .menu .arrow { font-size:11px; line-height:0%; } /*----- Top Level -----*/ .menu > ul > li { float:left; display:inline-block; position:relative; font-size:18px; } .menu > ul > li > a { padding:10px 40px; display:inline-block; text-shadow:0px 1px 0px rgba(0,0,0,0.4); } .menu > ul > li:hover > a, .menu > ul > .current-item > a { } /*----- Bottom Level -----*/ .menu li:hover .sub-menu { z-index:1; opacity:1; } .sub-menu { width:160%; padding:5px 0px; position:absolute; top:100%; left:5px; z-index:-1; opacity:0; transition:opacity linear 0.15s; box-shadow:0px 2px 3px rgba(0,0,0,0.2); } .sub-menu li { display:block; font-size:18px; } .sub-menu li a { padding:10px 30px; display:block; } .sub-menu li a:hover, .sub-menu .current-item a { And here the menu itself <div class="menu-wrap"> <nav class="menu"> <ul class="clearfix"> <li><a href="<?php echo url('/'); ?>">Home</a></li> <li> <a href="#">About <span class="arrow">▼</span></a> <ul class="sub-menu"> <li><a href="<?php echo url('pages/about'); ?>">About us</a></li> <li><a href="<?php echo url('pilots'); ?>">Crew roster</a></li> <li><a href="<?php echo url('pages/rank'); ?>">Rank scheme</a></li> <li><a href="<?php echo url('/airlinemap'); ?>">Destinations</a></li> </ul> </li> <?php require('core/codon.config.php'); /* Call the PHPVms Config File */ if(Auth::LoggedIn()) { ?> <li><a href="#">Operations <span class="arrow">▼</span></a> <ul class="sub-menu"> <li><a href="<?php echo url('/logout'); ?>">Logout</a></li> <li><a href="<?php echo url('/Schedules'); ?>">Schedules</a></li> <li><a href="<?php echo url('/profile'); ?>">Profile</a></li> </ul> </li> <?php } else { ?> <script type='text/javascript'> window.location = '<?php echo url('login"); ?>' <?php /*javascripts redirect as php headers error will display if php function is used*/ ?> </script> <?php } ?> <li class="current-item"><a href="#">Photos</a></li> <li><a href="#">Site Help</a></li> </ul> </nav> </div> Kindly regards, Rick Winkelman Edited August 9, 2016 by ncd200 Quote Link to comment Share on other sites More sharing options...
brunoquadros Posted August 9, 2016 Report Share Posted August 9, 2016 Hello Rick. Try this <?php if(Auth::LoggedIn() == true){ ?> //<a href="#">My Custom Link</a> <?php } ?> Quote Link to comment Share on other sites More sharing options...
ncd200 Posted August 9, 2016 Author Report Share Posted August 9, 2016 Thanks a lot, it worked!! 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.