Permalink
Browse files

Jump to the correct anchor when posting a comment/reply.

  • Loading branch information...
Artefact2 committed Jul 24, 2012
1 parent 255d8e1 commit 5c9c20c0cd3cb06b2d3f8354dd4d205411e4c70b
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/view_fit.php
View
@@ -93,6 +93,8 @@
\Osmium\Db\query_params('INSERT INTO osmium.loadoutcommentrevisions (commentid, revision, updatedbyaccountid, updatedate, commentbody, commentformattedbody) VALUES ($1, $2, $3, $4, $5, $6)', array($commentid, 1, $a['accountid'], $t, $_POST['commentbody'], $formatted));
\Osmium\Log\add_log_entry(\Osmium\Log\LOG_TYPE_CREATE_COMMENT, null, $commentid, $loadoutid);
\Osmium\Db\query('COMMIT;');
+ header('Location: #c'.$commentid);
+ die();
} else {
\Osmium\Db\query('ROLLBACK;');
}
@@ -112,6 +114,8 @@
list($crid) = $r;
\Osmium\Log\add_log_entry(\Osmium\Log\LOG_TYPE_CREATE_COMMENT_REPLY, null, $crid, $_POST['commentid'], $loadoutid);
\Osmium\Db\query('COMMIT;');
+ header('Location: #r'.$crid);
+ die();
} else {
\Osmium\Db\query('ROLLBACK;');
}

0 comments on commit 5c9c20c

Please sign in to comment.