= 1024 && $i < 4; $i++) $size /= 1024; return round($size, 2).$units[$i]; } function commaize($n) { $n = strval($n); return (intval($n) < 1000) ? $n : commaize(substr($n, 0, -3)) . ',' . substr($n, -3); } function doBoardListPart($list, $root) { global $config; $body = ''; foreach($list as $board) { if(is_array($board)) $body .= ' [' . doBoardListPart($board, $root) . '] '; else { $body .= ' ' . $board . ' /'; } } $body = preg_replace('/\/$/', '', $body); return $body; } function createBoardlist($mod=false) { global $config; if(!isset($config['boards'])) return Array('top'=>'','bottom'=>''); $body = doBoardListPart($config['boards'], $mod?'?/':$config['root']); if(!preg_match('/\]$/', $body)) $body = '[' . $body . ']'; return Array( 'top' => '
' . // Delete ''; $built .= ' No.' . // JavaScript cite ''.$this->id.'' . '
'; // File info if(!empty($this->file) && $this->file != 'deleted') { $built .= 'File: ' . $this->file . ' (' . // Filesize format_bytes($this->filesize) . ', ' . // File dimensions $this->filex . 'x' . $this->filey; // Aspect Ratio if($config['show_ratio']) { $fraction = fraction($this->filex, $this->filey, ':'); $built .= ', ' . $fraction; } // Filename $built .= ', ' . $this->filename . ')
' . // Thumbnail ''; } elseif($this->file == 'deleted') { $built .= ''; } $built .= $this->postControls(); // Body $built .= '' . $this->body . '
File: ' . $this->file . ' (' . // Filesize format_bytes($this->filesize) . ', ' . // File dimensions $this->filex . 'x' . $this->filey; // Aspect Ratio if($config['show_ratio']) { $fraction = fraction($this->filex, $this->filey, ':'); $built .= ', ' . $fraction; } // Filename $built .= ', ' . $this->filename . ')
' . // Thumbnail ''; $built .= ''; // Delete $built .= ''; $built .= ' No.' . // JavaScript cite ''.$this->id.'' . // Sticky ($this->sticky ? '' : '') . // Locked ($this->locked ? '' : '') . // [Reply] ($index ? '[Reply]' : '') . // Mod controls $this->postControls() . '
'; // Body $built .= '' . $this->body . '
' . // Omitted posts ($this->omitted || $this->omitted_images? '' . ($this->omitted ? $this->omitted . ' post' . ($this->omitted==1?'':'s') . ($this->omitted_images ? ' and ' : '') :'') . ($this->omitted_images ? $this->omitted_images . ' image repl' . ($this->omitted_images==1?'y':'ies') :'') . ' omitted. Click reply to view.':'') . // End '