diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php index a9ee90e1..fea07ba4 100644 --- a/themes/danbooru/comment.theme.php +++ b/themes/danbooru/comment.theme.php @@ -101,19 +101,20 @@ class CustomCommentListTheme extends CommentListTheme { $i_image_id = int_escape($comment->image_id); $h_posted = autodate($comment->posted); + $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50)); + $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl); $h_userlink = "$h_name"; - $h_dellink = $user->is_admin() ? - "
($h_poster_ip, stripped."');\" ". - "href='".make_link("comment/delete/$i_comment_id/$i_image_id")."'>Del)" : ""; + $h_del = $user->can("delete_comment") ? + ' - Del' : ''; $h_imagelink = $trim ? ">>>\n" : ""; if($trim) { - return "

$h_userlink $h_dellink
$h_posted
$h_comment

"; + return "

$h_userlink $h_del
$h_posted
$h_comment

"; } else { return " - +
$h_userlink
$h_posted$h_dellink
$h_userlink
$h_posted$h_del
$h_comment
"; diff --git a/themes/futaba/comment.theme.php b/themes/futaba/comment.theme.php index b367da94..ee6672c2 100644 --- a/themes/futaba/comment.theme.php +++ b/themes/futaba/comment.theme.php @@ -66,20 +66,21 @@ class CustomCommentListTheme extends CommentListTheme { $i_comment_id = int_escape($comment->comment_id); $i_image_id = int_escape($comment->image_id); + $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50)); + $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl); $h_userlink = "$h_name"; $h_date = $comment->posted; - $h_dellink = $user->is_admin() ? - " ($h_poster_ip, stripped."');\" ". - "href='".make_link("comment/delete/$i_comment_id/$i_image_id")."'>Del)" : ""; + $h_del = $user->can("delete_comment") ? + ' - Del' : ''; $h_reply = "[Reply]"; if($inner_id == 0) { - return "
$h_userlink$h_dellink $h_date No.$i_comment_id $h_reply

$h_comment

"; + return "
$h_userlink$h_del $h_date No.$i_comment_id $h_reply

$h_comment

"; } else { return "
>>". - "
$h_userlink$h_dellink $h_date No.$i_comment_id $h_reply

$h_comment

" . + "
$h_userlink$h_del $h_date No.$i_comment_id $h_reply

$h_comment

" . "
"; } }