Better looking error page

This commit is contained in:
tslocum 2011-01-07 17:36:00 -08:00
parent 4dea0858ed
commit 730ddf47db
2 changed files with 7 additions and 16 deletions

View file

@ -14,7 +14,7 @@ if (get_magic_quotes_gpc()) {
if (get_magic_quotes_runtime()) { set_magic_quotes_runtime(0); }
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')) {
@ -32,12 +32,8 @@ foreach ($writedirs as $dir) {
}
$includes = array("inc/functions.php", "inc/html.php");
if (TINYIB_DBMODE == 'flatfile') {
$includes[] = 'inc/database_flatfile.php';
} elseif (TINYIB_DBMODE == 'mysql') {
$includes[] = 'inc/database_mysql.php';
} elseif (TINYIB_DBMODE == 'sqlite') {
$includes[] = 'inc/database_sqlite.php';
if (in_array(TINYIB_DBMODE, array('flatfile', 'mysql', 'sqlite'))) {
$includes[] = 'inc/database_' . TINYIB_DBMODE . '.php';
} else {
fancyDie("Unknown database mode specificed");
}
@ -153,7 +149,7 @@ if (isset($_POST["message"]) || isset($_POST["file"])) {
$post['id'] = insertPost($post);
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();
echo 'Updating thread page...<br>';

View file

@ -86,8 +86,7 @@ function nameAndTripcode($name) {
}
$tripcode = "";
if ($cap != "") {
/* From Futabally */
if ($cap != "") { // Copied from Futabally
$cap = strtr($cap, "&amp;", "&");
$cap = strtr($cap, "&#44;", ", ");
$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) {
//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 ($quality <= 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 ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $dst_w, $dst_h);
imagedestroy ($temp);
} elseif ($quality < 5 && (($dst_w * $quality) < $src_w || ($dst_h * $quality) < $src_h)) {
$tmp_w = $dst_w * $quality;
$tmp_h = $dst_h * $quality;
$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);
imagecopyresampled ($dst_image, $temp, 0, 0, 0, 0, $dst_w, $dst_h, $tmp_w, $tmp_h);
imagedestroy ($temp);
} else {
imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
}
return true;
}