-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage_top.php
134 lines (105 loc) · 3.01 KB
/
page_top.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
/* used by
add_topic
index
list_topics
view_topic
*/
@session_start();
date_default_timezone_set("UTC");
if (isset($_SESSION['login_expiration']) && $_SESSION["login_expiration"] != date("Y-m-d"))
{
session_destroy();
}
if (isset($_SESSION["id"])) {
$is_admin = true;
}
else {
$is_admin = false;
}
require_once('general.php');
$db = new dbase();
$db->connect_sqlite();
function breadcrumb($db, $category_id, $suffix = null){
//returns an array [0] breadcrumb [1] is_private
$is_private = 0;
$id = $category_id;
$breadcrumb = array();
while ($id != 0){
$row = $db->getRow("select cat_id, cat_parent_id, cat_name, cat_private from categories where cat_id = $id", null);
if (!$row) {
return false;
}
$breadcrumb[] = array($row['cat_id'], $row['cat_name']);
$id = $row['cat_parent_id'];
if (($row['cat_private']) > $is_private)
$is_private = ($row['cat_private']);
}
$breadcrumb = array_reverse($breadcrumb);
$output = '<a href="."><span class="glyphicon glyphicon glyphicon-home"></span></a>';
foreach($breadcrumb as $crumb) {
if ($category_id == $crumb[0])
$output .= " > <a class='btn btn-success btn-xs' href='list_topics.php?id=$crumb[0]'>$crumb[1]</a>";
else
$output .= " > <a href='list_topics.php?id=$crumb[0]'>$crumb[1]</a>";
}
if ($suffix)
$output .= $suffix;
return array('<div class="row" style="margin-left:0px;margin-bottom:20px">' . $output . '</div>', $is_private);// '<br><br>';
}
?>
<!DOCTYPE html>
<html>
<head>
<!--http://glyphicons.bootstrapcheatsheets.com/-->
<meta charset="UTF-8">
<title>Forums</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- bootstrap -->
<link href="assets/bootstrap.min.css" rel="stylesheet" type="text/css" />
<?php if (isset($_SESSION["id"])) { ?>
<!-- rmodal -->
<style>
.modal {
display: none;
background: rgba(0, 0, 0, .30);
z-index: 999;
}
.modal-body {
position: relative;
padding: 30px;
}
.modal .modal-dialog {
position: relative;
margin: 30px auto;
width: 500px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}
</style>
<?php } ?>
</head>
<body>
<div class="container">
<div class="header">
<nav>
<ul class="nav nav-pills pull-right">
<?php if ($is_admin) { ?>
<li><a href="./cal">Calendar</a></li>
<li><a href="search.php">Search</a></li>
<?php } ?>
<?php if (!$is_admin) { ?>
<li><a href="login.php" id="login_button">Login</a></li>
<?php } else { ?>
<li><a href="login.php?logout=1" id="login_button">Logout</a></li>
<?php } ?>
</ul>
</nav>
<h3 class="text-muted"><a href=".">ppBB</a></h3>
</div>
<div class="marketing">
<div class="jumbotron">
<h1>It's all just talk</h1>
<!-- <p class="lead">This is a demonstration install of the <a href="https://github.com/Xeoncross/forumfive">ForumFive</a> PHP forum system. Please be respectful.</p> -->
</div>