]> git.mxchange.org Git - friendica.git/commitdiff
Show "404.tpl" instead of using 'notice()' in case of 404
authorFabio Comuni <fabrix.xm@gmail.com>
Mon, 19 Sep 2011 09:52:32 +0000 (11:52 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Mon, 19 Sep 2011 09:52:32 +0000 (11:52 +0200)
index.php
mod/help.php
view/404.tpl [new file with mode: 0644]

index 3db8170ef4fe4d8cfd507e0f7e04bd11227a36c0..d3b687c555d3a26da39092a2a11849b82669cead 100644 (file)
--- a/index.php
+++ b/index.php
@@ -207,7 +207,10 @@ if(strlen($a->module)) {
 
                logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
                header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
-               notice( t('Page not found.' ) . EOL);
+               $tpl = get_markup_template("404.tpl");
+               $a->page['content'] = replace_macros($tpl, array(
+                       '$message' =>  t('Page not found.' )
+               ));
        }
 }
 
index 59e062f6d4398d16c9c6657e3828313b296dda3c..af05bd47c08109bbd23e70c8b960e7ba66f4decc 100644 (file)
@@ -36,8 +36,10 @@ function help_content(&$a) {
        
        if(! strlen($text)) {
                header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
-               notice( t('Page not found.' ) . EOL);
-               return;
+               $tpl = get_markup_template("404.tpl");
+               return replace_macros($tpl, array(
+                       '$message' =>  t('Page not found.' )
+               ));
        }
        
        return Markdown($text);
diff --git a/view/404.tpl b/view/404.tpl
new file mode 100644 (file)
index 0000000..bf4d4e9
--- /dev/null
@@ -0,0 +1 @@
+<h1>$message</h1>