Limit length of recent IP lists on user info page

git-svn-id: file:///home/shish/svn/shimmie2/trunk@637 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-12-08 03:23:53 +00:00
parent cfb1bcb9e0
commit 6d90231d50

View File

@ -77,13 +77,25 @@ class UserPageTheme extends Themelet {
public function display_ip_list($page, $uploads, $comments) {
$html = "<table id='ip-history'>";
$html .= "<tr><td>Uploaded from: ";
$n = 0;
foreach($uploads as $ip => $count) {
$html .= "<br>$ip ($count)";
if(++$n >= 20) {
$html .= "<br>...";
break;
}
}
$html .= "</td><td>Commented from:";
$n = 0;
foreach($comments as $ip => $count) {
$html .= "<br>$ip ($count)";
if(++$n >= 20) {
$html .= "<br>...";
break;
}
}
$html .= "</td></tr>";
$html .= "<tr><td colspan='2'>(Most recent at top)</td></tr></table>";