forked from GithubBackups/tinyib
Better looking error page
This commit is contained in:
parent
4dea0858ed
commit
730ddf47db
12
imgboard.php
12
imgboard.php
@ -14,7 +14,7 @@ if (get_magic_quotes_gpc()) {
|
|||||||
if (get_magic_quotes_runtime()) { set_magic_quotes_runtime(0); }
|
if (get_magic_quotes_runtime()) { set_magic_quotes_runtime(0); }
|
||||||
|
|
||||||
function fancyDie($message) {
|
function fancyDie($message) {
|
||||||
die('<span style="color: red;font-size: 1.5em;font-family: Helvetica;">' . $message . '</span>');
|
die('<body text="#800000" bgcolor="#FFFFEE" align="center"><br><span style="background-color: #F0E0D6;font-size: 1.25em;font-family: Tahoma, Geneva, sans-serif;padding: 7px;border: 1px solid #D9BFB7;border-left: none;border-top: none;">' . $message . '</span><br><br>- <a href="javascript:history.go(-1)">Click here to go back</a> -</body>');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists('settings.php')) {
|
if (!file_exists('settings.php')) {
|
||||||
@ -32,12 +32,8 @@ foreach ($writedirs as $dir) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$includes = array("inc/functions.php", "inc/html.php");
|
$includes = array("inc/functions.php", "inc/html.php");
|
||||||
if (TINYIB_DBMODE == 'flatfile') {
|
if (in_array(TINYIB_DBMODE, array('flatfile', 'mysql', 'sqlite'))) {
|
||||||
$includes[] = 'inc/database_flatfile.php';
|
$includes[] = 'inc/database_' . TINYIB_DBMODE . '.php';
|
||||||
} elseif (TINYIB_DBMODE == 'mysql') {
|
|
||||||
$includes[] = 'inc/database_mysql.php';
|
|
||||||
} elseif (TINYIB_DBMODE == 'sqlite') {
|
|
||||||
$includes[] = 'inc/database_sqlite.php';
|
|
||||||
} else {
|
} else {
|
||||||
fancyDie("Unknown database mode specificed");
|
fancyDie("Unknown database mode specificed");
|
||||||
}
|
}
|
||||||
@ -153,7 +149,7 @@ if (isset($_POST["message"]) || isset($_POST["file"])) {
|
|||||||
|
|
||||||
$post['id'] = insertPost($post);
|
$post['id'] = insertPost($post);
|
||||||
if ($noko) {
|
if ($noko) {
|
||||||
$redirect = ($post['parent'] != '0') ? 'res/' . $post['parent'] . '.html#' . $post['id'] : 'res/' . $post['id'] . '.html#' . $post['id'];
|
$redirect = 'res/' . ($post['parent'] == '0' ? $post['id'] : $post['parent']) . '.html#' . $post['id'];
|
||||||
}
|
}
|
||||||
trimThreads();
|
trimThreads();
|
||||||
echo 'Updating thread page...<br>';
|
echo 'Updating thread page...<br>';
|
||||||
|
@ -86,8 +86,7 @@ function nameAndTripcode($name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tripcode = "";
|
$tripcode = "";
|
||||||
if ($cap != "") {
|
if ($cap != "") { // Copied from Futabally
|
||||||
/* From Futabally */
|
|
||||||
$cap = strtr($cap, "&", "&");
|
$cap = strtr($cap, "&", "&");
|
||||||
$cap = strtr($cap, ",", ", ");
|
$cap = strtr($cap, ",", ", ");
|
||||||
$salt = substr($cap."H.", 1, 2);
|
$salt = substr($cap."H.", 1, 2);
|
||||||
@ -349,30 +348,26 @@ function createThumbnail($name, $filename, $new_w, $new_h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fastImageCopyResampled(&$dst_image, &$src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 3) {
|
function fastImageCopyResampled(&$dst_image, &$src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 3) {
|
||||||
//Author: Tim Eckel - Date: 12/17/04 - Project: FreeRingers.net - Freely distributable.
|
// Author: Tim Eckel - Date: 12/17/04 - Project: FreeRingers.net - Freely distributable.
|
||||||
if (empty($src_image) || empty($dst_image)) { return false; }
|
if (empty($src_image) || empty($dst_image)) { return false; }
|
||||||
|
|
||||||
if ($quality <= 1) {
|
if ($quality <= 1) {
|
||||||
$temp = imagecreatetruecolor ($dst_w + 1, $dst_h + 1);
|
$temp = imagecreatetruecolor ($dst_w + 1, $dst_h + 1);
|
||||||
|
|
||||||
imagecopyresized ($temp, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w + 1, $dst_h + 1, $src_w, $src_h);
|
imagecopyresized ($temp, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w + 1, $dst_h + 1, $src_w, $src_h);
|
||||||
imagecopyresized ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $dst_w, $dst_h);
|
imagecopyresized ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $dst_w, $dst_h);
|
||||||
imagedestroy ($temp);
|
imagedestroy ($temp);
|
||||||
} elseif ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {
|
} elseif ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {
|
||||||
|
|
||||||
$tmp_w = $dst_w * $quality;
|
$tmp_w = $dst_w * $quality;
|
||||||
$tmp_h = $dst_h * $quality;
|
$tmp_h = $dst_h * $quality;
|
||||||
$temp = imagecreatetruecolor ($tmp_w + 1, $tmp_h + 1);
|
$temp = imagecreatetruecolor ($tmp_w + 1, $tmp_h + 1);
|
||||||
|
|
||||||
imagecopyresized ($temp, $src_image, $dst_x * $quality, $dst_y * $quality, $src_x, $src_y, $tmp_w + 1, $tmp_h + 1, $src_w, $src_h);
|
imagecopyresized ($temp, $src_image, $dst_x * $quality, $dst_y * $quality, $src_x, $src_y, $tmp_w + 1, $tmp_h + 1, $src_w, $src_h);
|
||||||
|
|
||||||
imagecopyresampled ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $tmp_w, $tmp_h);
|
imagecopyresampled ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $tmp_w, $tmp_h);
|
||||||
|
|
||||||
imagedestroy ($temp);
|
imagedestroy ($temp);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user