【php开源代码栏目提醒】:网学会员php开源代码为您提供editpost.php参考,解决您在editpost.php学习中工作中的难题,参考学习。
<?php
if(!defined('SEO-BOARD'))
{
die($lang['fatal_error']);
}
require ('smilies/smilies.php');
if (!isset($p) || !is_numeric($p))
die($lang['fatal_error']);
$result = mysql_query("SELECT p.post_text, p.post_text_status, p.post_time, p.topic_id, p.post_author, p.post_author_id, p.post_author_ip, u.user_allowviewonline, u.user_lasttimereadpost, u.user_numposts, u.user_regdate FROM {$dbpref}posts p LEFT JOIN {$dbpref}users u ON p.post_author_id=u.user_id WHERE post_id = '$p'");
if (mysql_num_rows($result)!=1)
die($lang['no_such_post']);
if (!isset($_POST["editpost"]))
list($message, $message_status, $post_time, $t, $author_name, $author_id, $author_ip, $author_allowviewonline, $author_lasttimereadpost, $author_num_posts, $author_reg_date) = mysql_fetch_row($result);
else
list(, , $post_time, $t, $author_name, $author_id, $author_ip, $author_allowviewonline, $author_lasttimereadpost, $author_num_posts, $author_reg_date) = mysql_fetch_row($result);
$result = my
sql_query("SELECT forum_id FROM {$dbpref}topics WHERE topic_id = '$t'");
if (
mysql_num_rows($result)!=1)
die($lang['fatal_error']);
$f = mysql_result($result, 0);
$now = time();
if (($user_id != 1) && (is_user_moderator($f, $user_id) == 0))
{
if (($author_id != $user_id) || (($author_id == $user_id) && (($now - $post_time) > $usereditposttimeout)))
die($lang['access_denied']);
}
$title = $forumtitle.' » '.$lang['edit_post'];
$forum_path = get_forum_path($f, $lang['edit_post']);
require('forumheader.php');
$errormessage = null;
if (!isset($_POST["editpost"]))
{
$smiliesbar = generate_smilies_bar('document.PForm.message');
$bbcodes_check = (($message_status & 1) != 0) ? 'checked' : null;
$emoticons_check = (($message_status & 4) != 0) ? 'checked' : null;
$makeurls_check = 'checked';
$message = format_html($message);
print eval(get_template('usereditpost'));
}
else
{
$message = stripslashes($message);
if (strlen($message) == 0)
$errormessage = get_error($lang['message_empty']);
if (is_null($errormessage) && isset($makeurls) && isset($bbcodes))
$message = makeURLs($message);
if (is_null($errormessage))
$errormessage = validate_text($message, isset($bbcodes));
if (!is_null($errormessage))
{
$message = format_html($message);
$bbcodes_check = isset($bbcodes) ? 'checked' : null;
$emoticons_check = isset($emoticons) ? 'checked' : null;
$makeurls_check = isset($makeurls) ? 'checked' : null;
$smiliesbar = generate_smilies_bar('document.PForm.message');
print eval(get_template('usereditpost'));
}
else
{
if (isset($preview))
{
$cell_iterator = 0;
$pagination = null;
if (!in_array($f, $allowhtmlforums))
$message = format_html($message);
$post_title = $lang['preview_post'];
$post_message = $message;
if (isset($emoticons))
$post_message = str_replace($sm_search, $sm_replace, $post_message);
if (isset($bbcodes))
$post_message = format_bbcodes($post_message);
$post_message = fix_tabs_spaces($post_message);
if ($author_id == 0)
{
$posted_by = '<span class=memberbutton style="text-decoration: none; cursor: default;">'.$author_name.' </span>';
$author_num_posts = null;
$author_reg_date = null;
$author_online = null;
}
else
{
$posted_by = get_member_link($author_id, $author_name);
$author_num_posts = $lang['posts'].': '.$author_num_posts;
$author_reg_date = $lang['joined'].': '.format_shortdate($author_reg_date);
if ($author_allowviewonline == 0)
$author_online = null;
else
{
if (($now - $author_lasttimereadpost) < $visittimeout)
$author_online = '<br>'.$lang['user_online'];
else
$author_online = '<br>'.$lang['user_offline'];
}
}
$user_type = get_user_type($author_id, $f);
$posted_on = $lang['posted'].': '.format_datetime($post_time, $user_timezone);
$user_ip = ' '.$lang['ip'].': '.$author_ip;
$edited_by = ' '.$lang['edited_by'].': '.$user_name;
$post_actions = '<br>';
$topic_commands = null;
$posts_html = eval(get_template('mainpostcell'));
print eval(get_template('mainposttable'));
$bbcodes_check = isset($bbcodes) ? 'checked' : null;
$emoticons_check = isset($emoticons) ? 'checked' : null;
$makeurls_check = isset($makeurls) ? 'ch