phpBB
Statistics
| Revision:

root / tags / release_2_0_1 / phpBB / modcp.php

History | View | Annotate | Download (32.9 kB)

1
<?php
2
/***************************************************************************
3
 *                                 modcp.php
4
 *                            -------------------
5
 *   begin                : July 4, 2001
6
 *   copyright            : (C) 2001 The phpBB Group
7
 *   email                : support@phpbb.com
8
 *
9
 *   $Id: modcp.php 2610 2002-05-20 13:52:12Z  $
10
 *
11
 *
12
 ***************************************************************************/
13
14
/***************************************************************************
15
 *
16
 *   This program is free software; you can redistribute it and/or modify
17
 *   it under the terms of the GNU General Public License as published by
18
 *   the Free Software Foundation; either version 2 of the License, or
19
 *   (at your option) any later version.
20
 *
21
 ***************************************************************************/
22
23
/**
24
 * Moderator Control Panel
25
 *
26
 * From this 'Control Panel' the moderator of a forum will be able to do
27
 * mass topic operations (locking/unlocking/moving/deleteing), and it will
28
 * provide an interface to do quick locking/unlocking/moving/deleting of
29
 * topics via the moderator operations buttons on all of the viewtopic pages.
30
 */
31
32
define('IN_PHPBB', true);
33
$phpbb_root_path = './';
34
include($phpbb_root_path . 'extension.inc');
35
include($phpbb_root_path . 'common.'.$phpEx);
36
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
37
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
38
39
//
40
// Obtain initial var settings
41
//
42
if ( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) )
43
{
44
        $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]);
