summaryrefslogtreecommitdiffstats
path: root/web/template/pkg_comments.php
blob: f62308d6b5d8a55a1eb9f71ec0df4109686c73cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<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&amp;ID={$carr['UsersID']}\">{$carr['UserName']}</a>";
	}

	$commentHeader = '<p style="display:inline;">' . sprintf(_('Comment by: %s on %s'), $carr['UserName'], gmdate('r', $carr['CommentTS'])) . '</p>';

	if (canDeleteCommentArray($carr, $atype, $uid)) {
		$durl = '<form method="post" action="packages.php?ID='.$row['ID'].'">';
		$durl.= '<fieldset style="display:inline;">';
		$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" ';
		$durl.= ' alt="'._("Delete comment").'" name="submit" value="1" ';
		$durl.= ' />&nbsp;';
		$durl.= '</fieldset>';

		$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['REQUEST_URI'] . '&comments=all">'. sprintf(_('Show all %s comments'), $count) . '</a>';
	echo '</div>';
}
?>