punbb/edit.php
author Dan
Wed, 11 Jul 2007 21:01:48 -0400
changeset 0 f9ffdbd96607
child 2 a8a21e1c7afa
permissions -rw-r--r--
Initial population
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
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    26
define('PUN_ROOT', './');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    27
require PUN_ROOT.'include/common.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    28
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    29
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    30
if ($pun_user['g_read_board'] == '0')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    31
	message($lang_common['No view']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    32
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    33
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    34
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    35
if ($id < 1)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    36
	message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    37
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    38
// Fetch some info about the post, the topic and the forum
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    39
$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$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 p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    40
if (!$db->num_rows($result))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    41
	message($lang_common['Bad request']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    42
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    43
$cur_post = $db->fetch_assoc($result);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    44
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    45
// Sort out who the moderators are and if we are currently a moderator (or an admin)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    46
$mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    47
$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    48
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    49
// Determine whether this post is the "topic post" or not
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    50
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    51
$topic_post_id = $db->result($result);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    52
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    53
$can_edit_subject = ($id == $topic_post_id && (($pun_user['g_edit_subjects_interval'] == '0' || (time() - $cur_post['posted']) < $pun_user['g_edit_subjects_interval']) || $is_admmod)) ? true : false;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    54
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    55
// Do we have permission to edit this post?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    56
if (($pun_user['g_edit_posts'] == '0' ||
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    57
	$cur_post['poster_id'] != $pun_user['id'] ||
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    58
	$cur_post['closed'] == '1') &&
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    59
	!$is_admmod)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    60
	message($lang_common['No permission']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    61
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    62
// Load the post.php/edit.php language file
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    63
require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    64
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    65
// Start with a clean slate
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    66
$errors = array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    67
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    68
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    69
if (isset($_POST['form_sent']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    70
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    71
	if ($is_admmod)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    72
		confirm_referrer('edit.php');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    73
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    74
	// If it is a topic it must contain a subject
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    75
	if ($can_edit_subject)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    76
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    77
		$subject = pun_trim($_POST['req_subject']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    78
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    79
		if ($subject == '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    80
			$errors[] = $lang_post['No subject'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    81
		else if (pun_strlen($subject) > 70)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    82
			$errors[] = $lang_post['Too long subject'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    83
		else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    84
			$subject = ucwords(strtolower($subject));
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    85
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    86
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    87
	// Clean up message from POST
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    88
	$message = pun_linebreaks(pun_trim($_POST['req_message']));
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    89
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    90
	if ($message == '')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    91
		$errors[] = $lang_post['No message'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    92
	else if (strlen($message) > 65535)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    93
		$errors[] = $lang_post['Too long message'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    94
	else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    95
		$message = ucwords(strtolower($message));
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    96
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    97
	// Validate BBCode syntax
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    98
	if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    99
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   100
		require PUN_ROOT.'include/parser.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   101
		$message = preparse_bbcode($message, $errors);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   102
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   103
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   104
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   105
	$hide_smilies = isset($_POST['hide_smilies']) ? intval($_POST['hide_smilies']) : 0;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   106
	if ($hide_smilies != '1') $hide_smilies = '0';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   107
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   108
	// Did everything go according to plan?
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   109
	if (empty($errors) && !isset($_POST['preview']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   110
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   111
		$edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : '';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   112
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   113
		require PUN_ROOT.'include/search_idx.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   114
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   115
		if ($can_edit_subject)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   116
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   117
			// Update the topic and any redirect topics
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   118
			$db->query('UPDATE '.$db->prefix.'topics SET subject=\''.$db->escape($subject).'\' WHERE id='.$cur_post['tid'].' OR moved_to='.$cur_post['tid']) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   119
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   120
			// We changed the subject, so we need to take that into account when we update the search words
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   121
			update_search_index('edit', $id, $message, $subject);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   122
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   123
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   124
			update_search_index('edit', $id, $message);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   125
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   126
		// Update the post
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   127
		$db->query('UPDATE '.$db->prefix.'posts SET message=\''.$db->escape($message).'\', hide_smilies=\''.$hide_smilies.'\''.$edited_sql.' WHERE id='.$id) or error('Unable to update post', __FILE__, __LINE__, $db->error());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   128
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   129
		redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   130
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   131
}
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_post['Edit post'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   136
$required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   137
$focus_element = array('edit', 'req_message');
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   138
require PUN_ROOT.'header.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   139
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   140
$cur_index = 1;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   141
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   142
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   143
<div class="linkst">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   144
	<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   145
		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&nbsp;&raquo;&nbsp;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&nbsp;&raquo;&nbsp;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   146
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   147
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   148
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   149
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   150
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   151
// If there are errors, we display them
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   152
if (!empty($errors))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   153
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   154
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   155
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   156
<div id="posterror" class="block">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   157
	<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   158
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   159
		<div class="inbox"
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   160
			<p><?php echo $lang_post['Post errors info'] ?></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   161
			<ul>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   162
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   163
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   164
	while (list(, $cur_error) = each($errors))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   165
		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   166
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   167
			</ul>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   168
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   169
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   170
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   171
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   172
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   173
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   174
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   175
else if (isset($_POST['preview']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   176
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   177
	require_once PUN_ROOT.'include/parser.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   178
	$preview_message = parse_message($message, $hide_smilies);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   179
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   180
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   181
<div id="postpreview" class="blockpost">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   182
	<h2><span><?php echo $lang_post['Post preview'] ?></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   183
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   184
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   185
			<div class="postright">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   186
				<div class="postmsg">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   187
					<?php echo $preview_message."\n" ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   188
				</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   189
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   190
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   191
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   192
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   193
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   194
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   195
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   196
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   197
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   198
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   199
<div class="blockform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   200
	<h2><?php echo $lang_post['Edit post'] ?></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   201
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   202
		<form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&amp;action=edit" onsubmit="return process_form(this)">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   203
			<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   204
				<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   205
					<legend><?php echo $lang_post['Edit post legend'] ?></legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   206
					<input type="hidden" name="form_sent" value="1" />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   207
					<div class="infldset txtarea">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   208
<?php if ($can_edit_subject): ?>						<label><?php echo $lang_common['Subject'] ?><br />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   209
						<input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   210
<?php endif; ?>						<label><?php echo $lang_common['Message'] ?><br />
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   211
						<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   212
						<ul class="bblinks">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   213
							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   214
							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   215
							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   216
						</ul>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   217
					</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   218
				</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   219
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   220
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   221
$checkboxes = array();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   222
if ($pun_config['o_smilies'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   223
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   224
	if (isset($_POST['hide_smilies']) || $cur_post['hide_smilies'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   225
		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" checked="checked" tabindex="'.($cur_index++).'" />&nbsp;'.$lang_post['Hide smilies'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   226
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   227
		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'" />&nbsp;'.$lang_post['Hide smilies'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   228
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   229
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   230
if ($is_admmod)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   231
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   232
	if ((isset($_POST['form_sent']) && isset($_POST['silent'])) || !isset($_POST['form_sent']))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   233
		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" checked="checked" />&nbsp;'.$lang_post['Silent edit'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   234
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   235
		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" />&nbsp;'.$lang_post['Silent edit'];
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   236
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   237
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   238
if (!empty($checkboxes))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   239
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   240
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   241
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   242
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   243
			<div class="inform">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   244
				<fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   245
					<legend><?php echo $lang_common['Options'] ?></legend>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   246
					<div class="infldset">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   247
						<div class="rbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   248
							<?php echo implode('</label>'."\n\t\t\t\t\t\t\t", $checkboxes).'</label>'."\n" ?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   249
						</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   250
					</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   251
				</fieldset>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   252
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   253
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   254
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   255
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   256
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   257
			</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   258
			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   259
		</form>
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
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   263
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   264
require PUN_ROOT.'footer.php';