ecked' : null;
$smiliesbar = generate_smilies_bar('document.PForm.message');
print eval(get_template('usereditpost'));
}
else
{ //save edited post
$now = time();
$message_status = 0;
if (isset($bbcodes))
{
$message_status |= 1;
//are there any bbcodes to format?
if (format_bbcodes($message) != $message)
$message_status |= 2;
}
if (isset($emoticons))
{
$message_status |= 4;
//are there any smilies to convert?
if (str_replace($sm_search, $sm_replace, $message) != $message)
$message_status |= 8;
}
$message = addslashes($message);
//update post
mysql_query("UPDATE {$dbpref}posts SET post_text='$message', post_text_status='$message_status', post_edited=1, post_edited_by='$user_name', post_edited_time='$now' WHERE post_id='$p'");
//redirect to page with the post
$result = mysql_query("SELECT COUNT(*) FROM {$dbpref}posts WHERE topic_id='$t' AND post_time < '$post_time'");
$post_num = mysql_result($result, 0) + 1;
header( 'Location: '.get_topic_url($t, ceil($post_num/$postsperpage)));
}
}
}
?>