2 if (isset($row['BaseID'])) {
3 /* On a package details page. */
4 $base_id = $row['BaseID'];
6 /* On a package base details page. */
9 $include_deleted = has_credential(CRED_COMMENT_VIEW_DELETED
);
10 $count = pkgbase_comments_count($base_id, $include_deleted);
14 <a href
="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title
="<?= __('View all comments' , $count) ?> (<?= $count ?>)"><?
= __('Latest Comments') ?
></a
>
15 <span
class="arrow"></span
>
18 <?php
while (list($indx, $row) = each($comments)): ?
>
20 $date_fmtd = gmdate('Y-m-d H:i', $row['CommentTS']);
21 if ($row['UserName']) {
22 $user_fmtd = html_format_username($row['UserName']);
23 $heading = __('%s commented on %s', $user_fmtd, $date_fmtd);
25 $heading = __('Anonymous comment on %s', $date_fmtd);
28 if ($row['EditedTS']) {
29 $date_fmtd = gmdate('Y-m-d H:i', $row['EditedTS']);
30 $heading .= ' <span class="edited">(';
31 if ($row['DelUsersID']) {
32 $user_fmtd = html_format_username($row['DelUserName']);
33 $heading .= __('deleted on %s by %s', $date_fmtd, $user_fmtd);
35 $user_fmtd = html_format_username($row['EditUserName']);
36 $heading .= __('last edited on %s by %s', $date_fmtd, $user_fmtd);
38 $heading .= ')</span>';
41 $row['DelUserName'] = html_format_username($row['DelUserName']);
42 $row['EditUserName'] = html_format_username($row['EditUserName']);
44 <h4 id
="comment-<?= $row['ID'] ?>"<?php
if ($row['DelUsersID']): ?
> class="comment-deleted"<?php
endif; ?
>>
46 <?php
if (!$row['DelUsersID'] && can_delete_comment_array($row)): ?
>
47 <form
class="delete-comment-form" method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name), ENT_QUOTES); ?>">
48 <fieldset style
="display:inline;">
49 <input type
="hidden" name
="action" value
="do_DeleteComment" />
50 <input type
="hidden" name
="comment_id" value
="<?= $row['ID'] ?>" />
51 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
52 <input type
="image" class="delete-comment" src
="/images/x.min.svg" width
="11" height
="11" alt
="<?= __('Delete comment') ?>" title
="<?= __('Delete comment') ?>" name
="submit" value
="1" />
56 <?php
if (!$row['DelUsersID'] && can_edit_comment_array($row)): ?
>
57 <a href
="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name) . 'edit-comment/?comment_id=' . $row['ID'], ENT_QUOTES) ?>" class="edit-comment" title
="<?= __('Edit comment') ?>"><img src
="/images/pencil.min.svg" alt
="<?= __('Edit comment') ?>" width
="11" height
="11"></a
>
60 <div
class="article-content<?php if ($row['DelUsersID']): ?> comment-deleted<?php endif; ?>">
62 <?
= parse_comment($row['Comments']) ?
>
68 <?php
if ($count > 10 && !isset($_GET['comments'])): ?
>
71 <a href
="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title
="<?= __('View all comments') ?> (<?= $count ?>)"><?
= __('All comments', $count) ?
></a
>