Advertisement
Faguss

UserSpice navigation.php - custom version

Jul 5th, 2017
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.13 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. Feb 02 2016 - Ported US3.2.1 top-nav
  8.  
  9. This program is free software: you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation, either version 3 of the License, or
  12. (at your option) any later version.
  13.  
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21. */
  22.  
  23. // Signup
  24. $lang = array_merge($lang,array(
  25.     "SIGNUP_TEXT"           => "Register",
  26.     "SIGNUP_BUTTONTEXT"     => "Register Me",
  27.     "SIGNUP_AUDITTEXT"      => "Registered",
  28.     ));
  29.  
  30. // Signin
  31. $lang = array_merge($lang,array(
  32.     "SIGNIN_FAIL"           => "** FAILED LOGIN **",
  33.     "SIGNIN_TITLE"          => "Please Log In",
  34.     "SIGNIN_TEXT"           => "Log In",
  35.     "SIGNOUT_TEXT"          => "Log Out",
  36.     "SIGNIN_BUTTONTEXT"     => "Login",
  37.     "SIGNIN_AUDITTEXT"      => "Logged In",
  38.     "SIGNOUT_AUDITTEXT"     => "Logged Out",
  39.     ));
  40.  
  41. //Navigation
  42. $lang = array_merge($lang,array(
  43.     "NAVTOP_HELPTEXT"       => "Help",
  44.     ));
  45.  
  46. $query = $db->query("SELECT * FROM email");
  47. $results = $query->first();
  48.  
  49. //Value of email_act used to determine whether to display the Resend Verification link
  50. $email_act=$results->email_act;
  51.  
  52. ?>
  53. <!-- Navigation -->
  54. <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
  55.     <div class="container">
  56.         <!-- Brand and toggle get grouped for better mobile display -->
  57.         <div class="navbar-header ">
  58.             <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-top-menu-collapse">
  59.                 <span class="sr-only">Toggle navigation</span>
  60.                 <span class="icon-bar"></span>
  61.                 <span class="icon-bar"></span>
  62.                 <span class="icon-bar"></span>
  63.             </button>
  64.             <a class="" href="<?=$us_url_root?>"><img class="img-responsive" src="<?=$us_url_root?>users/images/logo.png" alt="" /></a>
  65.         </div>
  66.         <div class="collapse navbar-collapse navbar-top-menu-collapse navbar-right">
  67.             <ul class="nav navbar-nav ">
  68.                 <?php if($user->isLoggedIn()){ //anyone is logged in?>
  69.                     <li><a href="<?=$us_url_root?>users/account.php"><i class="fa fa-fw fa-user"></i> <?php echo ucfirst($user->data()->username);?></a></li> <!-- Common for Hamburger and Regular menus link -->
  70.  
  71.                     <?php if($settings->messaging == 1 && $msgC>0){ ?>
  72.                     <li><a href="<?=$us_url_root?>users/messages.php"><i class="fa fa-fw fa-envelope"></i><?=$msgC?> <?=$grammar?></a></li>
  73.                     <?php } ?>
  74.                     <li class="hidden-sm hidden-md hidden-lg"><a href="<?=$us_url_root?>"><i class="fa fa-fw fa-home"></i> Home</a></li> <!-- Hamburger menu link -->
  75.                     <?php if (checkMenu(2,$user->data()->id)){  //Links for permission level 2 (default admin) ?>
  76.                         <li class="hidden-sm hidden-md hidden-lg"><a href="<?=$us_url_root?>users/admin.php"><i class="fa fa-fw fa-cogs"></i> Admin Dashboard</a></li> <!-- Hamburger menu link -->
  77.                     <?php } // is user an admin ?>
  78.                     <li class="dropdown hidden-xs"><a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa fa-fw fa-cog"></i><b class="caret"></b></a> <!-- regular user menu -->
  79.                         <ul class="dropdown-menu"> <!-- open tag for User dropdown menu -->
  80.                             <li><a href="<?=$us_url_root?>"><i class="fa fa-fw fa-home"></i> Home</a></li> <!-- regular user menu link -->
  81.                             <li><a href="<?=$us_url_root?>users/account.php"><i class="fa fa-fw fa-user"></i> Account</a></li>
  82.                             <li><a href="<?=$us_url_root?>users/view_all_users.php"><i class="fa fa-fw fa-users"></i> Users</a></li>
  83.                         <?php if($settings->messaging == 1){ ?>
  84.                             <li><a href="<?=$us_url_root?>users/messages.php"><i class="fa fa-fw fa-envelope"></i> <?=$msgC?> <?=$grammar?></a></li>
  85.                         <?php } ?>
  86.                             <li><a href="<?=$us_url_root?>privacy_policy.php"><i class="fa fa-fw fa-file-text"></i> Privacy Policy</a></li>
  87.  
  88.                                      <!-- regular user menu link -->
  89.  
  90.                             <?php if (checkMenu(2,$user->data()->id)){  //Links for permission level 2 (default admin) ?>
  91.                                 <li class="divider"></li>
  92.                                 <li><a href="<?=$us_url_root?>users/admin.php"><i class="fa fa-fw fa-cogs"></i> Admin Dashboard</a></li> <!-- regular Admin menu link -->
  93.                             <?php } // is user an admin ?>
  94.                             <li class="divider"></li>
  95.                             <li><a href="<?=$us_url_root?>users/logout.php"><i class="fa fa-fw fa-sign-out"></i> Logout</a></li> <!-- regular Logout menu link -->
  96.                         </ul> <!-- close tag for User dropdown menu -->
  97.                     </li>
  98.  
  99.                     <li class="hidden-sm hidden-md hidden-lg"><a href="<?=$us_url_root?>users/logout.php"><i class="fa fa-fw fa-sign-out"></i> Logout</a></li> <!-- regular Hamburger logout menu link -->
  100.  
  101.                 <?php }else{ // no one is logged in so display default items ?>
  102.                     <li><a href="<?=$us_url_root?>users/login.php" class=""><i class="fa fa-sign-in"></i> Login</a></li>
  103.                     <li><a href="<?=$us_url_root?>users/join.php" class=""><i class="fa fa-plus-square"></i> Register</a></li>
  104.                     <li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa fa-life-ring"></i> Help <b class="caret"></b></a>
  105.                     <ul class="dropdown-menu">
  106.                     <li><a href="<?=$us_url_root?>users/forgot_password.php"><i class="fa fa-wrench"></i> Forgot Password</a></li>
  107.                     <?php if ($email_act){ //Only display following menu item if activation is enabled ?>
  108.                     <li><a href="<?=$us_url_root?>users/verify_resend.php"><i class="fa fa-exclamation-triangle"></i> Resend Activation Email</a></li>
  109.                     <li><a href="<?=$us_url_root?>privacy_policy.php"><i class="fa fa-file-text"></i> Privacy Policy</a></li>
  110.                     <?php }?>
  111.                     </ul>
  112.                     </li>
  113.                 <?php } //end of conditional for menu display ?>
  114.             </ul> <!-- End of UL for navigation link list -->
  115.         </div> <!-- End of Div for right side navigation list -->
  116.  
  117.     <?php require_once $abs_us_root.$us_url_root.'usersc/includes/navigation.php';?>
  118.  
  119.     </div> <!-- End of Div for navigation bar -->
  120. </div> <!-- End of Div for navigation bar styling -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement