diff --git a/core/ext/user.ext.php b/core/ext/user.ext.php index ee5ea4c1..6408cd45 100644 --- a/core/ext/user.ext.php +++ b/core/ext/user.ext.php @@ -302,6 +302,7 @@ class UserPage extends Extension { } if($user->is_admin()) { $page->add_main_block(new Block("More Options", $this->build_more_options($duser))); + $page->add_main_block(new Block("IP List", $this->build_ip_list($duser))); } } } @@ -378,6 +379,40 @@ class UserPage extends Extension { return $html; } + private function build_ip_list($duser) { + global $database; + global $config; + + $html = "
Uploaded from: ";
+ $rows = $database->db->GetAll("
+ SELECT owner_ip, COUNT(images.id) AS count
+ FROM images
+ WHERE owner_id=?
+ GROUP BY owner_ip
+ ORDER BY posted DESC", array($duser->id), true);
+ foreach($rows as $row) {
+ $ip = $row['owner_ip'];
+ $count = $row['count'];
+ $html .= " $ip ($count)"; + } + $html .= " | Commented from:";
+ $rows = $database->db->GetAll("
+ SELECT owner_ip, COUNT(comments.id) AS count
+ FROM comments
+ WHERE owner_id=?
+ GROUP BY owner_ip
+ ORDER BY posted DESC", array($duser->id), true);
+ foreach($rows as $row) {
+ $ip = $row['owner_ip'];
+ $count = $row['count'];
+ $html .= " $ip ($count)"; + } + $html .= " |
(Most recent at top) |