forked from GithubBackups/vichan
8chan/smart-build: includable 404.php
This commit is contained in:
parent
ac693427f8
commit
51b93e643d
@ -198,6 +198,8 @@ $config['spam']['unicode'] = false;
|
|||||||
$config['twig_cache'] = false;
|
$config['twig_cache'] = false;
|
||||||
$config['report_captcha'] = true;
|
$config['report_captcha'] = true;
|
||||||
|
|
||||||
|
$config['page_404'] = 'page_404';
|
||||||
|
|
||||||
// 8chan specific mod pages
|
// 8chan specific mod pages
|
||||||
require '8chan-mod-config.php';
|
require '8chan-mod-config.php';
|
||||||
|
|
||||||
@ -206,4 +208,3 @@ require_once 'instance-functions.php';
|
|||||||
|
|
||||||
// Load database credentials
|
// Load database credentials
|
||||||
require "secrets.php";
|
require "secrets.php";
|
||||||
|
|
||||||
|
@ -18,3 +18,7 @@ function max_posts_per_hour($post) {
|
|||||||
return ($r['count'] > $config['hour_max_threads']);
|
return ($r['count'] > $config['hour_max_threads']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function page_404() {
|
||||||
|
include('404.php');
|
||||||
|
}
|
||||||
|
@ -147,6 +147,9 @@ function die_404() { global $config;
|
|||||||
header("Status: 404 Not Found");
|
header("Status: 404 Not Found");
|
||||||
echo "<h1>404 Not Found</h1><p>Page doesn't exist<hr><address>vichan</address>";
|
echo "<h1>404 Not Found</h1><p>Page doesn't exist<hr><address>vichan</address>";
|
||||||
}
|
}
|
||||||
|
elseif (is_callable($config['page_404'])) {
|
||||||
|
$config['page_404']();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
header("Location: ".$config['page_404']);
|
header("Location: ".$config['page_404']);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user