prefix comment ID with c, so it isn't just a random number

This commit is contained in:
Shish 2012-02-22 13:07:04 +00:00
parent aaceb99aa5
commit f8fec8a036
3 changed files with 4 additions and 4 deletions

View file

@ -38,7 +38,7 @@ class BBCode extends FormatterExtension {
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
$text = preg_replace("/\[s\](.*?)\[\/s\]/s", "<s>\\1</s>", $text);
$text = preg_replace("/&gt;&gt;(\d+)(#(\d+))?/s", "<a href=\"".make_link("post/view/\\1\\2")."\" onclick=\"$('#\\3]').effect('highlight', {}, 5000);\">&gt;&gt;\\1\\2</a>", $text);
$text = preg_replace("/&gt;&gt;(\d+)(#c?(\d+))?/s", "<a href=\"".make_link("post/view/\\1\\2")."\" onclick=\"$('#c\\3]').effect('highlight', {}, 5000);\">&gt;&gt;\\1\\2</a>", $text);
$text = preg_replace("/(^|\s)#(\d+)/s", "\\1<a href=\"#\\2\">#\\2</a>", $text);
$text = preg_replace("/&gt;&gt;([^\d].+)/", "<blockquote><small>\\1</small></blockquote>", $text);
$text = preg_replace("/\[url=((?:https?|ftp|irc|mailto):\/\/.*?)\](.*?)\[\/url\]/s", "<a href=\"\\1\">\\2</a>", $text);

View file

@ -207,7 +207,7 @@ class CommentListTheme extends Themelet {
' - <a onclick="return confirm(\'Delete comment by '.$h_name.':\\n'.$stripped_nonl.'\');" '.
'href="'.make_link('comment/delete/'.$i_comment_id.'/'.$i_image_id).'">Del</a>' : '';
return '
<div class="comment" id="'.$i_comment_id.'">
<div class="comment" id="c'.$i_comment_id.'">
<div class="info">
'.$h_avatar.'
'.$h_timestamp.$h_reply.$h_ip.$h_del.'

View file

@ -119,9 +119,9 @@ function deleteCookie( name, path, domain ) {
function replyTo(imageId, commentId) {
var box = $("#comment_on_"+imageId);
var text = ">>"+imageId+"#"+commentId+": ";
var text = ">>"+imageId+"#c"+commentId+": ";
box.focus();
box.val(box.val() + text);
$("[name="+commentId+"]").parent().effect("highlight", {}, 5000);
$("#c"+commentId).effect("highlight", {}, 5000);
}