SHOW:
|
|
- or go back to the newest paste.
1 | - | <? |
1 | + | <? session_start(); |
2 | $version = "Cruel Constrictor"; | |
3 | - | session_start(); |
3 | + | |
4 | ?> | |
5 | - | include "header.php"; |
5 | + | |
6 | <!DOCTYPE html> | |
7 | - | $galleries_base_dir = "gallery"; |
7 | + | <html lang="en"> |
8 | - | $default_gallery = "default_gallery"; |
8 | + | <head> |
9 | - | $pages_base_dir = "p"; |
9 | + | <meta charset="utf-8"> |
10 | - | $default_page = "home"; |
10 | + | <title>MassiveDeck: <? echo $version; ?></title> |
11 | - | |
11 | + | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
12 | - | if(isset($_GET['page'])) { |
12 | + | <meta name="description" content=""> |
13 | - | $page = $_GET['page']; |
13 | + | <meta name="author" content=""> |
14 | - | } else { |
14 | + | |
15 | - | $page = $default_page; |
15 | + | <link href="css/bootstrap.css" rel="stylesheet"> |
16 | - | } |
16 | + | <style type="text/css"> |
17 | - | |
17 | + | body { |
18 | - | switch($page) { |
18 | + | padding-top: 60px; |
19 | - | case "gallery": |
19 | + | padding-bottom: 40px; |
20 | - | if(isset($_GET['gallery'])) { |
20 | + | } |
21 | - | $gallery = $_GET['gallery']; |
21 | + | </style> |
22 | - | } else { |
22 | + | |
23 | - | $gallery = $default_gallery; |
23 | + | <link href="css/bootstrap-responsive.css" rel="stylesheet"> |
24 | ||
25 | - | $gallery_path = "{$galleries_base_dir}/{$gallery}.php"; |
25 | + | </head> |
26 | - | include(get_page_to_load($gallery_path, "{$galleries_base_dir}/{$default_gallery}.php")); |
26 | + | |
27 | - | break; |
27 | + | <body> |
28 | - | default: |
28 | + | |
29 | - | $page_path = "{$pages_base_dir}/{$page}.php"; |
29 | + | <div class="navbar navbar-inverse navbar-fixed-top"> |
30 | - | include(get_page_to_load($page_path, "{$pages_base_dir}/{$default_page}.php")); |
30 | + | <div class="navbar-inner"> |
31 | - | break; |
31 | + | <div class="container"> |
32 | - | } |
32 | + | <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> |
33 | - | |
33 | + | <span class="icon-bar"></span> |
34 | - | function get_page_to_load($attempted_page, $default_page) { |
34 | + | <span class="icon-bar"></span> |
35 | - | if($attempted_page != $default_page && file_exists($attempted_page)) { |
35 | + | <span class="icon-bar"></span> |
36 | - | return $attempted_page; |
36 | + | </button> |
37 | - | } else { |
37 | + | <a class="brand" href="#"><? echo $version; ?></a> |
38 | - | return $default_page; |
38 | + | <div class="nav-collapse collapse"> |
39 | - | } |
39 | + | <ul class="nav"> |
40 | - | } |
40 | + | <li><a href="index.php">Home</a></li> |
41 | - | |
41 | + | <li><a href="index.php?page=cards">Cards</a></li> |
42 | <li><a href="#contact">Contact</a></li> | |
43 | - | include "footer.php"; |
43 | + | <?php |
44 | if(isset($_SESSION['logged_in'])) { | |
45 | - | ?> |
45 | + | echo "<li><a href='index.php?page=profile'>Profile</a></li>"; |
46 | if($_SESSION["username"] == "admin") { | |
47 | echo '<li><a href="index.php?page=addcards">Add Cards</a></li>'; | |
48 | } | |
49 | ||
50 | } | |
51 | ?> | |
52 | </ul> | |
53 | ||
54 | <?php if(isset($_SESSION['logged_in'])) { | |
55 | echo "<p class='navbar-text pull-right'>Logged in as <a href='#' class='navbar-link'>" . $_SESSION["username"] . " </a>[ <a href='logout.php'>logout</a> ]"; | |
56 | } | |
57 | else { | |
58 | ||
59 | echo '<form class="navbar-form pull-right" name="formlog" method="post" action="auth.php">'; | |
60 | echo '<input class="span2" type="text" name="username" placeholder="Username"> '; | |
61 | echo '<input class="span2" type="password" name="password" placeholder="Password"> '; | |
62 | echo '<input type="hidden" name="formlog" value="1">'; | |
63 | echo '<button type="submit" class="btn">Sign in</button>'; | |
64 | echo '</form>'; | |
65 | } | |
66 | ||
67 | ?> | |
68 | ||
69 | </div> | |
70 | </div> | |
71 | </div> | |
72 | </div> | |
73 | ||
74 | <div class="container"> |