[comment] fix unnecessary truncate when trimming
Also makes trimming consistent across themes
This commit is contained in:
parent
e80d235fe9
commit
d451f164a3
4 changed files with 20 additions and 4 deletions
|
@ -209,7 +209,11 @@ class CommentListTheme extends Themelet
|
||||||
$i_uid = $comment->owner_id;
|
$i_uid = $comment->owner_id;
|
||||||
$h_name = html_escape($comment->owner_name);
|
$h_name = html_escape($comment->owner_name);
|
||||||
$h_timestamp = autodate($comment->posted);
|
$h_timestamp = autodate($comment->posted);
|
||||||
$h_comment = ($trim ? truncate($tfe->stripped, 50) : $tfe->formatted);
|
if ($trim) {
|
||||||
|
$h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped;
|
||||||
|
} else {
|
||||||
|
$h_comment = $tfe->formatted;
|
||||||
|
}
|
||||||
$i_comment_id = $comment->comment_id;
|
$i_comment_id = $comment->comment_id;
|
||||||
$i_image_id = $comment->image_id;
|
$i_image_id = $comment->image_id;
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,11 @@ class CustomCommentListTheme extends CommentListTheme
|
||||||
//$i_uid = $comment->owner_id;
|
//$i_uid = $comment->owner_id;
|
||||||
$h_name = html_escape($comment->owner_name);
|
$h_name = html_escape($comment->owner_name);
|
||||||
//$h_poster_ip = html_escape($comment->poster_ip);
|
//$h_poster_ip = html_escape($comment->poster_ip);
|
||||||
$h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted);
|
if ($trim) {
|
||||||
|
$h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped;
|
||||||
|
} else {
|
||||||
|
$h_comment = $tfe->formatted;
|
||||||
|
}
|
||||||
$i_comment_id = $comment->comment_id;
|
$i_comment_id = $comment->comment_id;
|
||||||
$i_image_id = $comment->image_id;
|
$i_image_id = $comment->image_id;
|
||||||
$h_posted = autodate($comment->posted);
|
$h_posted = autodate($comment->posted);
|
||||||
|
|
|
@ -103,7 +103,11 @@ class CustomCommentListTheme extends CommentListTheme
|
||||||
//$i_uid = $comment->owner_id;
|
//$i_uid = $comment->owner_id;
|
||||||
$h_name = html_escape($comment->owner_name);
|
$h_name = html_escape($comment->owner_name);
|
||||||
//$h_poster_ip = html_escape($comment->poster_ip);
|
//$h_poster_ip = html_escape($comment->poster_ip);
|
||||||
$h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted);
|
if ($trim) {
|
||||||
|
$h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped;
|
||||||
|
} else {
|
||||||
|
$h_comment = $tfe->formatted;
|
||||||
|
}
|
||||||
$i_comment_id = $comment->comment_id;
|
$i_comment_id = $comment->comment_id;
|
||||||
$i_image_id = $comment->image_id;
|
$i_image_id = $comment->image_id;
|
||||||
$h_posted = autodate($comment->posted);
|
$h_posted = autodate($comment->posted);
|
||||||
|
|
|
@ -77,7 +77,11 @@ class CustomCommentListTheme extends CommentListTheme
|
||||||
//$i_uid = $comment->owner_id;
|
//$i_uid = $comment->owner_id;
|
||||||
$h_name = html_escape($comment->owner_name);
|
$h_name = html_escape($comment->owner_name);
|
||||||
//$h_poster_ip = html_escape($comment->poster_ip);
|
//$h_poster_ip = html_escape($comment->poster_ip);
|
||||||
$h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted);
|
if ($trim) {
|
||||||
|
$h_comment = strlen($tfe->stripped) > 52 ? substr($tfe->stripped, 0, 50)."..." : $tfe->stripped;
|
||||||
|
} else {
|
||||||
|
$h_comment = $tfe->formatted;
|
||||||
|
}
|
||||||
$i_comment_id = $comment->comment_id;
|
$i_comment_id = $comment->comment_id;
|
||||||
$i_image_id = $comment->image_id;
|
$i_image_id = $comment->image_id;
|
||||||
|
|
||||||
|
|
Reference in a new issue