redirect to the bottom of the thread when commenting

This commit is contained in:
Shish 2012-02-22 13:25:03 +00:00
parent 833ef69ec4
commit 6222c0d093

View File

@ -117,10 +117,11 @@ class CommentList extends Extension {
if($event->get_arg(0) === "add") {
if(isset($_POST['image_id']) && isset($_POST['comment'])) {
try {
$i_iid = int_escape($_POST['image_id']);
$cpe = new CommentPostingEvent($_POST['image_id'], $user, $_POST['comment']);
send_event($cpe);
$page->set_mode("redirect");
$page->set_redirect(make_link("post/view/".int_escape($_POST['image_id'])));
$page->set_redirect(make_link("post/view/$i_iid#comment_on_$i_iid"));
}
catch(CommentPostingException $ex) {
$this->theme->display_error(403, "Comment Blocked", $ex->getMessage());