Skip to content
Permalink
Browse files

improved db error recursion handling; use new logo in garmin download…

… and printouts
  • Loading branch information...
following
following committed Mar 23, 2013
1 parent 75891a2 commit 40f324b77932cee28980901f9f71ee559eb79e22
@@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Unicode Reminder メモ -->
<head>
<title>Opencaching.de - Datenbankproblem</title>
<meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" />
<meta http-equiv="Content-Language" content="de" />
<meta http-equiv="gallerimg" content="no" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="resource2/ocstyle/css/style_screen.css" />
</head>
<body style="margin:20px 40px 0 40px; background:#fff">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td width="80px">
<a href="/index.php"><img src="images/newlogo.png" alt="oc-Logo" style="border:0px;"/></a>
</td>
<td width="100%">
&nbsp;
</td>
<td valign="bottom">
&nbsp;
</td>
</tr>
</table>
<div id="content">
<h1>Fehler beim Datenbankzugriff</h1>
<?php
require('lib/settings.inc.php');
echo '<p>Entschuldigung, bei der Darstellung der Seite ist ein interner Fehler aufgetreten.
Falls dieses Problem für längere Zeit bestehen sollte, informiere uns bitte per
<a href="mailto:' . $emailaddr . '">Email</a>.</p>
<p>' . $dberrmsg . '</p>
<p><a href="index.php">Zurück zur Startseite</a></p>
<p><br /><br /><em>An error occured while displaying the requested page.
If this problem persists for a longer time, please inform us via
<a href="mailto:' . $emailaddr . '">email</a>.</em></p>';
?>
</div>
</body>
</html>
@@ -0,0 +1 @@
see /doc/license.txt for license terms of the new OC.de logo
Binary file not shown.
@@ -55,6 +55,7 @@
date_default_timezone_set($timezone);
$dblink_slave = false;
$db_error = 0;
// sql debugger?
if (!isset($sql_allow_debug)) $sql_allow_debug = 0;
@@ -437,8 +438,12 @@ function sql_error()
global $absolute_server_URI;
global $interface_output;
global $dberrormsg;
global $db_error;
$db_error += 1;
$msql_error = mysql_errno() . ": " . mysql_error();
if ($db_error > 1)
$msql_error .= "\n(** error recursion **)";
if ($sql_errormail != '')
{
@@ -452,7 +457,19 @@ function sql_error()
if ($interface_output == 'html')
{
// display errorpage
tpl_errorMsg('sql_error', $dberrormsg . ($debug_page ? "<br />" . $msql_error : ""));
$dberrmsg = $dberrormsg . ($debug_page ? "<br />" . $msql_error : "");
if ($db_error <= 1)
{
tpl_errorMsg('sql_error', $dberrmsg);
}
else
{
// datbase error recursion, because another error occured while trying to
// build the error template (e.g. because connection was lost, or an error mail
// could not load translations from database)
require("html/dberror.php");
}
exit;
}
else if ($interface_output == 'plain')
@@ -58,7 +58,7 @@
$absolute_server_URI = $dev_baseurl . '/';
// EMail address of the sender
if (!isset($emailaddr)) $emailaddr = 'noreply@opencaching.de';
if (!isset($emailaddr)) $emailaddr = 'contact@opencaching.de';
// location of cache images
if (!isset($picdir)) $picdir = $rootpath . 'images/uploads';
@@ -881,16 +881,24 @@ function sql_error($sqlstatement="")
global $tpl, $opt, $db;
global $bSmartyNoTranslate;
if ($db['error'] == true)
die("sql_error() recursion, aborting!\nCheck if database connect does work.\nMost often, an error mail tried to load translations from database.\nMySQL Error no " . mysql_errno() . "\n");
$db['error'] = true;
$errno = mysql_errno();
$error = mysql_error();
if ($sqlstatement != "")
$error .= "\n\nSQL statement: " . $sqlstatement;
if ($db['error'] == true)
{
// datbase error recursion, because another error occured while trying to
// build the error template (e.g. because connection was lost, or an error mail
// could not load translations from database)
$dberrmsg = 'MySQL error (' . $errno . '): ' . $error;
require("html/dberror.php");
exit;
}
$db['error'] = true;
if ($db['connected'] == false)
$bSmartyNoTranslate = true;
@@ -932,7 +940,7 @@ function sql_error($sqlstatement="")
{
// CLI script, simple text output
if ($opt['db']['error']['display'] == true)
die('MySQL error' . ' (' . $errno . '): ' . $error . "\n");
die('MySQL error (' . $errno . '): ' . $error . "\n");
else
die("A database command could not be performed.\n");
}
@@ -10,8 +10,9 @@
<table class="null" border="0">
<tr>
<td width="30">
<img src="images/logo_new_small.gif" width="66" height="66" border="0" alt="" title="" align="left">
<img src="images/newlogo.png" height="66" border="0" alt="" title="" align="left" style="margin-bottom:8px">
</td>
<td>&nbsp;</td>
<td align="center"><font size="4">
{t}Waypoint{/t}: {$cache.wpoc}
</font>
@@ -200,7 +200,7 @@
<a style="background-image: url(resource2/{$opt.template.style}/images/viewcache/print-18.png);background-repeat:no-repeat;" onclick="window.location='viewcache.php?cacheid={$cache.cacheid}&print=y&log=5&nocrypt=' + bNoCrypt"><input name="Print5" id="Print5" value="{t}Print last logs{/t}" type="button" /></a>
</p>
<p>
<a class="send-to-gps" href="#" onclick="window.open('garmin.php?lat={$cache.latitude}&lon={$cache.longitude}&wp={$cache.wpoc}','{t escape=js}Send{/t}','width=640,height=315,resizable=no,scrollbars=1')"><input name="SendToGPS" value="{t}Send to GPS device{/t}" id="SendToGPS" type="button" /></a>
<a class="send-to-gps" href="#" onclick="window.open('garmin.php?lat={$cache.latitude}&lon={$cache.longitude}&wp={$cache.wpoc}','{t escape=js}Send{/t}','width=640,height=320,resizable=no,scrollbars=1')"><input name="SendToGPS" value="{t}Send to GPS device{/t}" id="SendToGPS" type="button" /></a>
&nbsp;&nbsp;<img src="resource2/{$opt.template.style}/images/viewcache/16x16-save.png" class="icon16" alt="" />
@@ -15,7 +15,7 @@
<table class="null" border="0">
<tr>
<td width="30">
<img src="images/logo_new_small.gif" width="66" height="66" border="0" alt="" align="left" />
<img src="images/newlogo.png" height="66" border="0" alt="" align="left" />
</td>
<td align="center">
<font size="4">{t}Waypoint{/t}: {$cache.wpoc}</font>

0 comments on commit 40f324b

Please sign in to comment.
You can’t perform that action at this time.