-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathheader.php
More file actions
163 lines (117 loc) · 5.41 KB
/
header.php
File metadata and controls
163 lines (117 loc) · 5.41 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/**
* MASTER LOGIN SYSTEM
* @author Mihai Ionut Vilcu (ionutvmi@gmail.com)
* June 2013
*
*/
// we generate the navbar components in case they weren't before
if($page->navbar == array())
$page->navbar = $presets->GenerateNavbar();
if(!$user->islg()) // if it's not logged in we hide the user menu
unset($page->navbar[count($page->navbar)-1]);
?><!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php echo $page->title; ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="<?php echo $set->url; ?>/css/bootstrap.min.css">
<!-- join the dark side :) -->
<!-- <link rel="stylesheet" href="<?php echo $set->url; ?>/css/darkstrap.min.css">-->
<style>
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link rel="stylesheet" href="<?php echo $set->url; ?>/css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="<?php echo $set->url; ?>/css/main.css">
<script src="<?php echo $set->url; ?>/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="<?php echo $set->url; ?>"><?php echo $set->site_name; ?></a>
<div class="nav-collapse collapse">
<ul class="nav pull-left">
<?php
// we generate a simple menu this may need to be adjusted depending on your needs
// but it should be ok for most common items
foreach ($page->navbar as $key => $v) {
if ($v[0] == 'item') {
echo "<li".($v[1]['class'] ? " class='".$v[1]['class']."'" : "").">
<a href='".$v[1]['href']."'>".$v[1]['name']."</a></li>";
} else if($v[0] == 'dropdown') {
echo "<li class='dropdown".
// extra classes
($v['class'] ? " ".$v['class'] : "")."'".
// extra style
($v['style'] ? " style='".$v['style']."'" : "").">
<a href='#' class='dropdown-toggle' data-toggle='dropdown'>".$v['name']." <b class='caret'></b></a>
<ul class='dropdown-menu'>";
foreach ($v[1] as $k => $v)
echo "<li".
($v['class'] ? " class='".$v['class']."'" : "").">
<a href='".$v['href']."'>".$v['name']."</a></li>";
echo "</ul></li>";
}
}
echo "</ul>";
if(!$user->islg()) {
echo "<span class='pull-right'>
<a href='$set->url/register.php' class='btn btn-primary btn-small'>Sign Up</a>
<!-- <a href='$set->url/login.php' class='btn btn-small'>Login</a> -->
<a href='#loginModal' data-toggle='modal' class='btn btn-small'>Login</a>
</span>
";
}
echo "
</div><!--/.nav-collapse -->
</div>
</div>
</div>";
if($user->data->banned) {
// we delete the expired banned
$_unban = $db->getAll("SELECT `userid` FROM `".MLS_PREFIX."banned` WHERE `until` < ".time());
if($_unban)
foreach ($_unban as $_usr) {
$db->query("DELETE FROM `".MLS_PREFIX."banned` WHERE `userid` = ?i", $_usr->userid);
$db->query("UPDATE `".MLS_PREFIX."users` SET `banned` = '0' WHERE `userid` = ?i", $_usr->userid);
}
$_banned = $user->getBan();
if($_banned)
$options->error("You were banned by <a href='$set->url/profile.php?u=$_banned->by'>".$user->showName($_banned->by)."</a> for `<i>".$options->html($_banned->reason)."</i>`.
Your ban will expire in ".$options->tsince($_banned->until, "from now.")."
");
}
if($user->islg() && $set->email_validation && ($user->data->validated != 1)) {
$options->fError("Your account is not yet acctivated ! Please check your email !");
}
if(file_exists('install.php')) {
$options->fError("You have to delete the install.php file before you start using this app.");
}
if(isset($_SESSION['success'])){
$options->success($_SESSION['success']);
unset($_SESSION['success']);
}
if(isset($_SESSION['error'])){
$options->error($_SESSION['error']);
unset($_SESSION['error']);
}
flush(); // we flush the content so the browser can start the download of css/js