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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
<?php /* $Id: index.php,v 1.1.1.1 2002/10/28 19:13:47 pbaecher Exp $ */ /* ThWboard - PHP/MySQL Bulletin Board System ============================================== (c) 2000, 2001 by Paul Baecher <paul@thewall.de> Felix Gonschorek <funner@thewall.de>
download the latest version: http://www.thwboard.de
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
==============================================
*/ include "./inc/header.inc.php";
function getusercount() { global $pref; $r_user = thwb_query("SELECT count(userid) AS usercount FROM ".$pref."user"); $user = mysql_fetch_array($r_user); return $user['usercount']; }
function getactiveusers() { global $pref; $r_user = thwb_query("SELECT count(userid) AS usercount FROM ".$pref."user WHERE userlastpost > " . (time() - 60 * 60 * 24 * 31)); $user = mysql_fetch_array($r_user); return $user['usercount']; }
$Tframe = new Template("templates/" . $style['styletemplate'] . "/frame.html"); $Tindex = new Template("templates/" . $style['styletemplate'] . "/main.html"); $Tcategory = new Template("templates/" . $style['styletemplate'] . "/categoryrow.html"); $Tboard = new Template("templates/" . $style['styletemplate'] . "/forumrow.html");
if( $config['uselastthreads'] ) { $Tlastthreads = new Template('templates/'.$style['styletemplate'].'/lastthreads.html'); eval($Tlastthreads->GetTemplate('lastthreads')); } else { $lastthreads = ''; }
if( $category['categoryid'] ) { $where = "WHERE categoryid='".intval($category['categoryid'])."' "; } else { $where = ''; }
// category _ $r_category = thwb_query("SELECT categoryid, categoryname FROM ".$pref."category ".$where."ORDER BY categoryorder ASC");
// lastvisited if( $g_user['userid'] ) { $a_lastvisited = array(); $r_lastvisited = thwb_query("SELECT boardid, lastvisitedtime FROM ".$pref."lastvisited WHERE userid=$g_user[userid]"); while( $lastvisited = mysql_fetch_array($r_lastvisited) ) { $a_lastvisited[$lastvisited['boardid']] = $lastvisited['lastvisitedtime']; } }
// perm stuff $P = new Permission($g_user['groupids']);
// precache boards $a_board = array(); $r_board = thwb_query("SELECT boardid, boardname, boardthreads, boardposts, boardlastpost, boarddescription, boardlastpostby, boardthreadtopic, boardthreadid, categoryid FROM ".$pref."board WHERE boarddisabled = 0 ORDER BY boardorder ASC"); while( $board = mysql_fetch_array($r_board) ) { if( $g_user['userid'] == 0 && $board['boardnoguests'] ) { continue; } $P->set_boardid($board['boardid']); if( $P->has_permission( P_VIEW ) /*has_access($board['boardid'], &$a_groupboard)*/ ) { if( $board['boardlastpost'] == 0 ) { $board['modified'] = "(Noch kein Post)"; } else { $board['modified'] = form_date($board['boardlastpost']) . "<br><a href=\"showtopic.php?threadid=$board[boardthreadid]&time=$lastvisited&pagenum=lastpage\">" . parse_code(chopstring($board['boardthreadtopic'], 30)) . '</a> von ' . parse_code($board['boardlastpostby']); } } else { if( $config['showprivateboards'] ) { $board['modified'] = '<font color="' . $style['color_err'] . '">N/A</font>'; $board['boardthreads'] = '<font color="' . $style['color_err'] . '">N/A</font>'; $board['boardposts'] = '<font color="' . $style['color_err'] . '">N/A</font>';
$board['boarddescription'] = '<font color="' . $style['color_err'] . '">[Kein Zugriff] </font>' . $board['boarddescription']; } else { continue; } } $a_board[$board['categoryid']][] = $board; } mysql_free_result($r_board);
// print boards while( $category = mysql_fetch_array($r_category) ) { if( isset($a_board[$category['categoryid']]) ) { eval($Tcategory->GetTemplate("INDEXROWS")); while( list(, $board) = each($a_board[$category['categoryid']]) ) { if( $board['boardlastpost'] > $a_lastvisited[$board['boardid']] && $a_lastvisited[$board['boardid']] != 0 ) { $imagepath = './templates/'.$style['styletemplate'].'/images/board_new.gif'; } else { $imagepath = './templates/'.$style['styletemplate'].'/images/board.gif'; } eval($Tboard->GetTemplate("INDEXROWS")); } } }
$stats = "Das Forum hat <b>" . getusercount() . "</b> registrierte Benutzer, davon sind <b>" . getactiveusers() . "</b> aktiv.";
$r_post = thwb_query("SELECT count(postid) AS postcount FROM ".$pref."post"); $posts = mysql_result($r_post, 0);
$r_thread = thwb_query("SELECT count(threadid) AS threadcount FROM ".$pref."thread"); $threads = mysql_result($r_thread, 0);
$stats .= '<br><b>' . $threads .'</b> Threads | <b>' . $posts . '</b> Posts';
$newthreads .= '<a href="search.php?startsearch=1&searchfor=today">Aktive Threads von Heute anzeigen</a>'; $servertime .= 'Serverzeit: ' . form_date(time(), 0) . '.';
$r_pm = thwb_query("SELECT count(pmid) AS pmcount FROM ".$pref."pm WHERE pmtoid=$g_user[userid] AND pmflags=1"); $pms = mysql_result($r_pm, 0); if( $pms == 1 ) { $privmsgs = "<b>Sie haben eine neue <a href=\"pm.php\">Nachricht</a>!</b>"; if( $g_user['usernoding'] != 1 ) { $javascript = "<script language=\"Javascript\">alert(\"Sie haben eine neue Nachricht!\")</script>"; } } elseif( $pms > 1 ) { $privmsgs = "<b>Sie haben $pms neue <a href=\"pm.php\">Nachrichten</a>!</b>"; if( $g_user['usernoding'] != 1 ) { $javascript = "<script language=\"Javascript\">alert(\"Sie haben $pms neue Nachrichten!\")</script>"; } } else { $privmsgs = "Sie haben keine neuen Nachrichten"; $javascript = ''; }
// online $r_online = thwb_query("SELECT DISTINCT online.onlineip, online.userid, user.username, user.userinvisible FROM ".$pref."online AS online LEFT JOIN ".$pref."user AS user ON online.userid=user.userid WHERE online.onlinetime > " . (time() - 300) . ""); /* vars onlinecount: tatsaechliche anzahl der user die online sind (gaeste + user) a_doubleuser: array mit userids die online sind registered: registrierte user in array guests: anzahl der gaeste/invisibles useronline: html code das in das template kommt */ $onlinecount = 0; $guests = 0; $a_doubleuser = array(); $registered = array();
while( $online = mysql_fetch_array($r_online) ) { if( $online['username'] ) { if( !in_array($online['userid'], $a_doubleuser) ) { $a_doubleuser[] = $online['userid']; $onlinecount++; if( $online['userinvisible'] && !$P->has_permission( P_CANSEEINVIS ) ) { $guests++; } else { $registered[] = '<a href="v_profile.php?user[userid]='.$online['userid'].'">'. parse_code($online['username']).'</a>'.($online['userinvisible'] ? ' (Unsichtbar)' : ''); } } } else { $onlinecount++; $guests++; } }
$maxusers = explode('|', $config['max_useronline']); if( $onlinecount > $maxusers[0] ) { thwb_query("UPDATE $pref"."registry SET keyvalue='".$onlinecount.'|'.time()."' WHERE keyname='max_useronline'"); $maxusers[0] = $onlinecount; $maxusers[1] = time(); }
$useronline = 'Online Rekord: <b>'.$maxusers[0].'</b> Benutzer, und zwar am '.form_date($maxusers[1], 0).'.<br>';
if( $onlinecount == 1 ) $useronline .= 'Es ist zur Zeit ein Benutzer online:<br>'; else $useronline .= 'Es sind zur Zeit '.$onlinecount.' Benutzer online:<br>';
$useronline .= @implode(', ', $registered); if( $guests > 0 ) { if( $guests > 1 ) { if( count($registered) > 0 ) $useronline .= " sowie $guests Gäste"; else $useronline .= "$guests Gäste"; } else { if( count($registered) > 0 ) $useronline .= " sowie ein Gast"; else $useronline .= "Ein Gast"; } }
$navpath .= 'Forumübersicht'; eval($Tindex->GetTemplate("CONTENT")); eval($Tframe->GetTemplate());
?>
|