postInfo($PostID);
$TopicID = $forumPost['thread-id'];
if (!Forums::check_forumperm($ForumID, 'Write')) {
error('You lack the permission to edit this post.', true);
}
if ($forumPost['is-locked'] && !check_perms('site_moderate_forums')) {
error('You cannot edit a locked post.', true);
}
if ($UserID != $forumPost['user-id'] && !check_perms('site_moderate_forums')) {
error(403, true);
}
// Send a PM to the user to notify them of the edit
if ($UserID != $forumPost['user-id'] && $DoPM) {
Misc::send_pm(
$forumPost['user-id'], 0,
"Your post #$PostID has been edited",
sprintf('One of your posts has been edited by %s: [url]%s[/url]',
'[url='.site_url()."user.php?id=$UserID]".$LoggedUser['Username'].'[/url]',
site_url()."forums.php?action=viewthread&postid=$PostID#post$PostID"
)
);
}
$forum->editPost($UserID, $PostID, $Body);
$Cache->deleteMulti([
"thread_{$TopicID}_catalogue_" . (int)floor((POSTS_PER_PAGE * $forumPost['page'] - POSTS_PER_PAGE) / THREAD_CATALOGUE),
"thread_{$TopicID}_info",
]);
// This gets sent to the browser, which echoes it in place of the old body
echo Text::full_format($Body);
?>
Last edited by =$LoggedUser['Username']?> Just now