punbb/moderate.php
author Dan
Thu, 12 Jul 2007 01:04:01 -0400
changeset 2 a8a21e1c7afa
parent 0 f9ffdbd96607
permissions -rw-r--r--
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     1
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     2
/***********************************************************************
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     3
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     4
  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     5
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     6
  This file is part of PunBB.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     7
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     8
  PunBB is free software; you can redistribute it and/or modify it
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     9
  under the terms of the GNU General Public License as published
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    10
  by the Free Software Foundation; either version 2 of the License,
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    11
  or (at your option) any later version.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    12
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    13
  PunBB is distributed in the hope that it will be useful, but
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    14
  WITHOUT ANY WARRANTY; without even the implied warranty of
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    16
  GNU General Public License for more details.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    17
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    18
  You should have received a copy of the GNU General Public License
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    19
  along with this program; if not, write to the Free Software
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    20
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    21
  MA  02111-1307  USA
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    22
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    23
************************************************************************/
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    24
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    25
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
    26
//define('PUN_ROOT', './');
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
    27
//require PUN_ROOT.'include/common.php';
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
    28
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
    29
global $pun_db, $pun_user, $pun_config, $lang_common;
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
    30
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    31
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    32
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    33
// This particular function doesn't require forum-based moderator access. It can be used
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    34
// by all moderators and admins.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    35
if (isset($_GET['get_host']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    36
{
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
    37
	if ($pun_user['g_id'] < PUN_MOD)
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    38
		message($lang_common['No permission']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    39
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    40
	// Is get_host an IP address or a post ID?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    41
	if (@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    42
		$ip = $_GET['get_host'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    43
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    44
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    45
		$get_host = intval($_GET['get_host']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    46
		if ($get_host < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    47
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    48
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
    49
		$result = $pun_db->query('SELECT poster_ip FROM '.$pun_db->prefix.'posts WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $pun_db->error());
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
		if (!$pun_db->num_rows($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    51
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    52
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
    53
		$ip = $pun_db->result($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    54
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    55
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    56
	message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    57
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    58
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    59
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    60
// All other functions require moderator/admin access
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    61
$fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    62
if ($fid < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    63
	message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    64
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
    65
$result = $pun_db->query('SELECT moderators FROM '.$pun_db->prefix.'forums WHERE id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    66
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
    67
$moderators = $pun_db->result($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    68
$mods_array = ($moderators != '') ? unserialize($moderators) : array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    69
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    70
if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_id'] != PUN_MOD || !array_key_exists($pun_user['username'], $mods_array)))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    71
	message($lang_common['No permission']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    72
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    73
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    74
// Load the misc.php language file
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    75
require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    76
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    77
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    78
// All other topic moderation features require a topic id in GET
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    79
if (isset($_GET['tid']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    80
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    81
	$tid = intval($_GET['tid']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    82
	if ($tid < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    83
		message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    84
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    85
	// Fetch some info about the topic
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
    86
	$result = $pun_db->query('SELECT t.subject, t.num_replies, f.id AS forum_id, forum_name FROM '.$pun_db->prefix.'topics AS t INNER JOIN '.$pun_db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$pun_db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$pun_db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid.' AND t.id='.$tid.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $pun_db->error());
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
	if (!$pun_db->num_rows($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    88
		message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    89
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
    90
	$cur_topic = $pun_db->fetch_assoc($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    91
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    92
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    93
	// Delete one or more posts
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    94
	if (isset($_POST['delete_posts']) || isset($_POST['delete_posts_comply']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    95
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    96
		$posts = $_POST['posts'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    97
		if (empty($posts))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    98
			message($lang_misc['No posts selected']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    99
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   100
		if (isset($_POST['delete_posts_comply']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   101
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   102
			confirm_referrer('moderate.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   103
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   104
			if (@preg_match('/[^0-9,]/', $posts))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   105
				message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   106
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   107
			// Verify that the post IDs are valid
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
   108
			$result = $pun_db->query('SELECT 1 FROM '.$pun_db->prefix.'posts WHERE id IN('.$posts.') AND topic_id='.$tid) or error('Unable to check posts', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   109
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
   110
			if ($pun_db->num_rows($result) != substr_count($posts, ',') + 1)
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   111
				message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   112
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   113
			// Delete the posts
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
   114
			$pun_db->query('DELETE FROM '.$pun_db->prefix.'posts WHERE id IN('.$posts.')') or error('Unable to delete posts', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   115
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   116
			require PUN_ROOT.'include/search_idx.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   117
			strip_search_index($posts);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   118
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   119
			// Get last_post, last_post_id, and last_poster for the topic after deletion
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
   120
			$result = $pun_db->query('SELECT id, poster, posted FROM '.$pun_db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $pun_db->error());
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
   121
			$last_post = $pun_db->fetch_assoc($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   122
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   123
			// How many posts did we just delete?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   124
			$num_posts_deleted = substr_count($posts, ',') + 1;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   125
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   126
			// Update the topic
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
   127
			$pun_db->query('UPDATE '.$pun_db->prefix.'topics SET last_post='.$last_post['posted'].', last_post_id='.$last_post['id'].', last_poster=\''.$pun_db->escape($last_post['poster']).'\', num_replies=num_replies-'.$num_posts_deleted.' WHERE id='.$tid) or error('Unable to update topic', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   128
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   129
			update_forum($fid);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   130
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
   131
			pun_redirect('viewtopic.php?id='.$tid, $lang_misc['Delete posts redirect']);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   132
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   133
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   134
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   135
		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   136
		require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   137
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   138
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   139
<div class="blockform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   140
	<h2><span><?php echo $lang_misc['Delete posts'] ?></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   141
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   142
		<form method="post" action="moderate.php?fid=<?php echo $fid ?>&amp;tid=<?php echo $tid ?>">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   143
			<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   144
				<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   145
					<legend><?php echo $lang_misc['Confirm delete legend'] ?></legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   146
					<div class="infldset">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   147
						<input type="hidden" name="posts" value="<?php echo implode(',', array_keys($posts)) ?>" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   148
						<p><?php echo $lang_misc['Delete posts comply'] ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   149
					</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   150
				</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   151
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   152
			<p><input type="submit" name="delete_posts_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   153
		</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   154
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   155
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   156
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   157
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   158
		require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   159
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   160
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   161
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   162
	// Show the delete multiple posts view
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   163
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   164
	// Load the viewtopic.php language file
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   165
	require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   166
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   167
	// Used to disable the Move and Delete buttons if there are no replies to this topic
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   168
	$button_status = ($cur_topic['num_replies'] == 0) ? ' disabled' : '';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   169
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   170
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   171
	// Determine the post offset (based on $_GET['p'])
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   172
	$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   173
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   174
	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   175
	$start_from = $pun_user['disp_posts'] * ($p - 1);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   176
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   177
	// Generate paging links
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
   178
	$paging_links = $lang_common['Pages'].': '.pun_paginate($num_pages, $p, 'moderate.php?fid='.$fid.'&amp;tid='.$tid);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   179
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   180
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   181
	if ($pun_config['o_censoring'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   182
		$cur_topic['subject'] = censor_words($cur_topic['subject']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   183
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   184
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   185
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$cur_topic['subject'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   186
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   187
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   188
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   189
<div class="linkst">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   190
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   191
		<p class="pagelink conl"><?php echo $paging_links ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   192
		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&nbsp;&raquo;&nbsp;<a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&nbsp;&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   193
		<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   194
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   195
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   196
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   197
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&amp;tid=<?php echo $tid ?>">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   198
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   199
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   200
	require PUN_ROOT.'include/parser.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   201
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   202
	$bg_switch = true;	// Used for switching background color in posts
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   203
	$post_count = 0;	// Keep track of post numbers
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   204
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   205
	// Retrieve the posts (and their respective poster)
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
   206
	$result = $pun_db->query('SELECT u.title, u.num_posts, g.g_id, g.g_user_title, p.id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by FROM '.$pun_db->prefix.'posts AS p INNER JOIN '.$pun_db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$pun_db->prefix.'groups AS g ON g.g_id=u.group_id WHERE p.topic_id='.$tid.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   207
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
   208
	while ($cur_post = $pun_db->fetch_assoc($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   209
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   210
		$post_count++;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   211
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   212
		// If the poster is a registered user.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   213
		if ($cur_post['poster_id'] > 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   214
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   215
			$poster = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   216
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   217
			// get_title() requires that an element 'username' be present in the array
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   218
			$cur_post['username'] = $cur_post['poster'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   219
			$user_title = get_title($cur_post);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   220
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   221
			if ($pun_config['o_censoring'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   222
				$user_title = censor_words($user_title);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   223
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   224
		// If the poster is a guest (or a user that has been deleted)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   225
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   226
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   227
			$poster = pun_htmlspecialchars($cur_post['poster']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   228
			$user_title = $lang_topic['Guest'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   229
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   230
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   231
		// Switch the background color for every message.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   232
		$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   233
		$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   234
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   235
		// Perform the main parsing of the message (BBCode, smilies, censor words etc)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   236
		$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   237
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   238
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   239
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   240
<div class="blockpost<?php echo $vtbg ?>">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   241
	<a name="<?php echo $cur_post['id'] ?>"></a>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   242
	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?>&nbsp;</span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   243
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   244
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   245
			<div class="postleft">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   246
				<dl>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   247
					<dt><strong><?php echo $poster ?></strong></dt>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   248
					<dd><strong><?php echo $user_title ?></strong></dd>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   249
				</dl>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   250
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   251
			<div class="postright">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   252
				<h3 class="nosize"><?php echo $lang_common['Message'] ?></h3>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   253
				<div class="postmsg">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   254
					<?php echo $cur_post['message']."\n" ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   255
<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   256
				</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   257
				<?php if ($start_from + $post_count > 1) echo '<p class="multidelete"><label><strong>'.$lang_misc['Select'].'</strong>&nbsp;&nbsp;<input type="checkbox" name="posts['.$cur_post['id'].']" value="1" /></label></p>'."\n" ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   258
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   259
			<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   260
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   261
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   262
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   263
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   264
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   265
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   266
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   267
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   268
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   269
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   270
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   271
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   272
<div class="postlinksb">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   273
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   274
		<p class="pagelink conl"><?php echo $paging_links ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   275
		<p class="conr"><input type="submit" name="delete_posts" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> /></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   276
		<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   277
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   278
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   279
</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   280
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   281
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   282
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   283
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   284
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   285
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   286
// Move one or more topics
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   287
if (isset($_REQUEST['move_topics']) || isset($_POST['move_topics_to']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   288
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   289
	if (isset($_POST['move_topics_to']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   290
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   291
		confirm_referrer('moderate.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   292
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   293
		if (@preg_match('/[^0-9,]/', $_POST['topics']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   294
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   295
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   296
		$topics = explode(',', $_POST['topics']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   297
		$move_to_forum = isset($_POST['move_to_forum']) ? intval($_POST['move_to_forum']) : 0;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   298
		if (empty($topics) || $move_to_forum < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   299
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   300
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
   301
		// Verify that the topic IDs are valid
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
   302
		$result = $pun_db->query('SELECT 1 FROM '.$pun_db->prefix.'topics WHERE id IN('.implode(',',$topics).') AND forum_id='.$fid) or error('Unable to check topics', __FILE__, __LINE__, $pun_db->error());
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
   303
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
   304
		if ($pun_db->num_rows($result) != count($topics))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   305
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   306
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   307
		// Delete any redirect topics if there are any (only if we moved/copied the topic back to where it where it was once moved from)
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
   308
		$pun_db->query('DELETE FROM '.$pun_db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to IN('.implode(',',$topics).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   309
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   310
		// Move the topic(s)
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
   311
		$pun_db->query('UPDATE '.$pun_db->prefix.'topics SET forum_id='.$move_to_forum.' WHERE id IN('.implode(',',$topics).')') or error('Unable to move topics', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   312
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   313
		// Should we create redirect topics?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   314
		if (isset($_POST['with_redirect']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   315
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   316
			while (list(, $cur_topic) = @each($topics))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   317
			{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   318
				// Fetch info for the redirect topic
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
   319
				$result = $pun_db->query('SELECT poster, subject, posted, last_post FROM '.$pun_db->prefix.'topics WHERE id='.$cur_topic) or error('Unable to fetch topic info', __FILE__, __LINE__, $pun_db->error());
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
   320
				$moved_to = $pun_db->fetch_assoc($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   321
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   322
				// Create the redirect topic
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
   323
				$pun_db->query('INSERT INTO '.$pun_db->prefix.'topics (poster, subject, posted, last_post, moved_to, forum_id) VALUES(\''.$pun_db->escape($moved_to['poster']).'\', \''.$pun_db->escape($moved_to['subject']).'\', '.$moved_to['posted'].', '.$moved_to['last_post'].', '.$cur_topic.', '.$fid.')') or error('Unable to create redirect topic', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   324
			}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   325
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   326
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   327
		update_forum($fid);				// Update the forum FROM which the topic was moved
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   328
		update_forum($move_to_forum);	// Update the forum TO which the topic was moved
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   329
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   330
		$redirect_msg = (count($topics) > 1) ? $lang_misc['Move topics redirect'] : $lang_misc['Move topic redirect'];
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
   331
		pun_redirect('viewforum.php?id='.$move_to_forum, $redirect_msg);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   332
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   333
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   334
	if (isset($_POST['move_topics']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   335
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   336
		$topics = isset($_POST['topics']) ? $_POST['topics'] : array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   337
		if (empty($topics))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   338
			message($lang_misc['No topics selected']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   339
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   340
		$topics = implode(',', array_keys($topics));
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   341
		$action = 'multi';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   342
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   343
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   344
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   345
		$topics = intval($_GET['move_topics']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   346
		if ($topics < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   347
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   348
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   349
		$action = 'single';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   350
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   351
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   352
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Moderate';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   353
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   354
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   355
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   356
<div class="blockform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   357
	<h2><span><?php echo ($action == 'single') ? $lang_misc['Move topic'] : $lang_misc['Move topics'] ?></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   358
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   359
		<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   360
			<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   361
			<input type="hidden" name="topics" value="<?php echo $topics ?>" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   362
				<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   363
					<legend><?php echo $lang_misc['Move legend'] ?></legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   364
					<div class="infldset">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   365
						<label><?php echo $lang_misc['Move to'] ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   366
						<br /><select name="move_to_forum">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   367
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   368
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
   369
	$result = $pun_db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$pun_db->prefix.'categories AS c INNER JOIN '.$pun_db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$pun_db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   370
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   371
	$cur_category = 0;
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
   372
	while ($cur_forum = $pun_db->fetch_assoc($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   373
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   374
		if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   375
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   376
			if ($cur_category)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   377
				echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   378
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   379
			echo "\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   380
			$cur_category = $cur_forum['cid'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   381
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   382
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   383
		if ($cur_forum['fid'] != $fid)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   384
			echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   385
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   386
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   387
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   388
							</optgroup>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   389
						</select>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   390
						<br /></label>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   391
						<div class="rbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   392
							<label><input type="checkbox" name="with_redirect" value="1"<?php if ($action == 'single') echo ' checked="checked"' ?> /><?php echo $lang_misc['Leave redirect'] ?><br /></label>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   393
						</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   394
					</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   395
				</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   396
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   397
			<p><input type="submit" name="move_topics_to" value="<?php echo $lang_misc['Move'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   398
		</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   399
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   400
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   401
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   402
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   403
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   404
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   405
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   406
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   407
// Delete one or more topics
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   408
if (isset($_REQUEST['delete_topics']) || isset($_POST['delete_topics_comply']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   409
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   410
	$topics = isset($_POST['topics']) ? $_POST['topics'] : array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   411
	if (empty($topics))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   412
		message($lang_misc['No topics selected']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   413
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   414
	if (isset($_POST['delete_topics_comply']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   415
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   416
		confirm_referrer('moderate.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   417
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   418
		if (@preg_match('/[^0-9,]/', $topics))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   419
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   420
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   421
		require PUN_ROOT.'include/search_idx.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   422
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
   423
		// Verify that the topic IDs are valid
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
   424
		$result = $pun_db->query('SELECT 1 FROM '.$pun_db->prefix.'topics WHERE id IN('.$topics.') AND forum_id='.$fid) or error('Unable to check topics', __FILE__, __LINE__, $pun_db->error());
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
   425
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
   426
		if ($pun_db->num_rows($result) != substr_count($topics, ',') + 1)
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   427
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   428
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   429
		// Delete the topics and any redirect topics
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
   430
		$pun_db->query('DELETE FROM '.$pun_db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Unable to delete topic', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   431
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   432
		// Delete any subscriptions
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
   433
		$pun_db->query('DELETE FROM '.$pun_db->prefix.'subscriptions WHERE topic_id IN('.$topics.')') or error('Unable to delete subscriptions', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   434
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   435
		// Create a list of the post ID's in this topic and then strip the search index
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
   436
		$result = $pun_db->query('SELECT id FROM '.$pun_db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Unable to fetch posts', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   437
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   438
		$post_ids = '';
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
   439
		while ($row = $pun_db->fetch_row($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   440
			$post_ids .= ($post_ids != '') ? ','.$row[0] : $row[0];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   441
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   442
		// We have to check that we actually have a list of post ID's since we could be deleting just a redirect topic
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   443
		if ($post_ids != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   444
			strip_search_index($post_ids);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   445
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   446
		// Delete posts
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
   447
		$pun_db->query('DELETE FROM '.$pun_db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Unable to delete posts', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   448
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   449
		update_forum($fid);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   450
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
   451
		pun_redirect('viewforum.php?id='.$fid, $lang_misc['Delete topics redirect']);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   452
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   453
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   454
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   455
	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   456
	require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   457
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   458
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   459
<div class="blockform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   460
	<h2><?php echo $lang_misc['Delete topics'] ?></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   461
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   462
		<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   463
			<input type="hidden" name="topics" value="<?php echo implode(',', array_keys($topics)) ?>" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   464
			<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   465
				<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   466
					<legend><?php echo $lang_misc['Confirm delete legend'] ?></legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   467
					<div class="infldset">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   468
						<p><?php echo $lang_misc['Delete topics comply'] ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   469
					</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   470
				</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   471
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   472
			<p><input type="submit" name="delete_topics_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   473
		</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   474
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   475
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   476
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   477
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   478
	require PUN_ROOT.'footer.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   479
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   480
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   481
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   482
// Open or close one or more topics
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   483
else if (isset($_REQUEST['open']) || isset($_REQUEST['close']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   484
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   485
	$action = (isset($_REQUEST['open'])) ? 0 : 1;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   486
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   487
	// There could be an array of topic ID's in $_POST
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   488
	if (isset($_POST['open']) || isset($_POST['close']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   489
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   490
		confirm_referrer('moderate.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   491
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   492
		$topics = isset($_POST['topics']) ? @array_map('intval', @array_keys($_POST['topics'])) : array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   493
		if (empty($topics))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   494
			message($lang_misc['No topics selected']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   495
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
   496
		$pun_db->query('UPDATE '.$pun_db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).') AND forum_id='.$fid) or error('Unable to close topics', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   497
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   498
		$redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];
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
   499
		pun_redirect('moderate.php?fid='.$fid, $redirect_msg);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   500
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   501
	// Or just one in $_GET
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   502
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   503
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   504
		confirm_referrer('viewtopic.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   505
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   506
		$topic_id = ($action) ? intval($_GET['close']) : intval($_GET['open']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   507
		if ($topic_id < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   508
			message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   509
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
   510
		$pun_db->query('UPDATE '.$pun_db->prefix.'topics SET closed='.$action.' WHERE id='.$topic_id.' AND forum_id='.$fid) or error('Unable to close topic', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   511
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   512
		$redirect_msg = ($action) ? $lang_misc['Close topic redirect'] : $lang_misc['Open topic redirect'];
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
   513
		pun_redirect('viewtopic.php?id='.$topic_id, $redirect_msg);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   514
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   515
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   516
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   517
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   518
// Stick a topic
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   519
else if (isset($_GET['stick']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   520
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   521
	confirm_referrer('viewtopic.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   522
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   523
	$stick = intval($_GET['stick']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   524
	if ($stick < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   525
		message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   526
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
   527
	$pun_db->query('UPDATE '.$pun_db->prefix.'topics SET sticky=\'1\' WHERE id='.$stick.' AND forum_id='.$fid) or error('Unable to stick topic', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   528
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
   529
	pun_redirect('viewtopic.php?id='.$stick, $lang_misc['Stick topic redirect']);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   530
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   531
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   532
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   533
// Unstick a topic
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   534
else if (isset($_GET['unstick']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   535
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   536
	confirm_referrer('viewtopic.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   537
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   538
	$unstick = intval($_GET['unstick']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   539
	if ($unstick < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   540
		message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   541
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
   542
	$pun_db->query('UPDATE '.$pun_db->prefix.'topics SET sticky=\'0\' WHERE id='.$unstick.' AND forum_id='.$fid) or error('Unable to unstick topic', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   543
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
   544
	pun_redirect('viewtopic.php?id='.$unstick, $lang_misc['Unstick topic redirect']);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   545
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   546
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   547
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   548
// No specific forum moderation action was specified in the query string, so we'll display the moderator forum
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   549
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   550
// Load the viewforum.php language file
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   551
require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   552
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   553
// Fetch some info about the forum
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
   554
$result = $pun_db->query('SELECT f.forum_name, f.redirect_url, f.num_topics FROM '.$pun_db->prefix.'forums AS f LEFT JOIN '.$pun_db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $pun_db->error());
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
   555
if (!$pun_db->num_rows($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   556
	message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   557
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
   558
$cur_forum = $pun_db->fetch_assoc($result);
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   559
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   560
// Is this a redirect forum? In that case, abort!
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   561
if ($cur_forum['redirect_url'] != '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   562
	message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   563
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   564
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.pun_htmlspecialchars($cur_forum['forum_name']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   565
require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   566
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   567
// Determine the topic offset (based on $_GET['p'])
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   568
$num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   569
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   570
$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   571
$start_from = $pun_user['disp_topics'] * ($p - 1);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   572
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   573
// Generate paging links
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
   574
$paging_links = $lang_common['Pages'].': '.pun_paginate($num_pages, $p, 'moderate.php?fid='.$fid)
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   575
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   576
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   577
<div class="linkst">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   578
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   579
		<p class="pagelink conl"><?php echo $paging_links ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   580
		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&nbsp;</li><li>&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   581
		<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   582
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   583
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   584
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   585
<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   586
<div id="vf" class="blocktable">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   587
	<h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   588
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   589
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   590
			<table cellspacing="0">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   591
			<thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   592
				<tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   593
					<th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   594
					<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   595
					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   596
					<th class="tcr"><?php echo $lang_common['Last post'] ?></th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   597
					<th class="tcmod" scope="col"><?php echo $lang_misc['Select'] ?></th>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   598
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   599
			</thead>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   600
			<tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   601
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   602
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   603
// Select topics
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
   604
$result = $pun_db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$pun_db->prefix.'topics WHERE forum_id='.$fid.' ORDER BY sticky DESC, last_post DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']) or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $pun_db->error());
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   605
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   606
// If there are topics in this forum.
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
   607
if ($pun_db->num_rows($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   608
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   609
	$button_status = '';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   610
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
   611
	while ($cur_topic = $pun_db->fetch_assoc($result))
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   612
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   613
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   614
		$icon_text = $lang_common['Normal icon'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   615
		$item_status = '';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   616
		$icon_type = 'icon';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   617
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   618
		if ($cur_topic['moved_to'] == null)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   619
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   620
			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   621
			$ghost_topic = false;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   622
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   623
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   624
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   625
			$last_post = '&nbsp;';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   626
			$ghost_topic = true;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   627
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   628
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   629
		if ($pun_config['o_censoring'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   630
			$cur_topic['subject'] = censor_words($cur_topic['subject']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   631
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   632
		if ($cur_topic['moved_to'] != 0)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   633
			$subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   634
		else if ($cur_topic['closed'] == '0')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   635
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   636
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   637
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   638
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   639
			$icon_text = $lang_common['Closed icon'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   640
			$item_status = 'iclosed';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   641
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   642
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   643
		if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   644
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   645
			$icon_text .= ' '.$lang_common['New icon'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   646
			$item_status .= ' inew';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   647
			$icon_type = 'icon inew';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   648
			$subject = '<strong>'.$subject.'</strong>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   649
			$subject_new_posts = '<span class="newtext">[&nbsp;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&nbsp;]</span>';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   650
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   651
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   652
			$subject_new_posts = null;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   653
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   654
		// We won't display "the dot", but we add the spaces anyway
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   655
		if ($pun_config['o_show_dot'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   656
			$subject = '&nbsp;&nbsp;'.$subject;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   657
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   658
		if ($cur_topic['sticky'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   659
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   660
			$subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   661
			$item_status .= ' isticky';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   662
			$icon_text .= ' '.$lang_forum['Sticky'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   663
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   664
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   665
		$num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   666
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   667
		if ($num_pages_topic > 1)
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
   668
			$subject_multipage = '[ '.pun_paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   669
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   670
			$subject_multipage = null;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   671
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   672
		// Should we show the "New posts" and/or the multipage links?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   673
		if (!empty($subject_new_posts) || !empty($subject_multipage))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   674
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   675
			$subject .= '&nbsp; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   676
			$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   677
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   678
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   679
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   680
				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   681
					<td class="tcl">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   682
						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   683
						<div class="tclcon">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   684
							<?php echo $subject."\n" ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   685
						</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   686
					</td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   687
					<td class="tc2"><?php echo (!$ghost_topic) ? $cur_topic['num_replies'] : '&nbsp;' ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   688
					<td class="tc3"><?php echo (!$ghost_topic) ? $cur_topic['num_views'] : '&nbsp;' ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   689
					<td class="tcr"><?php echo $last_post ?></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   690
					<td class="tcmod"><input type="checkbox" name="topics[<?php echo $cur_topic['id'] ?>]" value="1" /></td>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   691
				</tr>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   692
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   693
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   694
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   695
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   696
else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   697
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   698
	$button_status = ' disabled';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   699
	echo "\t\t\t\t\t".'<tr><td class="tcl" colspan="5">'.$lang_forum['Empty forum'].'</td></tr>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   700
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   701
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   702
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   703
			</tbody>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   704
			</table>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   705
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   706
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   707
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   708
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   709
<div class="linksb">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   710
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   711
		<p class="pagelink conl"><?php echo $paging_links ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   712
		<p class="conr"><input type="submit" name="move_topics" value="<?php echo $lang_misc['Move'] ?>"<?php echo $button_status ?> />&nbsp;&nbsp;<input type="submit" name="delete_topics" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> />&nbsp;&nbsp;<input type="submit" name="open" value="<?php echo $lang_misc['Open'] ?>"<?php echo $button_status ?> />&nbsp;&nbsp;<input type="submit" name="close" value="<?php echo $lang_misc['Close'] ?>"<?php echo $button_status ?> /></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   713
		<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   714
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   715
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   716
</form>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   717
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   718
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   719
require PUN_ROOT.'footer.php';