summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorfallenPineapple <fallenPineapple87@gmail.com>2013-08-10 17:16:30 -0400
committerfallenPineapple <fallenPineapple87@gmail.com>2013-08-10 17:16:30 -0400
commit12ee85beafcb545fcb3a71eb1ad9cf90c329df33 (patch)
tree8919c8804160f947d58628a8589b7448fd104079 /inc/display.php
parent1248e329d20eeddbd9eea3b81bb59d42461d0893 (diff)
Adds "noko50" (View Last 50 Posts) pages. (Broken Reply)
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/display.php b/inc/display.php
index 97b8c744..4d70e674 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -416,6 +416,9 @@ class Thread {
public function add(Post $post) {
$this->posts[] = $post;
}
+ public function postCount() {
+ return count($this->posts) + $this->omitted;
+ }
public function postControls() {
global $board, $config;
@@ -483,10 +486,12 @@ class Thread {
return fraction($this->filex, $this->filey, ':');
}
- public function build($index=false) {
+ public function build($index=false, $isnoko50=false) {
global $board, $config, $debug;
- $built = Element('post_thread.html', array('config' => $config, 'board' => $board, 'post' => &$this, 'index' => $index));
+ $hasnoko50 = $this->postCount() >= $config['noko50_min'];
+
+ $built = Element('post_thread.html', array('config' => $config, 'board' => $board, 'post' => &$this, 'index' => $index, 'hasnoko50' => $hasnoko50, 'isnoko50' => $isnoko50));
return $built;
}