diff --git a/inc/display.php b/inc/display.php index 6de187a3..a82cfab1 100644 --- a/inc/display.php +++ b/inc/display.php @@ -332,14 +332,54 @@ function embed_html($link) { return 'Embedding error.'; } -class Post { +class PostProps { + public $id; + public $thread; + public $subject; + public $email; + public $name; + public $trip; + public $capcode; + public $body; + public $body_nomarkup; + public $time; + public $bump; + public $files; + public $num_files; + public $filehash; + public $password; + public $ip; + public $sticky; + public $locked; + public $cycle; + public $sage; + public $embed; + public $slug; + public $delete_token; + public $board; + + public $mod; + public $root; + public $hr; + public $posts; + public $omitted; + public $omitted_images; + public $modifiers; + + public $images; + public $replies; +} + + +class Post extends PostProps { + public function __construct($post, $root=null, $mod=false) { global $config; if (!isset($root)) $root = &$config['root']; foreach ($post as $key => $value) { - $this->{$key} = $value; + $this->$key = $value; } if (isset($this->files) && $this->files) @@ -382,14 +422,15 @@ class Post { } }; -class Thread { +class Thread extends PostProps { + public function __construct($post, $root = null, $mod = false, $hr = true) { global $config; if (!isset($root)) $root = &$config['root']; foreach ($post as $key => $value) { - $this->{$key} = $value; + $this->$key = $value; } if (isset($this->files)) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 1507890c..3fcc5504 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2029,6 +2029,7 @@ function mod_warning_post($board,$post, $token = false) { } } } + if(isset($_POST['thread'])) { // Redirect to thread header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . str_replace('%d', $_POST['thread'], $config['file_page']), true, $config['redirect_http']); @@ -2036,7 +2037,8 @@ function mod_warning_post($board,$post, $token = false) { // Redirect to board index. header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); } - } + } + $args = array( 'ip' => $ip, 'hide_ip' => !hasPermission($config['mod']['show_ip'], $board),