45
}
46
else
47
{
48
        $forum_id = '';
49
}
50
51
if ( isset($HTTP_GET_VARS[POST_POST_URL]) || isset($HTTP_POST_VARS[POST_POST_URL]) )
52
{
53
        $post_id = (isset($HTTP_POST_VARS[POST_POST_URL])) ? intval($HTTP_POST_VARS[POST_POST_URL]) : intval($HTTP_GET_VARS[POST_POST_URL]);
54
}
55
else
56
{
57
        $post_id = '';
58
}
59
60
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) || isset($HTTP_POST_VARS[POST_TOPIC_URL]) )
61
{
62
        $topic_id = (isset($HTTP_POST_VARS[POST_TOPIC_URL])) ? intval($HTTP_POST_VARS[POST_TOPIC_URL]) : intval($HTTP_GET_VARS[POST_TOPIC_URL]);
63
}
64
else
65
{
66
        $topic_id = '';
67
}
68
69
$confirm = ( $HTTP_POST_VARS['confirm'] ) ? TRUE : 0;
70
71
//
72
// Continue var definitions
73
//
74
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
75
76
$delete = ( isset($HTTP_POST_VARS['delete']) ) ? TRUE : FALSE;
77
$move = ( isset($HTTP_POST_VARS['move']) ) ? TRUE : FALSE;
78
$lock = ( isset($HTTP_POST_VARS['lock']) ) ? TRUE : FALSE;
79
$unlock = ( isset($HTTP_POST_VARS['unlock']) ) ? TRUE : FALSE;
80
81
if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
82
{
83
        $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
84
}
85
else
86
{
87
        if ( $delete )
88
        {
89
                $mode = 'delete';
90
        }
91
        else if ( $move )
92
        {
93
                $mode = 'move';
94
        }
95
        else if ( $lock )
96
        {
97
                $mode = 'lock';
98
        }
99
        else if ( $unlock )
100
        {
101
                $mode = 'unlock';
102
        }
103
        else
104
        {
105
                $mode = '';
106
        }
107
}
108
109
//
110
// Obtain relevant data
111
//
112
if ( !empty($topic_id) )
113
{
114
        $sql = "SELECT f.forum_id, f.forum_name, f.forum_topics
115
                FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
116
                WHERE t.topic_id = " . $topic_id . "
117
                        AND f.forum_id = t.forum_id";
118
        if ( !($result = $db->sql_query($sql)) )
119
        {
120
                message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
121
        }
122
        $topic_row = $db->sql_fetchrow($result);
123
124
        $forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics'];
125
        $forum_id = $topic_row['forum_id'];
126
        $forum_name = $topic_row['forum_name'];
127
}
128
else if ( !empty($forum_id) )
129
{
130
        $sql = "SELECT forum_name, forum_topics
131
                FROM " . FORUMS_TABLE . "
132
                WHERE forum_id = " . $forum_id;
133
        if ( !($result = $db->sql_query($sql)) )
134
        {
135
                message_die(GENERAL_MESSAGE, 'Forum_not_exist');
136
        }
137
        $topic_row = $db->sql_fetchrow($result);
138
139
        $forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics'];
140
        $forum_name = $topic_row['forum_name'];
141
}
142
else
143
{
144
        message_die(GENERAL_MESSAGE, 'Forum_not_exist');
145
}
146
147
//
148
// Start session management
149
//
150
$userdata = session_pagestart($user_ip, $forum_id);
151
init_userprefs($userdata);
152
//
153
// End session management
154
//
155
156
//
157
// Check if user did or did not confirm
158
// If they did not, forward them to the last page they were on
159
//
160
if ( isset($HTTP_POST_VARS['cancel']) )
161
{
162
        if ( $topic_id )
163
        {
164
                $redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
165
        }
166
        else if ( $forum_id )
167
        {
168
                $redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
169
        }
170
        else
171
        {
172
                $redirect = "index.$phpEx";
173
        }
174
175
        $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
176
        header($header_location . append_sid($redirect, true));
177
        exit;
178
}
179
180
//
181
// Start auth check
182
//
183
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);
184
185
if ( !$is_auth['auth_mod'] )
186
{
187
        message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
188
}
189
//
190
// End Auth Check
191
//
192
193
//
194
// Do major work ...
195
//
196
switch( $mode )
197
{
198
        case 'delete':
199
                $page_title = $lang['Mod_CP'];
200
                include($phpbb_root_path . 'includes/page_header.'.$phpEx);
201
202
                if ( $confirm )
203
                {
204
                        include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
205
206
                        $topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ?  $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
207
208
                        $topic_id_sql = '';
209
                        for($i = 0; $i < count($topics); $i++)
210
                        {
211
                                $topic_id_sql .= ( ( $topic_id_sql != '' ) ? ', ' : '' ) . $topics[$i];
212
                        }
213
214
                        $sql = "SELECT post_id 
215
                                FROM " . POSTS_TABLE . " 
216
                                WHERE topic_id IN ($topic_id_sql)";
217
                        if ( !$result = $db->sql_query($sql) )
218
                        {
219
                                message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
220
                        }
221
222
                        $post_id_sql = '';
223
                        while ( $row = $db->sql_fetchrow($result) )
224
                        {
225
                                $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id'];
226
                        }
227
                        $db->sql_freeresult($result);
228
229
                        $sql = "SELECT vote_id 
230
                                FROM " . VOTE_DESC_TABLE . " 
231
                                WHERE topic_id IN ($topic_id_sql)";
232
                        if ( !($result = $db->sql_query($sql)) )
233
                        {
234
                                message_die(GENERAL_ERROR, 'Could not get vote id information', '', __LINE__, __FILE__, $sql);
235
                        }
236
237
                        $vote_id_sql = '';
238
                        while ( $row = $db->sql_fetchrow($result) )
239
                        {
240
                                $vote_id_sql .= ( ( $vote_id_sql != '' ) ? ', ' : '' ) . $row['vote_id'];
241
                        }
242
                        $db->sql_freeresult($result);
243
244
                        //
245
                        // Got all required info so go ahead and start deleting everything
246
                        //
247
                        $sql = "DELETE 
248
                                FROM " . TOPICS_TABLE . " 
249
                                WHERE topic_id IN ($topic_id_sql) 
250
                                        OR topic_moved_id IN ($topic_id_sql)";
251
                        if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
252
                        {
253
                                message_die(GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql);
254
                        }
255
256
                        if ( $post_id_sql != '' )
257
                        {
258
                                $sql = "DELETE 
259
                                        FROM " . POSTS_TABLE . " 
260
                                        WHERE post_id IN ($post_id_sql)";
261
                                if ( !$db->sql_query($sql) )
262
                                {
263
                                        message_die(GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql);
264
                                }
265
266
                                $sql = "DELETE 
267
                                        FROM " . POSTS_TEXT_TABLE . " 
268
                                        WHERE post_id IN ($post_id_sql)";
269
                                if ( !$db->sql_query($sql) )
270
                                {
271
                                        message_die(GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql);
272
                                }
273
274
                                remove_search_post($post_id_sql);
275
                        }
276
277
                        if ( $vote_id_sql != '' )
278
                        {
279
                                $sql = "DELETE 
280
                                        FROM " . VOTE_DESC_TABLE . " 
281
                                        WHERE vote_id IN ($vote_id_sql)";
282
                                if ( !$db->sql_query($sql) )
283
                                {
284
                                        message_die(GENERAL_ERROR, 'Could not delete vote descriptions', '', __LINE__, __FILE__, $sql);
285
                                }
286
287
                                $sql = "DELETE 
288
                                        FROM " . VOTE_RESULTS_TABLE . " 
289
                                        WHERE vote_id IN ($vote_id_sql)";
290
                                if ( !$db->sql_query($sql) )
291
                                {
292
                                        message_die(GENERAL_ERROR, 'Could not delete vote results', '', __LINE__, __FILE__, $sql);
293
                                }
294
295
                                $sql = "DELETE 
296
                                        FROM " . VOTE_USERS_TABLE . " 
297
                                        WHERE vote_id IN ($vote_id_sql)";
298
                                if ( !$db->sql_query($sql) )
299
                                {
300
                                        message_die(GENERAL_ERROR, 'Could not delete vote users', '', __LINE__, __FILE__, $sql);
301
                                }
302
                        }
303
304
                        $sql = "DELETE 
305
                                FROM " . TOPICS_WATCH_TABLE . " 
306
                                WHERE topic_id IN ($topic_id_sql)";
307
                        if ( !$db->sql_query($sql, END_TRANSACTION) )
308
                        {
309
                                message_die(GENERAL_ERROR, 'Could not delete watched post list', '', __LINE__, __FILE__, $sql);
310
                        }
311
312
                        sync('forum', $forum_id);
313
314
                        if ( !empty($topic_id) )
315
                        {
316
                                $redirect_page = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");
317
                                $l_redirect = sprintf($lang['Click_return_forum'], '<a href="' . $redirect_page . '">', '</a>');
318
                        }
319
                        else
320
                        {
321
                                $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
322
                                $l_redirect = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
323
                        }
324
325
                        $template->assign_vars(array(
326
                                'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
327
                        );
328
329
                        message_die(GENERAL_MESSAGE, $lang['Topics_Removed'] . '<br /><br />' . $l_redirect);
330
                }
331
                else
332
                {
333
                        // Not confirmed, show confirmation message
334
                        if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
335
                        {
336
                                message_die(GENERAL_MESSAGE, $lang['None_selected']);
337
                        }
338
339
                        $hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
340
341
                        if ( isset($HTTP_POST_VARS['topic_id_list']) )
342
                        {
343
                                $topics = $HTTP_POST_VARS['topic_id_list'];
344
                                for($i = 0; $i < count($topics); $i++)
345
                                {
346
                                        $hidden_fields .= '<input type="hidden" name="topic_id_list[]" value="' . intval($topics[$i]) . '" />';
347
                                }
348
                        }
349
                        else
350
                        {
351
                                $hidden_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
352
                        }
353
354
                        //
355
                        // Set template files
356
                        //
357
                        $template->set_filenames(array(
358
                                'confirm' => 'confirm_body.tpl')
359
                        );
360
361
                        $template->assign_vars(array(
362
                                'MESSAGE_TITLE' => $lang['Confirm'],
363
                                'MESSAGE_TEXT' => $lang['Confirm_delete_topic'],
364
365
                                'L_YES' => $lang['Yes'],
366
                                'L_NO' => $lang['No'],
367
368
                                'S_CONFIRM_ACTION' => append_sid("modcp.$phpEx"),
369
                                'S_HIDDEN_FIELDS' => $hidden_fields)
370
                        );
371
372
                        $template->pparse('confirm');
373
374
                        include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
375
                }
376
                break;
377
378
        case 'move':
379
                $page_title = $lang['Mod_CP'];
380
                include($phpbb_root_path . 'includes/page_header.'.$phpEx);
381
382
                if ( $confirm )
383
                {
384
                        if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
385
                        {
386
                                message_die(GENERAL_MESSAGE, $lang['None_selected']);
387
                        }
388
389
                        $new_forum_id = $HTTP_POST_VARS['new_forum'];
390
                        $old_forum_id = $forum_id;
391
392
                        if ( $new_forum_id != $old_forum_id )
393
                        {
394
                                $topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ?  $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
395
396
                                $topic_list = '';
397
                                for($i = 0; $i < count($topics); $i++)
398
                                {
399
                                        $topic_list .= ( ( $topic_list != '' ) ? ', ' : '' ) . intval($topics[$i]);
400
                                }
401
402
                                $sql = "SELECT * 
403
                                        FROM " . TOPICS_TABLE . " 
404
                                        WHERE topic_id IN ($topic_list) 
405
                                                AND topic_status <> " . TOPIC_MOVED;
406
                                if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
407
                                {
408
                                        message_die(GENERAL_ERROR, 'Could not select from topic table', '', __LINE__, __FILE__, $sql);
409
                                }
410
411
                                $row = $db->sql_fetchrowset($result);
412
                                $db->sql_freeresult($result);
413
414
                                for($i = 0; $i < count($row); $i++)
415
                                {
416
                                        $topic_id = $row[$i]['topic_id'];
417
                                        
418
                                        if ( isset($HTTP_POST_VARS['move_leave_shadow']) )
419
                                        {
420
                                                // Insert topic in the old forum that indicates that the forum has moved.
421
                                                $sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_first_post_id, topic_last_post_id, topic_moved_id)
422
                                                        VALUES ($old_forum_id, '" . addslashes(str_replace("\'", "''", $row[$i]['topic_title'])) . "', '" . str_replace("\'", "''", $row[$i]['topic_poster']) . "', " . $row[$i]['topic_time'] . ", " . TOPIC_MOVED . ", " . POST_NORMAL . ", " . $row[$i]['topic_vote'] . ", " . $row[$i]['topic_views'] . ", " . $row[$i]['topic_replies'] . ", " . $row[$i]['topic_first_post_id'] . ", " . $row[$i]['topic_last_post_id'] . ", $topic_id)";
423
                                                if ( !$db->sql_query($sql) )
424
                                                {
425
                                                        message_die(GENERAL_ERROR, 'Could not insert shadow topic', '', __LINE__, __FILE__, $sql);
426
                                                }
427
                                        }
428
429
                                        $sql = "UPDATE " . TOPICS_TABLE . " 
430
                                                SET forum_id = $new_forum_id  
431
                                                WHERE topic_id = $topic_id";
432
                                        if ( !$db->sql_query($sql) )
433
                                        {
434
                                                message_die(GENERAL_ERROR, 'Could not update old topic', '', __LINE__, __FILE__, $sql);
435
                                        }
436
437
                                        $sql = "UPDATE " . POSTS_TABLE . " 
438
                                                SET forum_id = $new_forum_id 
439
                                                WHERE topic_id = $topic_id";
440
                                        if ( !$db->sql_query($sql) )
441
                                        {
442
                                                message_die(GENERAL_ERROR, 'Could not update post topic ids', '', __LINE__, __FILE__, $sql);
443
                                        }
444
                                }
445
446
                                // Sync the forum indexes
447
                                sync('forum', $new_forum_id);
448
                                sync('forum', $old_forum_id);
449
450
                                $message = $lang['Topics_Moved'] . '<br /><br />';
451
452
                        }
453
                        else
454
                        {
455
                                $message = $lang['No_Topics_Moved'] . '<br /><br />';
456
                        }
457
458
                        if ( !empty($topic_id) )
459
                        {
460
                                $redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
461
                                $message .= sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
462
                        }
463
                        else
464
                        {
465
                                $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
466
                                $message .= sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
467
                        }
468
469
                        $message = $message . '<br \><br \>' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id") . '">', '</a>');
470
471
                        $template->assign_vars(array(
472
                                'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
473
                        );
474
475
                        message_die(GENERAL_MESSAGE, $message);
476
                }
477
                else
478
                {
479
                        if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
480
                        {
481
                                message_die(GENERAL_MESSAGE, $lang['None_selected']);
482
                        }
483
484
                        $hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
485
486
                        if ( isset($HTTP_POST_VARS['topic_id_list']) )
487
                        {
488
                                $topics = $HTTP_POST_VARS['topic_id_list'];
489
490
                                for($i = 0; $i < count($topics); $i++)
491
                                {
492
                                        $hidden_fields .= '<input type="hidden" name="topic_id_list[]" value="' . intval($topics[$i]) . '" />';
493
                                }
494
                        }
495
                        else
496
                        {
497
                                $hidden_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
498
                        }
499
500
                        //
501
                        // Set template files
502
                        //
503
                        $template->set_filenames(array(
504
                                'movetopic' => 'modcp_move.tpl')
505
                        );
506
507
                        $template->assign_vars(array(
508
                                'MESSAGE_TITLE' => $lang['Confirm'],
509
                                'MESSAGE_TEXT' => $lang['Confirm_move_topic'],
510
511
                                'L_MOVE_TO_FORUM' => $lang['Move_to_forum'], 
512
                                'L_LEAVESHADOW' => $lang['Leave_shadow_topic'], 
513
                                'L_YES' => $lang['Yes'],
514
                                'L_NO' => $lang['No'],
515
516
                                'S_FORUM_SELECT' => make_forum_select('new_forum', $forum_id), 
517
                                'S_MODCP_ACTION' => append_sid("modcp.$phpEx"),
518
                                'S_HIDDEN_FIELDS' => $hidden_fields)
519
                        );
520
521
                        $template->pparse('movetopic');
522
523
                        include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
524
                }
525
                break;
526
527
        case 'lock':
528
                if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
529
                {
530
                        message_die(GENERAL_MESSAGE, $lang['None_selected']);
531
                }
532
533
                $topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ?  $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
534
535
                $topic_id_sql = '';
536
                for($i = 0; $i < count($topics); $i++)
537
                {
538
                        $topic_id_sql .= ( ( $topic_id_sql != '' ) ? ', ' : '' ) . $topics[$i];
539
                }
540
541
                $sql = "UPDATE " . TOPICS_TABLE . " 
542
                        SET topic_status = " . TOPIC_LOCKED . " 
543
                        WHERE topic_id IN ($topic_id_sql) 
544
                                AND topic_moved_id = 0";
545
                if ( !($result = $db->sql_query($sql)) )
546
                {
547
                        message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
548
                }
549
550
                if ( !empty($topic_id) )
551
                {
552
                        $redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
553
                        $message = sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
554
                }
555
                else
556
                {
557
                        $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
558
                        $message = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
559
                }
560
561
                $message = $message . '<br \><br \>' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
562
563
                $template->assign_vars(array(
564
                        'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
565
                );
566
567
                message_die(GENERAL_MESSAGE, $lang['Topics_Locked'] . '<br /><br />' . $message);
568
569
                break;
570
571
        case 'unlock':
572
                if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
573
                {
574
                        message_die(GENERAL_MESSAGE, $lang['None_selected']);
575
                }
576
577
                $topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ?  $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
578
579
                $topic_id_sql = '';
580
                for($i = 0; $i < count($topics); $i++)
581
                {
582
                        $topic_id_sql .= ( ( $topic_id_sql != "") ? ', ' : '' ) . $topics[$i];
583
                }
584
585
                $sql = "UPDATE " . TOPICS_TABLE . " 
586
                        SET topic_status = " . TOPIC_UNLOCKED . " 
587
                        WHERE topic_id IN ($topic_id_sql) 
588
                                AND topic_moved_id = 0";
589
                if ( !($result = $db->sql_query($sql)) )
590
                {
591
                        message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
592
                }
593
594
                if ( !empty($topic_id) )
595
                {
596
                        $redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
597
                        $message = sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
598
                }
599
                else
600
                {
601
                        $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
602
                        $message = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
603
                }
604
605
                $message = $message . '<br \><br \>' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
606
607
                $template->assign_vars(array(
608
                        'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
609
                );
610
611
                message_die(GENERAL_MESSAGE, $lang['Topics_Unlocked'] . '<br /><br />' . $message);
612
613
                break;
614
615
        case 'split':
616
                $page_title = $lang['Mod_CP'];
617
                include($phpbb_root_path . 'includes/page_header.'.$phpEx);
618
619
                if ( isset($HTTP_POST_VARS['split_type_all']) || isset($HTTP_POST_VARS['split_type_beyond']) )
620
                {
621
                        $posts = $HTTP_POST_VARS['post_id_list'];
622
623
                        $sql = "SELECT poster_id, topic_id, post_time
624
                                FROM " . POSTS_TABLE . "
625
                                WHERE post_id = " . $posts[0];
626
                        if ( !($result = $db->sql_query($sql)) )
627
                        {
628
                                message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql);
629
                        }
630
631
                        $post_rowset = $db->sql_fetchrow($result);
632
                        $first_poster = str_replace("\'", "''", $post_rowset['poster_id']);
633
                        $topic_id = $post_rowset['topic_id'];
634
                        $post_time = $post_rowset['post_time'];
635
636
                        $post_subject = trim(htmlspecialchars($HTTP_POST_VARS['subject']));
637
                        if ( empty($post_subject) )
638
                        {
639
                                message_die(GENERAL_MESSAGE, $lang['Empty_subject']);
640
                        }
641
642
                        $new_forum_id = intval($HTTP_POST_VARS['new_forum_id']);
643
                        $topic_time = time();
644
645
                        $sql  = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type)
646
                                VALUES ('" . str_replace("\'", "''", $post_subject) . "', $first_poster, " . $topic_time . ", $new_forum_id, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ")";
647
                        if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
648
                        {
649
                                message_die(GENERAL_ERROR, 'Could not insert new topic', '', __LINE__, __FILE__, $sql);
650
                        }
651
652
                        $new_topic_id = $db->sql_nextid();
653
654
                        if( !empty($HTTP_POST_VARS['split_type_all']) )
655
                        {
656
                                $post_id_sql = '';
657
                                for($i = 0; $i < count($posts); $i++)
658
                                {
659
                                        $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $posts[$i];
660
                                }
661
662
                                $sql = "UPDATE " . POSTS_TABLE . "
663
                                        SET topic_id = $new_topic_id, forum_id = $new_forum_id 
664
                                        WHERE post_id IN ($post_id_sql)";
665
                        }
666
                        else if( !empty($HTTP_POST_VARS['split_type_beyond']) )
667
                        {
668
                                $sql = "UPDATE " . POSTS_TABLE . "
669
                                        SET topic_id = $new_topic_id, forum_id = $new_forum_id
670
                                        WHERE post_time >= $post_time
671
                                                AND topic_id = $topic_id";
672
                        }
673
674
                        if( !$db->sql_query($sql, END_TRANSACTION) )
675
                        {
676
                                message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);
677
                        }
678
679
                        sync('topic', $new_topic_id);
680
                        sync('topic', $topic_id);
681
                        sync('forum', $new_forum_id);
682
                        sync('forum', $forum_id);
683
684
                        $template->assign_vars(array(
685
                                'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
686
                        );
687
688
                        $message = $lang['Topic_split'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
689
                        message_die(GENERAL_MESSAGE, $message);
690
                }
691
                else
692
                {
693
                        //
694
                        // Set template files
695
                        //
696
                        $template->set_filenames(array(
697
                                'split_body' => 'modcp_split.tpl')
698
                        );
699
700
                        $sql = "SELECT u.username, p.*, pt.post_text, pt.bbcode_uid, pt.post_subject, p.post_username
701
                                FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
702
                                WHERE p.topic_id = $topic_id
703
                                        AND p.poster_id = u.user_id
704
                                        AND p.post_id = pt.post_id
705
                                ORDER BY p.post_time ASC";
706
                        if ( !($result = $db->sql_query($sql)) )
707
                        {
708
                                message_die(GENERAL_ERROR, 'Could not get topic/post information', '', __LINE__, __FILE__, $sql);
709
                        }
710
711
                        $s_hidden_fields = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" /><input type="hidden" name="mode" value="split" />';
712
713
                        if( ( $total_posts = $db->sql_numrows($result) ) > 0 )
714
                        {
715
                                $postrow = $db->sql_fetchrowset($result);
716
717
                                $template->assign_vars(array(
718
                                        'L_SPLIT_TOPIC' => $lang['Split_Topic'],
719
                                        'L_SPLIT_TOPIC_EXPLAIN' => $lang['Split_Topic_explain'],
720
                                        'L_AUTHOR' => $lang['Author'],
721
                                        'L_MESSAGE' => $lang['Message'],
722
                                        'L_SELECT' => $lang['Select'],
723
                                        'L_SPLIT_SUBJECT' => $lang['Split_title'],
724
                                        'L_SPLIT_FORUM' => $lang['Split_forum'],
725
                                        'L_POSTED' => $lang['Posted'],
726
                                        'L_SPLIT_POSTS' => $lang['Split_posts'],
727
                                        'L_SUBMIT' => $lang['Submit'],
728
                                        'L_SPLIT_AFTER' => $lang['Split_after'], 
729
                                        'L_POST_SUBJECT' => $lang['Post_subject'], 
730
                                        'L_MARK_ALL' => $lang['Mark_all'], 
731
                                        'L_UNMARK_ALL' => $lang['Unmark_all'], 
732
                                        'L_POST' => $lang['Post'], 
733
734
                                        'FORUM_NAME' => $forum_name, 
735
736
                                        'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), 
737
738
                                        'S_SPLIT_ACTION' => append_sid("modcp.$phpEx"),
739
                                        'S_HIDDEN_FIELDS' => $s_hidden_fields,
740
                                        'S_FORUM_SELECT' => make_forum_select("new_forum_id"))
741
                                );
742
743
                                for($i = 0; $i < $total_posts; $i++)
744
                                {
745
                                        $post_id = $postrow[$i]['post_id'];
746
                                        $poster_id = $postrow[$i]['user_id'];
747
                                        $poster = $postrow[$i]['username'];
748
749
                                        $post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
750
751
                                        $bbcode_uid = $postrow[$i]['bbcode_uid'];
752
                                        $message = $postrow[$i]['post_text'];
753
                                        $post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : $topic_title;
754
755
                                        //
756
                                        // If the board has HTML off but the post has HTML
757
                                        // on then we process it, else leave it alone
758
                                        //
759
                                        if ( !$board_config['allow_html'] )
760
                                        {
761
                                                if ( $postrow[$i]['enable_html'] )
762
                                                {
763
                                                        $message = preg_replace('#(<)([\/]?.*?)(>)#is', '&lt;\\2&gt;', $message);
764
                                                }
765
                                        }
766
767
                                        if ( $bbcode_uid != '' )
768
                                        {
769
                                                $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
770
                                        }
771
772
                                        //
773
                                        // Define censored word matches
774
                                        //
775
                                        $orig_word = array();
776
                                        $replacement_word = array();
777
                                        obtain_word_list($orig_word, $replacement_word);
778
779
                                        if ( count($orig_word) )
780
                                        {
781
                                                $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
782
                                                $message = preg_replace($orig_word, $replacement_word, $message);
783
                                        }
784
785
                                        $message = make_clickable($message);
786
787
                                        if ( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] )
788
                                        {
789
                                                $message = smilies_pass($message);
790
                                        }
791
792
                                        $message = str_replace("\n", '<br />', $message);
793
                                        
794
                                        $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
795
                                        $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
796
797
                                        $checkbox = ( $i > 0 ) ? '<input type="checkbox" name="post_id_list[]" value="' . $post_id . '" />' : '&nbsp;';
798
                                        
799
                                        $template->assign_block_vars('postrow', array(
800
                                                'ROW_COLOR' => '#' . $row_color,
801
                                                'ROW_CLASS' => $row_class,
802
                                                'POSTER_NAME' => $poster,
803
                                                'POST_DATE' => $post_date,
804
                                                'POST_SUBJECT' => $post_subject,
805
                                                'MESSAGE' => $message,
806
                                                'POST_ID' => $post_id,
807
                                                
808
                                                'S_SPLIT_CHECKBOX' => $checkbox)
809
                                        );
810
                                }
811
812
                                $template->pparse('split_body');
813
                        }
814
                }
815
                break;
816
817
        case 'ip':
818
                $page_title = $lang['Mod_CP'];
819
                include($phpbb_root_path . 'includes/page_header.'.$phpEx);
820
821
                $rdns_ip_num = ( isset($HTTP_GET_VARS['rdns']) ) ? $HTTP_GET_VARS['rdns'] : "";
822
823
                if ( !$post_id )
824
                {
825
                        message_die(GENERAL_MESSAGE, $lang['No_such_post']);
826
                }
827
828
                //
829
                // Set template files
830
                //
831
                $template->set_filenames(array(
832
                        'viewip' => 'modcp_viewip.tpl')
833
                );
834
835
                // Look up relevent data for this post
836
                $sql = "SELECT poster_ip, poster_id 
837
                        FROM " . POSTS_TABLE . " 
838
                        WHERE post_id = $post_id";
839
                if ( !($result = $db->sql_query($sql)) )
840
                {
841
                        message_die(GENERAL_ERROR, 'Could not get poster IP information', '', __LINE__, __FILE__, $sql);
842
                }
843
                
844
                if ( !($post_row = $db->sql_fetchrow($result)) )
845
                {
846
                        message_die(GENERAL_MESSAGE, $lang['No_such_post']);
847
                }
848
849
                $ip_this_post = decode_ip($post_row['poster_ip']);
850
                $ip_this_post = ( $rdns_ip_num == $ip_this_post ) ? gethostbyaddr($ip_this_post) : $ip_this_post;
851
852
                $poster_id = $post_row['poster_id'];
853
854
                $template->assign_vars(array(
855
                        'L_IP_INFO' => $lang['IP_info'],
856
                        'L_THIS_POST_IP' => $lang['This_posts_IP'],
857
                        'L_OTHER_IPS' => $lang['Other_IP_this_user'],
858
                        'L_OTHER_USERS' => $lang['Users_this_IP'],
859
                        'L_LOOKUP_IP' => $lang['Lookup_IP'], 
860
                        'L_SEARCH' => $lang['Search'],
861
862
                        'SEARCH_IMG' => $images['icon_search'], 
863
864
                        'IP' => $ip_this_post, 
865
                                
866
                        'U_LOOKUP_IP' => append_sid("modcp.$phpEx?mode=ip&amp;" . POST_POST_URL . "=$post_id&amp;" . POST_TOPIC_URL . "=$topic_id&amp;rdns=" . $ip_this_post))
867
                );
868
869
                //
870
                // Get other IP's this user has posted under
871
                //
872
                $sql = "SELECT poster_ip, COUNT(*) AS postings 
873
                        FROM " . POSTS_TABLE . " 
874
                        WHERE poster_id = $poster_id 
875
                        GROUP BY poster_ip 
876
                        ORDER BY " . (( SQL_LAYER == 'msaccess' ) ? 'COUNT(*)' : 'postings' ) . " DESC";
877
                if ( !($result = $db->sql_query($sql)) )
878
                {
879
                        message_die(GENERAL_ERROR, 'Could not get IP information for this user', '', __LINE__, __FILE__, $sql);
880
                }
881
882
                if ( $row = $db->sql_fetchrow($result) )
883
                {
884
                        $i = 0;
885
                        do
886
                        {
887
                                if ( $row['poster_ip'] == $post_row['poster_ip'] )
888
                                {
889
                                        $template->assign_vars(array(
890
                                                'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ))
891
                                        );
892
                                        continue;
893
                                }
894
895
                                $ip = decode_ip($row['poster_ip']);
896
                                $ip = ( $rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
897
898
                                $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
899
                                $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
900
901
                                $template->assign_block_vars('iprow', array(
902
                                        'ROW_COLOR' => '#' . $row_color, 
903
                                        'ROW_CLASS' => $row_class, 
904
                                        'IP' => $ip,
905
                                        'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ),
906
907
                                        'U_LOOKUP_IP' => append_sid("modcp.$phpEx?mode=ip&amp;" . POST_POST_URL . "=$post_id&amp;" . POST_TOPIC_URL . "=$topic_id&amp;rdns=" . $row['poster_ip']))
908
                                );
909
910
                                $i++; 
911
                        }
912
                        while ( $row = $db->sql_fetchrow($result) );
913
                }
914
915
                //
916
                // Get other users who've posted under this IP
917
                //
918
                $sql = "SELECT u.user_id, u.username, COUNT(*) as postings 
919
                        FROM " . USERS_TABLE ." u, " . POSTS_TABLE . " p 
920
                        WHERE p.poster_id = u.user_id 
921
                                AND p.poster_ip = '" . $post_row['poster_ip'] . "'
922
                        GROUP BY u.user_id, u.username
923
                        ORDER BY " . (( SQL_LAYER == 'msaccess' ) ? 'COUNT(*)' : 'postings' ) . " DESC";
924
                if ( !($result = $db->sql_query($sql)) )
925
                {
926
                        message_die(GENERAL_ERROR, 'Could not get posters information based on IP', '', __LINE__, __FILE__, $sql);
927
                }
928
929
                if ( $row = $db->sql_fetchrow($result) )
930
                {
931
                        $i = 0;
932
                        do
933
                        {
934
                                $id = $row['user_id'];
935
                                $username = ( $id == ANONYMOUS ) ? $lang['Guest'] : $row['username'];
936
937
                                $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
938
                                $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
939
940
                                $template->assign_block_vars('userrow', array(
941
                                        'ROW_COLOR' => '#' . $row_color, 
942
                                        'ROW_CLASS' => $row_class, 
943
                                        'USERNAME' => $username,
944
                                        'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ),
945
                                        'L_SEARCH_POSTS' => sprintf($lang['Search_user_posts'], $username), 
946
947
                                        'U_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$id"),
948
                                        'U_SEARCHPOSTS' => append_sid("search.$phpEx?search_author=" . urlencode($username) . "&amp;showresults=topics"))
949
                                );
950
951
                                $i++; 
952
                        }
953
                        while ( $row = $db->sql_fetchrow($result) );
954
                }
955
956
                $template->pparse('viewip');
957
958
                break;
959
960
        default:
961
                $page_title = $lang['Mod_CP'];
962
                include($phpbb_root_path . 'includes/page_header.'.$phpEx);
963
964
                $template->assign_vars(array(
965
                        'FORUM_NAME' => $forum_name,
966
967
                        'L_MOD_CP' => $lang['Mod_CP'],
968
                        'L_MOD_CP_EXPLAIN' => $lang['Mod_CP_explain'],
969
                        'L_SELECT' => $lang['Select'],
970
                        'L_DELETE' => $lang['Delete'],
971
                        'L_MOVE' => $lang['Move'],
972
                        'L_LOCK' => $lang['Lock'],
973
                        'L_UNLOCK' => $lang['Unlock'],
974
                        'L_TOPICS' => $lang['Topics'], 
975
                        'L_REPLIES' => $lang['Replies'], 
976
                        'L_LASTPOST' => $lang['Last_Post'], 
977
                        'L_SELECT' => $lang['Select'], 
978
979
                        'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), 
980
                        'S_HIDDEN_FIELDS' => '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">',
981
                        'S_MODCP_ACTION' => append_sid("modcp.$phpEx"))
982
                );
983
984
                $template->set_filenames(array(
985
                        'body' => 'modcp_body.tpl')
986
                );
987
988
                //
989
                // Define censored word matches
990
                //
991
                $orig_word = array();
992
                $replacement_word = array();
993
                obtain_word_list($orig_word, $replacement_word);
994
995
                $sql = "SELECT t.*, u.username, u.user_id, p.post_time
996
                        FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
997
                        WHERE t.forum_id = $forum_id
998
                                AND t.topic_poster = u.user_id
999
                                AND p.post_id = t.topic_last_post_id
1000
                        ORDER BY t.topic_type DESC, p.post_time DESC
1001
                        LIMIT $start, " . $board_config['topics_per_page'];
1002
                if ( !($result = $db->sql_query($sql)) )
1003
                {
1004
                           message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
1005
                }
1006
1007
                while ( $row = $db->sql_fetchrow($result) )
1008
                {
1009
                        $topic_title = '';
1010
1011
                        if ( $row['topic_status'] == TOPIC_LOCKED )
1012
                        {
1013
                                $folder_img = $images['folder_locked'];
1014
                                $folder_alt = $lang['Topic_locked'];
1015
                        }
1016
                        else
1017
                        {
1018
                                if ( $row['topic_type'] == POST_ANNOUNCE )
1019
                                {
1020
                                        $folder_img = $images['folder_announce'];
1021
                                        $folder_alt = $lang['Topic_Announcement'];
1022
                                }
1023
                                else if ( $row['topic_type'] == POST_STICKY )
1024
                                {
1025
                                        $folder_img = $images['folder_sticky'];
1026
                                        $folder_alt = $lang['Topic_Sticky'];
1027
                                }
1028
                                else 
1029
                                {
1030
                                        $folder_img = $images['folder'];
1031
                                        $folder_alt = $lang['No_new_posts'];
1032
                                }
1033
                        }
1034
1035
                        $topic_id = $row['topic_id'];
1036
                        $topic_type = $row['topic_type'];
1037
                        $topic_status = $row['topic_status'];
1038
                        
1039
                        if ( $topic_type == POST_ANNOUNCE )
1040
                        {
1041
                                $topic_type = $lang['Topic_Announcement'] . ' ';
1042
                        }
1043
                        else if ( $topic_type == POST_STICKY )
1044
                        {
1045
                                $topic_type = $lang['Topic_Sticky'] . ' ';
1046
                        }
1047
                        else if ( $topic_status == TOPIC_MOVED )
1048
                        {
1049
                                $topic_type = $lang['Topic_Moved'] . ' ';
1050
                        }
1051
                        else
1052
                        {
1053
                                $topic_type = '';                
1054
                        }
1055
        
1056
                        if ( $row['topic_vote'] )
1057
                        {
1058
                                $topic_type .= $lang['Topic_Poll'] . ' ';
1059
                        }
1060
        
1061
                        $topic_title = $row['topic_title'];
1062
                        if ( count($orig_word) )
1063
                        {
1064
                                $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
1065
                        }
1066
1067
                        $u_view_topic = append_sid("modcp.$phpEx?mode=split&amp;" . POST_TOPIC_URL . "=$topic_id");
1068
                        $topic_replies = $row['topic_replies'];
1069
1070
                        $last_post_time = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
1071
1072
                        $template->assign_block_vars('topicrow', array(
1073
                                'U_VIEW_TOPIC' => $u_view_topic,
1074
1075
                                'TOPIC_FOLDER_IMG' => $folder_img, 
1076
                                'TOPIC_TYPE' => $topic_type, 
1077
                                'TOPIC_TITLE' => $topic_title,
1078
                                'REPLIES' => $topic_replies,
1079
                                'LAST_POST_TIME' => $last_post_time,
1080
                                'TOPIC_ID' => $topic_id,
1081
                                        
1082
                                'L_TOPIC_FOLDER_ALT' => $folder_alt)
1083
                        );
1084
                }
1085
1086
                $template->assign_vars(array(
1087
                        'PAGINATION' => generate_pagination("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id", $forum_topics, $board_config['topics_per_page'], $start),
1088
                        'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $forum_topics / $board_config['topics_per_page'] )), 
1089
                        'L_GOTO_PAGE' => $lang['Goto_page'])
1090
                );
1091
1092
                $template->pparse('body');
1093
1094
                break;
1095
}
1096
1097
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
1098
1099
?>