Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 25th, 2012  |  syntax: None  |  size: 2.06 KB  |  views: 44  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. require_once("includes/inc.php");
  3.  
  4. if ($_SESSION['username'] != null) {
  5.         $u_query = mysql_query("SELECT * FROM users WHERE `username` = '" . $_SESSION['username'] . "' LIMIT 1");
  6.     $user = mysql_fetch_array($u_query);
  7. ?>
  8. <!DOCTYPE HTML>
  9. <html>
  10. <head>
  11. <body>
  12. <div class="navbar navbar-fixed-top">
  13.   <div class="navbar-inner">
  14.     <div class="container">
  15.         <a class="brand" href="index.php"><?php echo $sitename ?></a>
  16. <ul class="nav">
  17. <?php
  18. $page = basename($_SERVER['REQUEST_URI']);
  19. ?>
  20. <li <? if ($page == "member.php") { echo "class=\"active\""; } ?> ><a href="/test1/member.php">Home</a></li>
  21. <li <? if ($page == "member.php?page=account") { echo "class=\"active\""; } ?> ><a href="/test1/member.php?page=account">Account</a></li>
  22. <li <? if ($page == "files.php") { echo "class=\"active\""; } ?> ><a href="/test1/files.php">Files</a></li>
  23. <li <? if ($page == "upload.php") { echo "class=\"active\""; } ?> ><a href="/test1/upload.php">Upload</a></li>
  24. <li <? if ($page == "payments.php") { echo "class=\"active\""; } ?> ><a href="/test1/payments.php">Payments</a></li>
  25. <li <? if ($page == "referrals.php") { echo "class=\"active\""; } ?> ><a href="/test1/referrals.php">Referrals</a></li>
  26. <?php if ($user['admin'] == 1) { //Check if user is admin ?>
  27. <li <? if ($page == "admin") { echo "class=\"active\""; } ?>><a href="/test1/admin">Admin Panel</a></li>
  28. <?php
  29. }
  30. ?>
  31.  
  32. <li><a href="/test1/member.php?page=logout">Logout</b></a></li>
  33. </ul>
  34.   </div>
  35.  </div>
  36. </div>
  37. <?php
  38. } else {
  39. ?>
  40. <div class="navbar navbar-fixed-top">
  41.   <div class="navbar-inner">
  42.     <div class="container">
  43.         <a class="brand" href="index.php"><?php echo $sitename ?></a>
  44. <ul class="nav">
  45. <?php
  46. $page = basename($_SERVER['REQUEST_URI']);
  47. ?>
  48. <li <? if ($page == "login.php") { echo "class=\"active\""; } ?> ><a href="/test1index.php">Home</a></li>
  49. <li><a href="login.php">Login</a></li>
  50. <li <? if ($page == "register.php") { echo "class=\"active\""; } ?> ><a href="/test1register.php">Register</a></li>
  51. <?php
  52. }
  53. ?>
  54. </ul>
  55.   </div>
  56.  </div>
  57. </div>
  58. </div>
  59. </body>
  60. </head>
  61. </html>
clone this paste RAW Paste Data