pkg_comments.php 1.42 KB
Newer Older
1
2
<div class="pgbox">
<?php
3
$uid = uid_from_sid($SID);
4
5
6
while (list($indx, $carr) = each($comments)) { ?>
	<div class="comment-header"><?php

7
	if ($SID) {
8
		$carr['UserName'] = "<a href=\"account.php?Action=AccountInfo&amp;ID={$carr['UsersID']}\">{$carr['UserName']}</a>";
9
	}
10

11
	$commentHeader = '<p style="display:inline;">' . __('Comment by: %s on %s', $carr['UserName'], gmdate('Y-m-d H:i', $carr['CommentTS'])) . '</p>';
12
13

	if (canDeleteCommentArray($carr, $atype, $uid)) {
Lukas Fleischer's avatar
Lukas Fleischer committed
14
15
16
17
18
		$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" ';
19
		$durl.= ' alt="'.__("Delete comment").'" name="submit" value="1" ';
Lukas Fleischer's avatar
Lukas Fleischer committed
20
21
		$durl.= ' />&nbsp;';
		$durl.= '</fieldset>';
22
23
24
25
26

		$commentHeader = $durl.$commentHeader."</form>";
	}

	echo $commentHeader;
27
28
29
?></div>
	<blockquote class="comment-body">
	<div>
30
<?php echo parse_comment($carr['Comments']) ?>
31
32
	</div>
	</blockquote>
33
<?php
34
35
}
?>
36
</div>
37
38

<?php
39
$count = package_comments_count(isset($_GET['ID']) ? $_GET['ID'] : pkgid_from_name($_GET['N']));
40
41
if ($count > 10 && !isset($_GET['comments'])) {
	echo '<div class="pgbox">';
Dario Giovannetti's avatar
Dario Giovannetti committed
42
	echo '<a href="'. $_SERVER['REQUEST_URI'] . '&amp;comments=all">'. __('Show all %s comments', $count) . '</a>';
43
44
45
	echo '</div>';
}
?>