diff --git a/inc/config.php b/inc/config.php index 54180153..44dc60ec 100644 --- a/inc/config.php +++ b/inc/config.php @@ -62,6 +62,8 @@ define('JPEG_QUALITY', 100); define('REDRAW_GIF', false); + // Display the aspect ratio in a post's file info + define('SHOW_RATIO', false); define('DIR_IMG', 'src/'); define('DIR_THUMB', 'thumb/'); 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) ? '':'') . - '' - . $this->name . - '' . (!empty($this->trip) ? ' '.$this->trip.'':'') - . ( !empty($this->email) ? '':'') - . ' ' . date('m/d/y (D) H:i:s', $this->time).' - No.id . ');"') . 'href="' . ($index?ROOT . DIR_RES . $this->thread . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.' -
- '.(!empty($this->file)?'- File: '.basename($this->file).' ('.format_bytes($this->filesize).', '.$this->filex.'x'.$this->filey.', '.$this->filename.') -
-- '.$this->body.' -
-'; + + // Subject + $built .= '' . $this->subject . ''; + // Email + if(!empty($this->email)) + $built .= ''; + // Name + $built .= '' . $this->name . '' + // Trip + . (!empty($this->trip) ? ' '.$this->trip.'':''); + + // End email + if(!empty($this->email)) + $built .= ''; + + // Date/time + $built .= ' ' . date('m/d/y (D) H:i:s', $this->time); + + $built .= ' No.' . + // JavaScript cite + 'id . ');"') . 'href="' . ($index?ROOT . DIR_RES . $this->thread . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$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 + '' . $this->body . '