diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Session.php | 2 | ||||
-rw-r--r-- | includes/error.php | 25 | ||||
-rw-r--r-- | includes/templates/header.php | 4 |
3 files changed, 30 insertions, 1 deletions
diff --git a/includes/Session.php b/includes/Session.php index 7951d70..ceaa765 100644 --- a/includes/Session.php +++ b/includes/Session.php @@ -54,4 +54,4 @@ class Session return $result; } -}
\ No newline at end of file +} diff --git a/includes/error.php b/includes/error.php new file mode 100644 index 0000000..5e33212 --- /dev/null +++ b/includes/error.php @@ -0,0 +1,25 @@ +<?php +function user_notice($message) { + echo '<p class="error">'. $message .'</p>'; +} + +function handle_error($errno, $errstr, $errfile, $errline) { + if (!(error_reporting() & $errno)) { + // This error code is not included in error_reporting, so let it fall + // through to the standard PHP error handler + return false; + } + + switch ($errno) { + // See https://www.php.net/manual/en/errorfunc.constants.php + case E_USER_NOTICE: + user_notice($errstr); + break; + default: + return false; + } + return true; +} + +$old_error_handler = set_error_handler('handle_error'); +?> diff --git a/includes/templates/header.php b/includes/templates/header.php index 1db9cda..5070cfe 100644 --- a/includes/templates/header.php +++ b/includes/templates/header.php @@ -1,4 +1,6 @@ +<header> <h1>cflip.net forum<sup style="font-size: small;">beta</sup></h1> +<p> [<a href="/">Home</a>] [<a href="/search.php?type=thread&sort=lr">All Threads</a>] [<a href="/search.php?type=post&sort=cd">All Posts</a>] @@ -16,3 +18,5 @@ } ?> </span> +</p> +</header> |