author | Dan |
Thu, 12 Jul 2007 01:04:01 -0400 | |
changeset 2 | a8a21e1c7afa |
parent 0 | f9ffdbd96607 |
child 3 | c0c445d4a13e |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/*********************************************************************** |
|
3 |
||
4 |
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org) |
|
5 |
||
6 |
This file is part of PunBB. |
|
7 |
||
8 |
PunBB is free software; you can redistribute it and/or modify it |
|
9 |
under the terms of the GNU General Public License as published |
|
10 |
by the Free Software Foundation; either version 2 of the License, |
|
11 |
or (at your option) any later version. |
|
12 |
||
13 |
PunBB is distributed in the hope that it will be useful, but |
|
14 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
||
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|
21 |
MA 02111-1307 USA |
|
22 |
||
23 |
************************************************************************/ |
|
24 |
||
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
25 |
// Import the Enano API |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
26 |
global $db, $session, $paths, $template, $plugins; // Common objects |
0 | 27 |
|
28 |
// Make sure no one attempts to run this script "directly" |
|
29 |
if (!defined('PUN')) |
|
30 |
exit; |
|
31 |
||
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
32 |
$template->tpl_strings['PAGE_NAME'] = $page_title; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
33 |
$template->add_header('<pun_head>'); |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
34 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
35 |
// Special case - many Enano themes have indented paragraphs |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
36 |
$template->add_header('<style type="text/css"> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
37 |
div.pun p { |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
38 |
margin-left: 0; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
39 |
} |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
40 |
div.pun a[href ^="http://"] { |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
41 |
background-image: none; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
42 |
padding-right: 0; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
43 |
} |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
44 |
div.inbox li { |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
45 |
list-style-type: none !important; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
46 |
} |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
47 |
div.pun h2 { |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
48 |
border-bottom-width: 0; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
49 |
} |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
50 |
</style>'); |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
51 |
|
0 | 52 |
// Send no-cache headers |
53 |
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :) |
|
54 |
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
55 |
header('Cache-Control: post-check=0, pre-check=0', false); |
|
56 |
header('Pragma: no-cache'); // For HTTP/1.0 compability |
|
57 |
||
58 |
// Load the template |
|
59 |
if (defined('PUN_ADMIN_CONSOLE')) |
|
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
60 |
{ |
0 | 61 |
$tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl'); |
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
62 |
} |
0 | 63 |
else if (defined('PUN_HELP')) |
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
64 |
{ |
0 | 65 |
$tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl'); |
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
66 |
} |
0 | 67 |
else |
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
68 |
{ |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
69 |
// $tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl'); |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
70 |
$inner = '<div id="punwrap"> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
71 |
<div id="pun<pun_page>" class="pun"> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
72 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
73 |
<div id="brdheader" class="block"> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
74 |
<div class="box"> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
75 |
<div id="brdtitle" class="inbox"> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
76 |
<pun_title> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
77 |
<pun_desc> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
78 |
</div> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
79 |
<pun_navlinks> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
80 |
<pun_status> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
81 |
</div> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
82 |
</div> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
83 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
84 |
<pun_announcement> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
85 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
86 |
<pun_main> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
87 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
88 |
<pun_footer> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
89 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
90 |
</div> |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
91 |
</div>'; |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
92 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
93 |
$tpl_main = $template->getHeader() . $inner . $template->getFooter(); |
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
94 |
|
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
95 |
} |
0 | 96 |
|
97 |
||
98 |
// START SUBST - <pun_include "*"> |
|
99 |
while (preg_match('#<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">#', $tpl_main, $cur_include)) |
|
100 |
{ |
|
101 |
if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2])) |
|
102 |
error('Unable to process user include '.htmlspecialchars($cur_include[0]).' from template main.tpl. There is no such file in folder /include/user/'); |
|
103 |
||
104 |
ob_start(); |
|
105 |
include PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]; |
|
106 |
$tpl_temp = ob_get_contents(); |
|
107 |
$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main); |
|
108 |
ob_end_clean(); |
|
109 |
} |
|
110 |
// END SUBST - <pun_include "*"> |
|
111 |
||
112 |
// START SUBST - <pun_content_direction> |
|
113 |
$tpl_main = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_main); |
|
114 |
// END SUBST - <pun_content_direction> |
|
115 |
||
116 |
||
117 |
// START SUBST - <pun_char_encoding> |
|
118 |
$tpl_main = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_main); |
|
119 |
// END SUBST - <pun_char_encoding> |
|
120 |
||
121 |
// START SUBST - <pun_head> |
|
122 |
ob_start(); |
|
123 |
||
124 |
// Is this a page that we want search index spiders to index? |
|
125 |
if (!defined('PUN_ALLOW_INDEX')) |
|
126 |
echo '<meta name="ROBOTS" content="NOINDEX, FOLLOW" />'."\n"; |
|
127 |
||
128 |
?> |
|
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
129 |
<link rel="stylesheet" type="text/css" href="<?php echo scriptPath; ?>/punbb/style/<?php echo $pun_user['style'].'.css' ?>" /> |
0 | 130 |
<?php |
131 |
||
132 |
if (defined('PUN_ADMIN_CONSOLE')) |
|
133 |
echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n"; |
|
134 |
||
135 |
if (isset($required_fields)) |
|
136 |
{ |
|
137 |
// Output JavaScript to validate form (make sure required fields are filled out) |
|
138 |
||
139 |
?> |
|
140 |
<script type="text/javascript"> |
|
141 |
<!-- |
|
142 |
function process_form(the_form) |
|
143 |
{ |
|
144 |
var element_names = new Object() |
|
145 |
<?php |
|
146 |
||
147 |
// Output a JavaScript array with localised field names |
|
148 |
while (list($elem_orig, $elem_trans) = @each($required_fields)) |
|
149 |
echo "\t".'element_names["'.$elem_orig.'"] = "'.addslashes(str_replace(' ', ' ', $elem_trans)).'"'."\n"; |
|
150 |
||
151 |
?> |
|
152 |
||
153 |
if (document.all || document.getElementById) |
|
154 |
{ |
|
155 |
for (i = 0; i < the_form.length; ++i) |
|
156 |
{ |
|
157 |
var elem = the_form.elements[i] |
|
158 |
if (elem.name && elem.name.substring(0, 4) == "req_") |
|
159 |
{ |
|
160 |
if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='') |
|
161 |
{ |
|
162 |
alert("\"" + element_names[elem.name] + "\" <?php echo $lang_common['required field'] ?>") |
|
163 |
elem.focus() |
|
164 |
return false |
|
165 |
} |
|
166 |
} |
|
167 |
} |
|
168 |
} |
|
169 |
||
170 |
return true |
|
171 |
} |
|
172 |
// --> |
|
173 |
</script> |
|
174 |
<?php |
|
175 |
||
176 |
} |
|
177 |
||
178 |
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; |
|
179 |
if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false) |
|
180 |
echo '<script type="text/javascript" src="style/imports/minmax.js"></script>'; |
|
181 |
||
182 |
$tpl_temp = trim(ob_get_contents()); |
|
183 |
$tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main); |
|
184 |
ob_end_clean(); |
|
185 |
// END SUBST - <pun_head> |
|
186 |
||
187 |
||
188 |
// START SUBST - <body> |
|
189 |
if (isset($focus_element)) |
|
190 |
{ |
|
191 |
$tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main); |
|
192 |
$tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main); |
|
193 |
} |
|
194 |
// END SUBST - <body> |
|
195 |
||
196 |
||
197 |
// START SUBST - <pun_page> |
|
198 |
$tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main); |
|
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
199 |
// END SUBST - <pun_page> |
0 | 200 |
|
201 |
||
202 |
// START SUBST - <pun_title> |
|
203 |
$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['o_board_title']).'</span></h1>', $tpl_main); |
|
204 |
// END SUBST - <pun_title> |
|
205 |
||
206 |
||
207 |
// START SUBST - <pun_desc> |
|
208 |
$tpl_main = str_replace('<pun_desc>', '<p><span>'.$pun_config['o_board_desc'].'</span></p>', $tpl_main); |
|
209 |
// END SUBST - <pun_desc> |
|
210 |
||
211 |
||
212 |
// START SUBST - <pun_navlinks> |
|
213 |
$tpl_main = str_replace('<pun_navlinks>','<div id="brdmenu" class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main); |
|
214 |
// END SUBST - <pun_navlinks> |
|
215 |
||
216 |
||
217 |
// START SUBST - <pun_status> |
|
218 |
if ($pun_user['is_guest']) |
|
219 |
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>'; |
|
220 |
else |
|
221 |
{ |
|
222 |
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>'; |
|
223 |
||
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
224 |
if ($pun_user['g_id'] >= USER_LEVEL_MEMBER) |
0 | 225 |
{ |
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
226 |
$result_header = $pun_db->query('SELECT COUNT(id) FROM '.$pun_db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $pun_db->error()); |
0 | 227 |
|
2
a8a21e1c7afa
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents:
0
diff
changeset
|
228 |
if ($pun_db->result($result_header)) |
0 | 229 |
$tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>'; |
230 |
||
231 |
if ($pun_config['o_maintenance'] == '1') |
|
232 |
$tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>'; |
|
233 |
} |
|
234 |
||
235 |
if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php'))) |
|
236 |
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; |
|
237 |
else |
|
238 |
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; |
|
239 |
} |
|
240 |
||
241 |
$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main); |
|
242 |
// END SUBST - <pun_status> |
|
243 |
||
244 |
// START SUBST - <pun_announcement> |
|
245 |
if ($pun_config['o_announcement'] == '1') |
|
246 |
{ |
|
247 |
ob_start(); |
|
248 |
||
249 |
?> |
|
250 |
<div id="announce" class="block"> |
|
251 |
<h2><span><?php echo $lang_common['Announcement'] ?></span></h2> |
|
252 |
<div class="box"> |
|
253 |
<div class="inbox"> |
|
254 |
<div><?php echo $pun_config['o_announcement_message'] ?></div> |
|
255 |
</div> |
|
256 |
</div> |
|
257 |
</div> |
|
258 |
<?php |
|
259 |
||
260 |
$tpl_temp = trim(ob_get_contents()); |
|
261 |
$tpl_main = str_replace('<pun_announcement>', $tpl_temp, $tpl_main); |
|
262 |
ob_end_clean(); |
|
263 |
} |
|
264 |
else |
|
265 |
$tpl_main = str_replace('<pun_announcement>', '', $tpl_main); |
|
266 |
// END SUBST - <pun_announcement> |
|
267 |
||
268 |
// START SUBST - <pun_main> |
|
269 |
ob_start(); |
|
270 |
||
271 |
||
272 |
define('PUN_HEADER', 1); |