function set_header($title = "Daydream", $current_page) { ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title><?php echo $title; ?> </title> <!-- Bootstrap --> <link href="./css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="./css/font-awesome.min.css" rel="stylesheet" media="screen"> <link href="css/main.css" rel="stylesheet" media="screen"> <script src="js/jquery-1.8.3.min.js"></script> <script src="js/bootstrap.js"></script> <script> $(function(){ $("i[rel=tooltip]").tooltip( ); $('button[rel=tooltip]').tooltip( ); $('a').tooltip(); $(".icon-retweet").parent().click(function(){ $(this).parent().parent().parent().children(".reply").toggle() }); $(".popover").hover(function(){ $(this).find("#like").css("display","block") }, function(){ $(this).find("#like").css("display","none") }) $("i").parent().mouseenter(function(){ $(this).parent().css("cursor","pointer") }) $(".hobby .club-show").hover(function(){ $(this).find(".popover").css("display","block") }, function(){ $(this).find(".popover").css("display","none") }); $('#myCarousel').carousel({interval:'3000'}); $('#act').scrollspy(); }) </script> </head> <body data-spy='scroll' data-target="#act" data-offset="20"> <?php set_navbar($current_page); ?> <div class="container" > <?php }
{ global $page_title; $page_title = $title; } //-----------WARNING----------// //Specifying the same permissions in the same level of the array //will lead to duplicate array keys, which will erase the first one. //Append a random number to the permission to alleviate this, //or nest so that it doesn't happen. $main_navbar = array('Home', 'E' => ['Verify Email' => 'Account/Verify_Email'], '+' => ['Super-Admin' => 'Admin/Super_Admin'], 'B' => ['Banned'], 'X' => ['LMT', '', 'MAML', '', 'Calendar', 'Contests', 'Contact', 'About', '', 'Member Sign-in' => 'Account/Signin', 'Member Registration' => 'Account/Register'], 'ARL' => ['LMT', '', 'MAML', '', 'Contact', 'About', '', 'Messages', 'Calendar', 'Contests', 'Files', '', 'AR' => ['My Scores' => 'My_Scores'], 'My Profile' => 'Account/My_Profile', 'A' => ['', 'Admin Dashboard' => 'Admin/Dashboard']]); $admin_navbar = array('A' => ['Home', 'Admin Dashboard' => 'Admin/Dashboard', 'Captains\' Guide' => 'Admin/Captains', 'Webmasters\' Guide' => 'Admin/Webmaster', '', 'User List' => 'Admin/User_List', 'Search Members' => 'Admin/Member_Search', 'Invite Members' => 'Admin/Invite_Members', 'Approve Users' => 'Admin/Approve_Users', 'Temporary Users' => 'Admin/Temporary_Users', 'Alumni' => 'Admin/Alumni', '', 'Post a Message' => 'Admin/Post_Message', '', 'Tests' => 'Admin/Tests', 'Calendar', 'Files' => 'Admin/Files', '', 'Edit Home Page' => 'Admin/Edit_Page?Home', 'Edit Contests Page' => 'Admin/Edit_Page?Contests', '', 'Uptime Report' => 'Admin/Uptime', 'Login Log' => 'Admin/Login_Log', 'Registration Log' => 'Admin/Registration_Log', 'Database' => 'Admin/Database']); if (strpos(get_relative_path(), 'Admin') === 0) { // restrict_access('A'); set_navbar($admin_navbar); } else { set_navbar($main_navbar); } function set_navbar($n) { global $navbar_array; $navbar_array = $n; } function navbar_html($navbar = NULL) { if (is_null($navbar)) { global $navbar_array; $navbar = $navbar_array; } $html = ''; foreach ($navbar as $key => $nav_elem) { if (is_array($nav_elem)) {
echo set_navbar('Credit Cards'); echo $T->parse('output', 'text'); include 'user_credit_card.php'; break; case "bank_accounts": echo set_navbar('Bank Accounts'); echo $T->parse('output', 'text'); include 'user_bank_account.php'; break; case "orders": echo set_navbar('Previous Orders'); echo $T->parse('output', 'text'); include 'orders.php'; break; default: echo set_navbar('User Information'); echo $T->parse('output', 'text'); include 'user_info.php'; break; } $T->set_file('text', 'user_footer.thtml'); echo $T->parse('output', 'text'); echo COM_siteFooter(1); #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^SET_NAVBAR^^^^^^^^^^^^^^^^^^^^^^^^ # Creates the nav bar to be displayed. # $selected -> determine which tab is selected #___________________________________________________________________________________________________ function set_navbar($selected = '') { $navbar = new navbar(); $navbar->add_menuitem('User Information', $PHP_SELF . '?op=user_info');
$header_class = 'noPrint'; } } $lmt_main_navbar = array('Math Club Home' => 'Home', backstage_is_open() ? 'ARL' : 'A' => ['Backstage' => 'LMT/Backstage/Home'], ''); $result = DB::query('SELECT page_id, name FROM pages ORDER BY order_num'); foreach ($result as $row) { if ($row['page_id'] == '-1') { if (registration_is_open()) { $lmt_main_navbar['Registration'] = 'LMT/Registration/Home'; $lmt_main_navbar[] = ''; } } else { if ($row['name'] == '') { $lmt_main_navbar[] = ''; } else { $lmt_main_navbar[$row['name']] = 'LMT/' . str_replace(' ', '_', $row['name']); } } } $lmt_backstage_navbar = array('ARL' => ['LMT Home' => 'LMT', 'Backstage Home' => 'LMT/Backstage/Home', 'A' => ['', 'Status' => 'LMT/Backstage/Status', 'Website' => 'LMT/Backstage/Pages/List', 'Email' => 'LMT/Backstage/Email/Home', 'Export' => 'LMT/Backstage/Export'], '', 'Check-in' => 'LMT/Backstage/Checkin/Home', 'Score Entry' => 'LMT/Backstage/Scoring/Home', 'Guts Round' => 'LMT/Backstage/Guts/Home', 'Results' => 'LMT/Backstage/Results/Full', '', 'Data' => 'LMT/Backstage/Data/Home', 'Verification' => 'LMT/Backstage/Database/Verify', 'Backup' => 'LMT/Backstage/Database/Backup']); if (strpos(get_relative_path(), 'Backstage') === 4) { //position 4, because it's after 'LMT/' if (backstage_is_open()) { restrict_access('ARL'); } else { restrict_access('A'); } set_navbar($lmt_backstage_navbar); } else { set_navbar($lmt_main_navbar); }