From a2a404f1daca791b0345ce76de3b3fcbd26d3004 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 4 Nov 2010 03:10:47 +1100 Subject: Cleaned functions. Added room for image aspect ratio. Implemented soon. --- inc/display.php | 71 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 22 deletions(-) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index a1bfd2f5..20e8b16d 100644 --- a/inc/display.php +++ b/inc/display.php @@ -38,28 +38,55 @@ $this->filename = $filename; } public function build($index=false) { - $built = ' -
-

- - '.$this->subject.' - - ' . ( !empty($this->email) ? '':'') - . ' ' . date('m/d/y (D) H:i:s', $this->time).' - No.'.$this->id.' -

- '.(!empty($this->file)?'

- File: '.basename($this->file).' ('.format_bytes($this->filesize).', '.$this->filex.'x'.$this->filey.', '.$this->filename.') -

- ':'').' -

- '.$this->body.' -

-

'; + $built = '
' . + '

'; + + // Subject + $built .= '' . $this->subject . ''; + // Email + if(!empty($this->email)) + $built .= ''; + + // Date/time + $built .= ' ' . date('m/d/y (D) H:i:s', $this->time); + + $built .= ' No.' . + // JavaScript cite + ''.$this->id.'' . + '

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

File: ' . basename($this->file) . ' (' . + // Filesize + format_bytes($this->filesize) . ', ' . + // File dimensions + $this->filex . 'x' . $this->filey; + // Aspect Ratio + if(SHOW_RATIO) { + $fraction = fraction($this->filex, $this->filey, ':'); + $built .= ', ' . $fraction; + } + // Filename + $built .= ', ' . $this->filename . ')

' . + // Thumbnail + ''; + } + + // Body + $built .= '

' . $this->body . '


'; + return $built; } }; -- cgit v1.3