diff options
| author | copypaste <admin@8chan.co> | 2014-04-27 15:48:47 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-04-27 15:48:47 +0200 |
| commit | c483e1258cb5d168812a6e509e982a172f6c36c6 (patch) | |
| tree | be6324a26d75b43b2f4e1f017661b50b89aa8d2b /inc/display.php | |
| parent | 7a04150b04d953f457c3fddf4bc198597f7e6470 (diff) | |
multiimage posting
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/inc/display.php b/inc/display.php index f7fe1620..0ae0ac05 100644 --- a/inc/display.php +++ b/inc/display.php @@ -94,7 +94,7 @@ function error($message, $priority = true, $debug_stuff = false) { // Return the bad request header, necessary for AJAX posts // czaks: is it really so? the ajax errors only work when this is commented out - // better yet use it when ajax is disabled + // better yet use it when ajax is disabled if (!isset ($_POST['json_response'])) { header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); } @@ -338,6 +338,9 @@ class Post { foreach ($post as $key => $value) { $this->{$key} = $value; } + + if (isset($this->files)) + $this->files = json_decode($this->files); $this->subject = utf8tohtml($this->subject); $this->name = utf8tohtml($this->name); @@ -396,7 +399,7 @@ class Post { $built .= ' <a title="'._('Ban & Delete').'" href="?/' . $board['dir'] . 'ban&delete/' . $this->id . '">' . $config['mod']['link_bandelete'] . '</a>'; // Delete file (keep post) - if (!empty($this->file) && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod)) + if (!empty($this->files) && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod)) $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['dir'] . 'deletefile/' . $this->id); // Spoiler file (keep post) @@ -418,9 +421,6 @@ class Post { return $built; } - public function ratio() { - return fraction($this->filewidth, $this->fileheight, ':'); - } public function build($index=false) { global $board, $config; @@ -439,6 +439,9 @@ class Thread { $this->{$key} = $value; } + if (isset($this->files)) + $this->files = json_decode($this->files); + $this->subject = utf8tohtml($this->subject); $this->name = utf8tohtml($this->name); $this->mod = $mod; @@ -477,7 +480,7 @@ class Thread { $this->posts[] = $post; } public function postCount() { - return count($this->posts) + $this->omitted; + return count($this->posts) + $this->omitted; } public function postControls() { global $board, $config; @@ -506,7 +509,7 @@ class Thread { $built .= ' <a title="'._('Ban & Delete').'" href="?/' . $board['dir'] . 'ban&delete/' . $this->id . '">' . $config['mod']['link_bandelete'] . '</a>'; // Delete file (keep post) - if (!empty($this->file) && $this->file != 'deleted' && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod)) + if (!empty($this->files) && $this->files[0]->file != 'deleted' && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod)) $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['dir'] . 'deletefile/' . $this->id); // Spoiler file (keep post) @@ -546,10 +549,6 @@ class Thread { return $built; } - public function ratio() { - return fraction($this->filewidth, $this->fileheight, ':'); - } - public function build($index=false, $isnoko50=false) { global $board, $config, $debug; |
