rather than <a name=foo>, stick an ID on the comment

This commit is contained in:
Shish 2012-02-22 13:05:17 +00:00
parent eccea620ba
commit aaceb99aa5
2 changed files with 2 additions and 3 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=\"$('[name=\\3]').parent().effect('highlight', {}, 5000);\">&gt;&gt;\\1\\2</a>", $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("/(^|\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,8 +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 '
<a name="'.$i_comment_id.'"></a>
<div class="comment">
<div class="comment" id="'.$i_comment_id.'">
<div class="info">
'.$h_avatar.'
'.$h_timestamp.$h_reply.$h_ip.$h_del.'