From edab5a49302569c50c045f3a881dae6b5c792392 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 24 May 2015 21:06:03 +0100 Subject: [PATCH] more misc bug fixes --- core.php | 21 ++++++++++++++------- index.php | 27 +++++++++++++++++---------- module_index.json | 4 ++-- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/core.php b/core.php index cb219ed..bc5fd65 100644 --- a/core.php +++ b/core.php @@ -155,7 +155,7 @@ class page_renderer {title} - {header-html} @@ -218,10 +218,16 @@ class page_renderer self::generate_all_pages_datalist() ], $result); - $result = str_replace("{content}", $content, $result); + $result = str_replace([ + "{title}", + "{content}" + ], [ + $title, + $content + ], $result); $result = str_replace("{generation-time-taken}", microtime(true) - $start_time, $result); - return result; + return $result; } public static function render_main($title, $content) { @@ -245,7 +251,7 @@ class page_renderer public static function render_navigation_bar() { - global $settings, $user, $page; + global $settings, $user, $isloggedin, $page; $result = ""; - return result; + return $result; } public static function render_username($name) { + global $settings; $result = ""; if(in_array($name, $settings->admins)) $result .= $settings->admindisplaychar; @@ -301,7 +308,7 @@ class page_renderer $result = "\n"; foreach($pageindex as $pagename => $pagedetails) { - $html .= "\t\t\t"; diff --git a/index.php b/index.php index 1b9cd3f..e0776a8 100644 --- a/index.php +++ b/index.php @@ -283,7 +283,7 @@ class page_renderer {title} - {header-html} @@ -346,10 +346,16 @@ class page_renderer self::generate_all_pages_datalist() ], $result); - $result = str_replace("{content}", $content, $result); + $result = str_replace([ + "{title}", + "{content}" + ], [ + $title, + $content + ], $result); $result = str_replace("{generation-time-taken}", microtime(true) - $start_time, $result); - return result; + return $result; } public static function render_main($title, $content) { @@ -373,7 +379,7 @@ class page_renderer public static function render_navigation_bar() { - global $settings, $user, $page; + global $settings, $user, $isloggedin, $page; $result = ""; - return result; + return $result; } public static function render_username($name) { + global $settings; $result = ""; if(in_array($name, $settings->admins)) $result .= $settings->admindisplaychar; @@ -429,7 +436,7 @@ class page_renderer $result = "\n"; foreach($pageindex as $pagename => $pagedetails) { - $html .= "\t\t\t"; @@ -1149,7 +1156,7 @@ register_module([ register_module([ "name" => "Page viewer", - "version" => "0.4", + "version" => "0.6", "author" => "Starbeamrainbowlabs", "description" => "Allows you to view pages. You should include this one.", "id" => "page-view", @@ -1185,9 +1192,9 @@ register_module([ $content .= "\n\t\n"; if(isset($_GET["printable"]) and $_GET["printable"] === "yes") - exit(page_renderer::render_minimal($title, $content, $minimal)); + exit(page_renderer::render_minimal($title, $content)); else - exit(page_renderer::render_main($title, $content, $minimal)); + exit(page_renderer::render_main($title, $content)); }); } ]); diff --git a/module_index.json b/module_index.json index c6f6c36..a7e596d 100644 --- a/module_index.json +++ b/module_index.json @@ -81,10 +81,10 @@ }, { "name": "Page viewer", - "version": "0.4", + "version": "0.6", "author": "Starbeamrainbowlabs", "description": "Allows you to view pages. You should include this one.", "id": "page-view", - "lastupdate": 1432497592 + "lastupdate": 1432497918 } ] \ No newline at end of file