From 3153ae01d424dcc157539ad41da2db510fbc9945 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Fri, 10 Dec 2010 21:14:45 +1100 Subject: [PATCH] Ability to show poster IP addresses to moderators --- inc/display.php | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/inc/display.php b/inc/display.php index 29012046..25fbc6ba 100644 --- a/inc/display.php +++ b/inc/display.php @@ -49,7 +49,7 @@ } class Post { - public function __construct($id, $thread, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename) { + public function __construct($id, $thread, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $root=ROOT) { $this->id = $id; $this->thread = $thread; $this->subject = utf8tohtml($subject); @@ -66,9 +66,11 @@ $this->filey = $filey; $this->filesize = $filesize; $this->filename = $filename; + $this->ip = $ip; + $this->root = $root; } public function build($index=false) { - global $board; + global $board, $mod; $built = '
' . '

'; @@ -84,6 +86,11 @@ // Trip . (!empty($this->trip) ? ' '.$this->trip.'':''); + // IP Address + if($mod && $mod['type'] >= MOD_SHOW_IP) { + $built .= ' [' . $this->ip . ']'; + } + // End email if(!empty($this->email)) $built .= ''; @@ -94,14 +101,14 @@ $built .= ' No.' . + ' href="' . $this->root . $board['dir'] . DIR_RES . $this->thread . '.html' . '#' . $this->id . '">No.' . // JavaScript cite - ''.$this->id.'' . + ''.$this->id.'' . '

'; // File info if(!empty($this->file)) { - $built .= '

File: ' . $this->file . ' (' . + $built .= '

File: ' . $this->file . ' (' . // Filesize format_bytes($this->filesize) . ', ' . // File dimensions @@ -114,7 +121,7 @@ // Filename $built .= ', ' . $this->filename . ')

' . // Thumbnail - ''; + ''; } // Body @@ -126,7 +133,7 @@ class Thread { public $omitted = 0; - public function __construct($id, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename) { + public function __construct($id, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $root=ROOT) { $this->id = $id; $this->subject = utf8tohtml($subject); $this->email = $email; @@ -144,6 +151,8 @@ $this->filename = $filename; $this->omitted = 0; $this->posts = Array(); + $this->ip = $ip; + $this->root = $root; } public function add(Post $post) { $this->posts[] = $post; @@ -151,9 +160,9 @@ public function build($index=false) { - global $board; + global $board, $mod; - $built = '

File: ' . $this->file . ' (' . + $built = '

File: ' . $this->file . ' (' . // Filesize format_bytes($this->filesize) . ', ' . // File dimensions @@ -166,7 +175,7 @@ // Filename $built .= ', ' . $this->filename . ')

' . // Thumbnail - ''; + ''; $built .= '

'; @@ -181,6 +190,11 @@ // Trip . (!empty($this->trip) ? ' '.$this->trip.'':''); + // IP Address + if($mod && $mod['type'] >= MOD_SHOW_IP) { + $built .= ' [' . $this->ip . ']'; + } + // End email if(!empty($this->email)) $built .= ''; @@ -191,11 +205,11 @@ $built .= ' No.' . + ' href="' . $this->root . $board['dir'] . DIR_RES . $this->id . '.html' . '#' . $this->id . '">No.' . // JavaScript cite - ''.$this->id.'' . + ''.$this->id.'' . // [Reply] - ($index ? '[Reply]' : '') . + ($index ? '[Reply]' : '') . '

'; // Body