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 - 'id . ');"') . 'href="' . ($index?ROOT . DIR_RES . $this->thread . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'' . + 'id . ');"') . 'href="' . ($index?$this->root . DIR_RES . $this->thread . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$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 . ') File: ' . $this->file . ' (' .
+ $built = ' File: ' . $this->file . ' (' .
// Filesize
format_bytes($this->filesize) . ', ' .
// File dimensions
@@ -166,7 +175,7 @@
// Filename
$built .= ', ' . $this->filename . ') ';
@@ -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
- 'id . ');"') . 'href="' . ($index?ROOT . $board['dir'] . DIR_RES . $this->id . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'' .
+ 'id . ');"') . 'href="' . ($index?$this->root . $board['dir'] . DIR_RES . $this->id . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'' .
// [Reply]
- ($index ? '[Reply]' : '') .
+ ($index ? '[Reply]' : '') .
'