mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Comments are now split at link boundaries and links are converted separately. I find this to be a much cleaner way than re-converting comments that have already been converted using htmlspecialchars(). This also doesn't require any callback procedure. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<div class="pgbox">
|
|
<?php
|
|
$uid = uid_from_sid($SID);
|
|
while (list($indx, $carr) = each($comments)) { ?>
|
|
<div class="comment-header"><?php
|
|
|
|
if ($SID) {
|
|
$carr['UserName'] = "<a href=\"account.php?Action=AccountInfo&ID={$carr['UsersID']}\">{$carr['UserName']}</a>";
|
|
}
|
|
|
|
$commentHeader =__('Comment by: %s on %s', $carr['UserName'], gmdate('r', $carr['CommentTS']));
|
|
|
|
if (canDeleteCommentArray($carr, $atype, $uid)) {
|
|
$durl = '<form method="POST" action="packages.php?ID='.$row['ID'].'">';
|
|
$durl.= '<input type="hidden" name="action" value="do_DeleteComment">';
|
|
$durl.= '<input type="hidden" name="comment_id" value="'.$carr['ID'].'">';
|
|
$durl.= '<input type="image" src="images/x.png" border="0" ';
|
|
$durl.= ' alt="'.__("Delete comment").'" name="submit" value="1" ';
|
|
$durl.= ' width="19" height="18"> ';
|
|
|
|
$commentHeader = $durl.$commentHeader."</form>";
|
|
}
|
|
|
|
echo $commentHeader;
|
|
?></div>
|
|
<blockquote class="comment-body">
|
|
<div>
|
|
<?php echo parse_comment($carr['Comments']) ?>
|
|
</div>
|
|
</blockquote>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
<?php
|
|
$count = package_comments_count($_GET['ID']);
|
|
if ($count > 10 && !isset($_GET['comments'])) {
|
|
echo '<div class="pgbox">';
|
|
echo '<a href="'. $_SERVER['PHP_SELF'] . '?ID=' . $_REQUEST['ID'] . '&comments=all">'. __('Show all %s comments', $count) . '</a>';
|
|
echo '</div>';
|
|
}
|
|
?>
|