diff --git a/core/block.class.php b/core/block.class.php index 1fbe0e3f..8fe1bfbc 100644 --- a/core/block.class.php +++ b/core/block.class.php @@ -44,6 +44,14 @@ class Block { */ public $id; + /** + * Should this block count as content for the sake of + * the 404 handler + * + * @var boolean + */ + public $is_content = true; + /** * Construct a block. * diff --git a/ext/blocks/main.php b/ext/blocks/main.php index 43043370..d1f0f6cf 100644 --- a/ext/blocks/main.php +++ b/ext/blocks/main.php @@ -42,7 +42,9 @@ class Blocks extends Extension { foreach($blocks as $block) { $path = implode("/", $event->args); if(strlen($path) < 4000 && fnmatch($block['pages'], $path)) { - $page->add_block(new Block($block['title'], $block['content'], $block['area'], $block['priority'])); + $b = new Block($block['title'], $block['content'], $block['area'], $block['priority']); + $b->is_content = false; + $page->add_block($b); } } diff --git a/ext/chatbox/main.php b/ext/chatbox/main.php index 1ac474c4..80081d46 100644 --- a/ext/chatbox/main.php +++ b/ext/chatbox/main.php @@ -30,6 +30,7 @@ class Chatbox extends Extension { // loads the chatbox at the set location $html = "
"; $chatblock = new Block("Chatbox", $html, "main", 97); + $chatblock->is_content = false; $page->add_block($chatblock); } } diff --git a/ext/handle_404/main.php b/ext/handle_404/main.php index b7996848..a17e80f7 100644 --- a/ext/handle_404/main.php +++ b/ext/handle_404/main.php @@ -43,10 +43,7 @@ class Handle404 extends Extension { private function count_main($blocks) { $n = 0; foreach($blocks as $block) { - if($block->section == "main") $n++; // more hax. - } - if(ext_is_live("Chatbox")) { - $n--; // even more hax. + if($block->section == "main" && $block->is_content) $n++; // more hax. } return $n; }