This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
523 lines (422 loc) · 28.5 KB
/
index.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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<?php
/**
* Показывает список категорий/форумов, что участники могут видеть, вместе с некоторыми статистическими данными.
*
* @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org
* @modified Copyright (C) 2014-2018 Flazy
* @license http://www.gnu.org/licenses/gpl.html GPL версии 2 или выше
* @package Flazy
*/
if (!defined('FORUM_ROOT')) {
define('FORUM_ROOT', './');
}
require FORUM_ROOT . 'include/common.php';
($hook = get_hook('in_start')) ? eval($hook) : null;
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
// Check for use of incorrect URLs
confirm_current_url($cid ? forum_link($forum_url['category'], $cid) : forum_link($forum_url['index']));
if (!$forum_user['g_read_board']) {
message($lang_common['No view']);
}
// Load the index.php language file
require FORUM_ROOT . 'lang/' . $forum_user['language'] . '/index.php';
// Get list of forums and topics with new posts since last visit
if (!$forum_user['is_guest']) {
$query = array(
'SELECT' => 't.forum_id, t.id, t.last_post',
'FROM' => 'topics AS t',
'JOINS' => array(
array(
'INNER JOIN' => 'forums AS f',
'ON' => 'f.id=t.forum_id'
),
array(
'LEFT JOIN' => 'forum_perms AS fp',
'ON' => '(fp.forum_id=f.id AND fp.group_id=' . $forum_user['g_id'] . ')'
)
),
'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>' . $forum_user['last_visit'] . ' AND t.moved_to IS NULL'
);
($hook = get_hook('in_qr_get_new_topics')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$new_topics = array();
while ($cur_topic = $forum_db->fetch_assoc($result)) {
$new_topics[$cur_topic['forum_id']][$cur_topic['id']] = $cur_topic['last_post'];
}
$tracked_topics = get_tracked_topics();
}
// Setup main heading
$forum_page['main_title'] = forum_htmlencode($forum_config['o_board_title']);
// Setup main options
$forum_page['main_options_head'] = $lang_index['Board options'];
$forum_page['main_options']['rss'] = '';
if (!$forum_user['is_guest']) {
$forum_page['main_options']['markread'] = '<a class="mark-all-read" href="' . forum_link($forum_url['mark_read'], generate_form_token('markread' . $forum_user['id'])) . '"><i class="material-icons left">bookmark</i>' . $lang_common['Mark all as read'] . '</a>';
}
($hook = get_hook('in_pre_header_load')) ? eval($hook) : null;
$forum_js->file(array('jquery', 'material', 'flazy', 'common', 'cookies'));
$forum_js->code('
function toggle(id)
{
$(\'#category\'+id).toggle(500);
$(\'#toggle\'+id).addClass(\'toggled\');
if(Cookies.set(\'#category\'+id)){
Cookies.remove(\'#category\'+id, null);
$(\'#toggle\'+id).removeClass(\'toggled\');
}else{
Cookies.set(\'#category\'+id, \'hides\', {expires: 365});
}
return false;
}');
define('FORUM_ALLOW_INDEX', 1);
define('FORUM_PAGE', 'index');
require FORUM_ROOT . 'header.php';
// START SUBST - <forum_main>
ob_start();
/* @var $hook type */
($hook = get_hook('in_main_output_start')) ? eval($hook) : null;
// Print the categories and forums
$query = array(
'SELECT' => 'c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.sort_by, t.subject, t.description, t.last_poster_id',
'FROM' => 'categories AS c',
'JOINS' => array(
array(
'INNER JOIN' => 'forums AS f',
'ON' => 'c.id=f.cat_id'
),
array(
'LEFT JOIN' => 'forum_perms AS fp',
'ON' => '(fp.forum_id=f.id AND fp.group_id=' . $forum_user['g_id'] . ')'
),
array(
'LEFT JOIN' => 'topics AS t',
'ON' => 'f.last_post_id=t.last_post_id'
)
),
'WHERE' => ($cid ? 'c.id=' . $cid . ' AND ' : '') . 'fp.read_forum IS NULL OR fp.read_forum=1',
'ORDER BY' => 'c.disp_position, c.id, f.disp_position'
);
($hook = get_hook('in_qr_get_cats_and_forums')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_page['cur_category'] = $forum_page['item_count'] = 0;
?>
<div class="row">
<div class="col s12 m12 l9 forum-body">
<?php
while ($cur_forum = $forum_db->fetch_assoc($result)) {
($hook = get_hook('in_forum_loop_start')) ? eval($hook) : null;
++$forum_page['item_count'];
if ($cur_forum['cid'] != $forum_page['cur_category']) { // A new category since last iteration?
if ($forum_page['cur_category'] != 0) {
echo "\t\t" . '</div>' . "\n\t\t" . '</div>' . "\n\t" . '' . "\n\n";
}
$forum_page['item_count'] = 1;
$forum_page['toggle'][] = 'if(Cookies.get(\'#category' . $cur_forum['cid'] . '\')) {$(\'#category' . $cur_forum['cid'] . '\').hide(); $(\'#toggle' . $cur_forum['cid'] . '\').addClass(\'toggled\'); }' . "\n";
($hook = get_hook('in_forum_pre_cat_head')) ? eval($hook) : null;
?>
<div class="forum-topic-list">
<div class="forum-topic-list-header">
<a href="<?php echo forum_link($forum_url['category'], $cur_forum['cid']) ?>" class="forum-topic-list-header-title"><i class="fa fa-file-text-o"></i><?php echo forum_htmlencode($cur_forum['cat_name']) ?></a>
<span class="forum-topic-list-header-toggle-btn" onclick="toggle('<?php echo $cur_forum['cid'] ?>');" id="toggle<?php echo $cur_forum['cid'] ?>"><i class="fa fa-minus"></i></span>
</div>
<div class="forum-topic-list-content" id="category<?php echo $cur_forum['cid'] ?>">
<?php
$forum_page['cur_category'] = $cur_forum['cid'];
}
// Reset arrays and globals for each forum
$forum_page['item_status'] = $forum_page['item_subject'] = $forum_page['item_body'] = $forum_page['item_title'] = array();
// Is this a redirect forum?
if ($cur_forum['redirect_url'] != '') {
$forum_page['item_body']['subject']['title'] = '<div class="forum-topic-list-content-title"><h2><a class="external" href="' . forum_link('click.php') . '?' . forum_htmlencode($cur_forum['redirect_url']) . '" title="' . sprintf($lang_index['Link to'], forum_htmlencode($cur_forum['redirect_url'])) . '"><span>' . forum_htmlencode($cur_forum['forum_name']) . '</span></a></h2>';
$forum_page['item_status']['redirect'] = 'external-link';
$forum_page['item_body']['info']['topics'] = '';
$forum_page['item_body']['info']['posts'] = '';
$forum_page['item_body']['info']['lastpost'] = '';
if ($cur_forum['forum_desc'] != '') {
$forum_page['item_subject']['desc'] = $cur_forum['forum_desc'];
}
$forum_page['item_subject']['redirect'] = '<p>' . $lang_index['External forum'] . '</p></div>';
($hook = get_hook('in_redirect_row_pre_item_subject_merge')) ? eval($hook) : null;
if (!empty($forum_page['item_subject'])) {
$forum_page['item_body']['subject']['desc'] = implode(' ', $forum_page['item_subject']);
}
// Forum topic and post count
($hook = get_hook('in_redirect_row_pre_display')) ? eval($hook) : null;
} else {
// Setup the title and link to the forum
$forum_page['item_title']['title'] = '<strong><a href="' . forum_link($forum_url['forum'], array($cur_forum['fid'], sef_friendly($cur_forum['forum_name']))) . '"><span>' . forum_htmlencode($cur_forum['forum_name']) . '</span></a></strong>';
// Are there new posts since our last visit?
if (!$forum_user['is_guest'] && $cur_forum['last_post'] > $forum_user['last_visit'] && (empty($tracked_topics['forums'][$cur_forum['fid']]) || $cur_forum['last_post'] > $tracked_topics['forums'][$cur_forum['fid']])) {
// There are new posts in this forum, but have we read all of them already?
foreach ($new_topics[$cur_forum['fid']] as $check_topic_id => $check_last_post) {
if ((empty($tracked_topics['topics'][$check_topic_id]) || $tracked_topics['topics'][$check_topic_id] < $check_last_post) && (empty($tracked_topics['forums'][$cur_forum['fid']]) || $tracked_topics['forums'][$cur_forum['fid']] < $check_last_post)) {
$forum_page['item_status']['new'] = 'comments-o';
if ($forum_user['g_search'])
$forum_page['item_title']['status'] = '<small>' . sprintf($lang_index['Forum has new'], '<a href="' . forum_link($forum_url['search_new_results'], $cur_forum['fid']) . '" title="' . $lang_index['New posts title'] . '">' . $lang_index['Forum new posts'] . '</a>') . '</small>';
break;
}
}
}
($hook = get_hook('in_normal_row_pre_item_title_merge')) ? eval($hook) : null;
$forum_page['item_body']['subject']['title'] = '<div class="forum-topic-list-content-title"><h2>' . implode(' ', $forum_page['item_title']) . '</h2>';
// Setup the forum description and mod list
if ($cur_forum['forum_desc'] != '') {
$forum_page['item_subject']['desc'] = '<p>' . $cur_forum['forum_desc'] . '</p></div>';
} else {
$forum_page['item_subject']['desc'] = '</div>';
}
if ($cur_forum['moderators'] != '') {
$forum_page['mods_array'] = unserialize($cur_forum['moderators']);
$forum_page['item_mods'] = array();
foreach ($forum_page['mods_array'] as $mod_username => $mod_id) {
$forum_page['item_mods'][] = ($forum_user['g_view_users'] == '1') ? '<a href="' . forum_link($forum_url['user'], $mod_id) . '">' . forum_htmlencode($mod_username) . '</a>' : forum_htmlencode($mod_username);
}
($hook = get_hook('in_row_modify_modlist')) ? eval($hook) : null;
$forum_page['item_subject']['modlist'] = '<span class="modlist">(' . sprintf($lang_index['Moderated by'], implode(', ', $forum_page['item_mods'])) . ')</span>';
}
($hook = get_hook('in_normal_row_pre_item_subject_merge')) ? eval($hook) : null;
if (!empty($forum_page['item_subject'])) {
$forum_page['item_body']['subject']['desc'] = implode(' ', $forum_page['item_subject']);
}
// Установка тем форума, счетчика сообщений и последнего сообщения
$forum_page['item_body']['info']['topics'] = '<div class="forum-topic-list-content-stats"><p><strong>' . forum_number_format($cur_forum['num_topics']) . '</strong>' . $lang_index['Topics'] . '</p>';
$forum_page['item_body']['info']['posts'] = '<p><strong>' . forum_number_format($cur_forum['num_posts']) . '</strong>' . $lang_index['Posts'] . '</p></div>';
$forum_page['item_body']['info']['rss'] = '<div class="forum-topic-list-content-rss"><a href="' . forum_link($forum_url['feed_forum_topics'], array($cur_forum['fid'], $cur_forum['sort_by'] == '1' ? 'posted' : 'last_post', 'rss')) . '"><i class="fa fa-rss"></i></a></div>';
if ($cur_forum['last_post'] != '') {
if ($forum_config['o_censoring']) {
$cur_forum['subject'] = censor_words($cur_forum['subject']);
$cur_forum['description'] = censor_words($cur_forum['description']);
}
$desc['subject'] = forum_htmlencode(forum_htmlencode($cur_forum['subject']));
$desc['description'] = ($cur_forum['description'] != '') ? ' - ' . forum_htmlencode(forum_htmlencode($cur_forum['description'])) : '';
$forum_page['item_body']['info']['lastpost'] = '<div class="forum-topic-list-content-meta"><a href="' . forum_link($forum_url['post'], $cur_forum['last_post_id']) . '" title="' . implode('', $desc) . '">' . (utf8_strlen($cur_forum['subject']) > 20 ? forum_htmlencode(forum_trim(utf8_substr($cur_forum['subject'], 0, 23))) . $lang_common['Spacer'] : forum_htmlencode($cur_forum['subject'])) . '</a><span class="recent-post-time">by <span class="username">' . ($cur_forum['last_poster_id'] > 1 ? '<a href="' . forum_link($forum_url['user'], $cur_forum['last_poster_id']) . '">' . forum_htmlencode($cur_forum['last_poster']) . '</a></span> ' : forum_htmlencode($cur_forum['last_poster'])) . format_time($cur_forum['last_post']) . '</span></div>';
} else {
$forum_page['item_body']['info']['lastpost'] = '<div class="forum-topic-list-content-meta">' . $lang_index['Forum is empty'] . ($forum_user['id'] > 1 ? '<a href="' . forum_link($forum_url['new_topic'], $cur_forum['fid']) . '"><span>' . $lang_index['First post nag'] . '</span></a>' : '' ) . '</div>';
}
($hook = get_hook('in_normal_row_pre_display')) ? eval($hook) : null;
}
$forum_page['item_status']['default'] = 'comments';
// Generate classes for this forum depending on its status
$forum_page['item_style'] = (($forum_page['item_count'] % 2 != 0) ? ' odd' : ' even') . (($forum_page['item_count'] == 1) ? ' main-first-item' : '') . ((!empty($forum_page['item_status'])) ? ' ' . implode(' ', $forum_page['item_status']) : '');
($hook = get_hook('in_row_pre_display')) ? eval($hook) : null;
?>
<ul>
<li>
<div class="forum-topic-list-content-icon">
<i class="fa fa-<?php echo implode("\n\t\t\t\t", $forum_page['item_status']) . "\n" ?>" aria-hidden="true"></i>
</div>
<?php echo implode("\n\t\t\t\t", $forum_page['item_body']['subject']) . "\n" ?>
<?php echo implode("\n\t\t\t\t", $forum_page['item_body']['info']) . "\n" ?></ul>
<?php
}
if (isset($forum_page['toggle'])) {
$forum_js->code('$(document).ready(function() {
' . implode("\t", $forum_page['toggle']) . '});');
}
// Did we output any categories and forums?
if ($forum_page['cur_category'] > 0) {
echo '</div>' . "\n" . '</div>' . "\n";
} else {
?>
<div class="card">
<div class="card-content">
<p><?php echo $lang_index['Empty board'] ?></p>
</div>
</div>
<?php
}
?>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col l4">
<?php echo implode(' ', $forum_page['main_options']) ?>
</div>
<div class="col 4 right">
<?php
($hook = get_hook('ft_about_pre_quickjump')) ? eval($hook) : null;
// Display the "Jump to" drop list
if ($forum_user['g_read_board'] && $forum_config['o_quickjump']) {
// Load cached quickjump
if (file_exists(FORUM_CACHE_DIR . 'cache_quickjump_' . $forum_user['g_id'] . '.php')) {
include FORUM_CACHE_DIR . 'cache_quickjump_' . $forum_user['g_id'] . '.php';
}
if (!defined('FORUM_QJ_LOADED')) {
if (!defined('FORUM_CACHE_QUICKJUMP_LOADED')) {
require FORUM_ROOT . 'include/cache/quickjump.php';
}
generate_quickjump_cache($forum_user['g_id']);
require FORUM_CACHE_DIR . 'cache_quickjump_' . $forum_user['g_id'] . '.php';
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
($hook = get_hook('in_end')) ? eval($hook) : null;
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<forum_main>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <forum_main>
// START SUBST - <forum_info>
ob_start();
($hook = get_hook('in_info_output_start')) ? eval($hook) : null;
// Load cached
if (file_exists(FORUM_CACHE_DIR . 'cache_stat_user.php')) {
include FORUM_CACHE_DIR . 'cache_stat_user.php';
} else {
if (!defined('FORUM_CACHE_STAT_USER_LOADED'))
require FORUM_ROOT . 'include/cache/stat_user.php';
generate_stat_user_cache();
require FORUM_CACHE_DIR . 'cache_stat_user.php';
}
$stats_list['no_of_users'] = '<li class="st-users"><span>' . sprintf($lang_index['No of users'], '<strong>' . forum_number_format($forum_stat_user['total_users']) . '</strong>') . '</span></li>';
$stats_list['newest_user'] = '<li class="st-users"><span>' . sprintf($lang_index['Newest user'], '<strong>' . ($forum_user['g_view_users'] == '1' ? '<a href="' . forum_link($forum_url['user'], $forum_stat_user['id']) . '">' . forum_htmlencode($forum_stat_user['username']) . '</a>' : forum_htmlencode($stats['last_user']['username'])) . '</strong>') . '</span></li>';
$query = array(
'SELECT' => 'SUM(f.num_topics), SUM(f.num_posts)',
'FROM' => 'forums AS f'
);
($hook = get_hook('in_stats_qr_get_post_stats')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
list($stats['total_topics'], $stats['total_posts']) = $forum_db->fetch_row($result);
$query = array(
'SELECT' => 'p.posted',
'FROM' => 'posts AS p',
'WHERE' => 'p.posted>=' . mktime(0, 0, 0, forum_date('m'), forum_date('d') - 7, forum_date('y'))
);
($hook = get_hook('in_stats_qr_get_time_post_stats')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$posts_week = $posts_day = 0;
$all_posts = array();
while ($posts = $forum_db->fetch_assoc($result)) {
if ($posts['posted'] >= (time() - 86400)) {
$all_posts[] = $posts['posted'];
++$posts_day;
}
++$posts_week;
}
$stats_list['no_of_posts'] = '<li class="st-activity"><span>' . sprintf($lang_index['No of posts'], '<strong>' . forum_number_format($stats['total_posts']) . '</strong>', '<strong>' . forum_number_format($posts_week) . '</strong>', $lang_index['Online list separator'], '<strong>' . forum_number_format($posts_day) . '</strong>') . '</span></li>';
$stats_list['no_of_topics'] = '<li class="st-activity"><span>' . sprintf($lang_index['No of topics'], '<strong>' . forum_number_format($stats['total_topics']) . '</strong>') . '</span></li>';
($hook = get_hook('in_stats_pre_info_output')) ? eval($hook) : null;
?>
<div id="brd-stats" class="gen-content">
<h2 class="hn"><span><?php echo $lang_index['Statistics'] ?></span></h2>
<ul>
<?php echo implode("\n\t\t", $stats_list) . "\n" ?>
</ul>
</div>
<?php
($hook = get_hook('in_stats_end')) ? eval($hook) : null;
if ($forum_config['o_users_online']) {
// Fetch users online info and generate strings for output
$query = array(
'SELECT' => 'o.user_id, o.ident',
'FROM' => 'online AS o',
'WHERE' => 'o.idle=0',
'ORDER BY' => 'o.ident'
);
($hook = get_hook('in_users_online_qr_get_online_info')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_page['num_guests'] = $forum_page['num_users'] = 0;
$users = array();
while ($forum_user_online = $forum_db->fetch_assoc($result)) {
($hook = get_hook('in_users_online_add_online_user_loop')) ? eval($hook) : null;
if ($forum_user_online['user_id'] > 1) {
$users[] = ($forum_user['g_view_users']) ? '<a href="' . forum_link($forum_url['user'], $forum_user_online['user_id']) . '">' . forum_htmlencode($forum_user_online['ident']) . '</a>' : forum_htmlencode($forum_user_online['ident']);
++$forum_page['num_users'];
} else {
++$forum_page['num_guests'];
}
}
$forum_page['online_info'] = array(
'guests' => '<strong>' . forum_number_format($forum_page['num_guests']) . '</strong> ' . declination($forum_page['num_guests'], array($lang_common['Guests none'], $lang_common['Guests single'], $lang_common['Guests plural'])),
'users' => '<strong>' . forum_number_format($forum_page['num_users']) . '</strong> ' . declination($forum_page['num_users'], array($lang_index['Users none'], $lang_index['Users single'], $lang_index['Users plural']))
);
($hook = get_hook('in_users_online_pre_online_info_output')) ? eval($hook) : null;
?>
<div id="brd-online" class="gen-content index-stat">
<h3 class="hn"><span><?php printf($lang_index['Currently online'], forum_link($forum_url['online']), implode($lang_index['Online list separator'], $forum_page['online_info'])) ?></span></h3>
<?php if (!empty($users)): ?>
<p><?php echo implode($lang_index['Online list separator'], $users) ?></p>
<?php
endif;
($hook = get_hook('in_new_online_data')) ? eval($hook) : null;
?>
</div>
<?php
}
($hook = get_hook('in_users_online_end')) ? eval($hook) : null;
// Сегодня были
if ($forum_config['o_online_today']) {
$query = array(
'SELECT' => 'u.id, u.last_visit, u.username',
'FROM' => 'users AS u',
'WHERE' => 'u.last_visit>' . mktime(0, 0, 0, forum_date('m'), forum_date('d'), forum_date('y')) . ' AND u.id>1 AND group_id!=' . FORUM_UNVERIFIED,
'ORDER BY' => 'u.username ASC'
);
($hook = get_hook('in_fl_visit_qr_get')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_page['num_users'] = 0;
$users = array();
while ($forum_visit = $forum_db->fetch_assoc($result)) {
($hook = get_hook('in_users_online_today_add_user_loop')) ? eval($hook) : null;
$users[] = ($forum_user['g_view_users']) ? '<a href="' . forum_link($forum_url['user'], $forum_visit['id']) . '" title="' . $lang_index['last visit'] . ' - ' . format_time($forum_visit['last_visit']) . ' (' . flazy_format_time($forum_visit['last_visit']) . ')' . '">' . forum_htmlencode($forum_visit['username']) . '</a>' : forum_htmlencode($forum_visit['username']);
++$forum_page['num_users'];
}
$forum_page['visit'] = '<strong>' . forum_number_format($forum_page['num_users']) . '</strong> ' . declination($forum_page['num_users'], array($lang_index['Users none'], $lang_index['Users single'], $lang_index['Users plural']));
($hook = get_hook('in_fl_pre_visit_list')) ? eval($hook) : null;
?>
<div id="brd-today" class="gen-content index-stat">
<h3 class="hn"><span><?php printf($lang_index['Online today'], forum_link($forum_url['statistic'], 'visit'), $forum_page['visit']) ?></span></h3>
<?php if ($forum_page['num_users']): ?>
<p><?php echo implode($lang_index['Online list separator'], $users) ?></p>
<?php
endif;
($hook = get_hook('in_new_today_data')) ? eval($hook) : null;
?>
</div>
<?php
}
($hook = get_hook('in_online_today_end')) ? eval($hook) : null;
//Рекорд онлайна
if ($forum_config['o_record']) {
$forum_page['most_online'] = array(
'guests' => '<strong>' . forum_number_format($forum_config['c_max_guests']) . '</strong> ' . declination($forum_config['c_max_guests'], array($lang_common['Guests none'], $lang_common['Guests single'], $lang_common['Guests plural'])),
'reg_users' => '<strong>' . forum_number_format($forum_config['c_max_users']) . '</strong> ' . declination($forum_config['c_max_users'], array($lang_index['Users none'], $lang_index['Users single'], $lang_index['Users plural'])),
'users' => '<strong>' . forum_number_format($forum_config['c_max_total_users']) . '</strong> ' . declination($forum_config['c_max_total_users'], array($lang_index['All users none'], $lang_index['All users single'], $lang_index['All users plural']))
);
($hook = get_hook('in_fl_pre_most_online_list')) ? eval($hook) : null;
?>
<div id="brd-mostonline" class="gen-content index-stat">
<h3 class="hn"><span><?php printf($lang_index['Most online'], implode($lang_index['Online list separator'], $forum_page['most_online'])) ?></span></h3>
<?php ($hook = get_hook('in_fl_pre_most_online_list')) ? eval($hook) : null; ?>
</div>
<?php
}
($hook = get_hook('in_fl_statistic_end')) ? eval($hook) : null;
//Ссылки на статистику
if ($forum_config['o_statistic']) {
$forum_page['stat'] = array(
'top_author' => '<a href="' . forum_link($forum_url['statistic'], 'author') . '">' . $lang_index['Top author'] . '</a>',
'top_replies' => '<a href="' . forum_link($forum_url['statistic'], 'replies') . '">' . $lang_index['Top replies'] . '</a>',
'top_views' => '<a href="' . forum_link($forum_url['statistic'], 'views') . '">' . $lang_index['Top views'] . '</a>',
'bans' => '<a href="' . forum_link($forum_url['statistic'], 'bans') . '">' . $lang_index['Bans'] . '</a>',
);
($hook = get_hook('in_fl_pre_stat_list')) ? eval($hook) : null;
?>
<div id="brd-statlist" class="gen-content index-stat">
<p><?php echo implode($lang_index['Online stats separator'], $forum_page['stat']) ?></p>
<?php ($hook = get_hook('in_fl_pre_stat_list')) ? eval($hook) : null; ?>
</div>
<?php
}
($hook = get_hook('in_info_end')) ? eval($hook) : null;
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<forum_info>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <forum_info>
require FORUM_ROOT . 'footer.php';