forked from saintly2k/ImoutoIB
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmod.php
140 lines (115 loc) · 4.26 KB
/
mod.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
134
135
136
137
138
139
140
<?php
require 'require.php';
//ALL MOD POST FORM ACTIONS CAN BE FOUND HERE
require $path . '/includes/mod-actions.php';
//NAVIGATION
$mod_navigation = '<div class="box left">';
$mod_navigation .= '<h2>Navigation</h2>';
$mod_navigation .= '<ul class="box-list">';
//HOME
$mod_navigation .= '<li><a href="' . $prefix_folder . '/mod.php"';
if ((!isset($_GET["page"])) || ($_GET["page"] == '')) {
$mod_navigation .= 'class="active"';
}
$mod_navigation .= '>Home</a></li>';
//ACCOUNT
$mod_navigation .= '<li><a href="' . $prefix_folder . '/mod.php?page=account"';
if ($_GET["page"] == 'account') {
$mod_navigation .= 'class="active"';
}
$mod_navigation .= '>Account</a></li>';
//USERS
if ($config['mod']['edit_user'] <= $user_mod_level) {
$mod_navigation .= '<li><a href="' . $prefix_folder . '/mod.php?page=users"';
if ($_GET["page"] == 'users') {
$mod_navigation .= 'class="active"';
}
$mod_navigation .= '>Manage Users</a></li>';
}
//REPORTS
if ($config['mod']['reports'] <= $user_mod_level) {
$mod_navigation .= '<li><a href="' . $prefix_folder . '/mod.php?page=reports"';
if ($_GET["page"] == 'reports') {
$mod_navigation .= 'class="active"';
}
if (file_exists($path . '/' . $database_folder . '/reports/current.php')) {
$reports = file_get_contents($path . '/' . $database_folder . '/reports/current.php');
} else {
$reports = 0;
}
$mod_navigation .= '>Reports (' . $reports . ')</a></li>';
}
//GLOBAL REPORTS
if ($config['mod']['global_reports'] <= $user_mod_level) {
$mod_navigation .= '<li><a href="' . $prefix_folder . '/mod.php?page=global_reports"';
if ($_GET["page"] == 'global_reports') {
$mod_navigation .= 'class="active"';
}
if (file_exists($path . '/' . $database_folder . '/reportsglobal/current.php')) {
$reports_global = file_get_contents($path . '/' . $database_folder . '/reportsglobal/current.php');
} else {
$reports_global = 0;
}
$mod_navigation .= '>Global Reports (' . $reports_global . ')</a></li>';
}
//BANLIST
if ($config['mod']['ban'] <= $user_mod_level) {
$mod_navigation .= '<li><a href="' . $prefix_folder . '/mod.php?page=bans"';
if ($_GET["page"] == 'bans') {
$mod_navigation .= 'class="active"';
}
$mod_navigation .= '>Manage Bans</a></li>';
}
$mod_navigation .= '</ul>';
$mod_navigation .= '</div>';
//LOGOUT BUTTON
$logged_in_as = '<br>Logged in as: (ID:' . $user_id . ', Username: ' . $username . ', Level: ' . $user_mod_level . ')<br><form name="logout" action="' . $prefix_folder . '/mod.php" method="post"><input type="hidden" id="logout" name="logout" value="logout"><input type="Submit" value="Logout"></form>';
//ABOVE DASHBOARD
//add noticeboard + pm notification here maybe?
$dashboard_notifications = '<div class="main first"><h2>Moderator tools</h2>';
$dashboard_notifications .= '<p>Things like notices or messages may be here later.</p>';
$dashboard_notifications .= '</div>';
//$dashboard_notifications = ''; //clear it out for now?
//DASHBOARD
if ((!isset($_GET["page"])) || ($_GET["page"] == '')) {
include $path . '/templates/mod/dashboard.php';
}
//ACCOUNT PAGE
if ($_GET["page"] == 'account') {
include $path . '/templates/mod/account.php';
}
//USERS PAGE
if ($_GET["page"] == 'users') {
include $path . '/templates/mod/users.php';
}
//REPORTS PAGE
if ($_GET["page"] == 'reports') {
include $path . '/templates/mod/reports.php';
}
//GLOBAL REPORTS PAGE
if ($_GET["page"] == 'global_reports') {
include $path . '/templates/mod/global_reports.php';
}
//BANS PAGE
if ($_GET["page"] == 'bans') {
include $path . '/templates/mod/bans.php';
}
//If literally none of the above activates.
$title = 'Error! - ' . $site_name;
if (isset($_GET['theme'])) {
$output_html .= '<html data-stylesheet="'. htmlspecialchars($_GET['theme']) .'">';
} else {
$output_html .= '<html data-stylesheet="'. $current_theme .'">';
}
$output_html .= '<head>';
include $path . '/templates/header.php';
$output_html .= '</head>';
$output_html .= '<body class="frontpage">';
//include $path . '/templates/boardlist.php';
$output_html .= '<div class="message">Gomen nasai... Woah — Unknown Error!<br>Please leave a detailed bug report... Page may not exist, if this was unintended please let me know.</div>';
//include $path . '/templates/footer.php';
$output_html .= '</body>';
$output_html .= '</html>';
echo $output_html;
exit();
?>