function auxpgGetAuxPage($aux_page_ID) { $q = db_query("select aux_page_ID, aux_page_name, aux_page_text, aux_page_text_type, " . " meta_keywords, meta_description, title from " . AUX_PAGES_TABLE . " where aux_page_ID=" . (int) $aux_page_ID); if ($row = db_fetch_row($q)) { if ($row["aux_page_text_type"] != 1) { $row["aux_page_text"] = ToText($row["aux_page_text"]); } $row["aux_page_title"] = $row["title"]; } return $row; }
function db_query($s) { //database query global $sc_4, $sc_8, $gmc; if (isset($gmc) && $gmc == 1) { $sc_81 = getmicrotime(); } // $scriptv = getmicrotime(); $res = array(); $res["resource"] = mysql_query($s); /* $scriptp = getmicrotime(); $rom = $scriptp-$scriptv; print $rom." - ".$s."<br>"; */ if (!$res['resource']) { $out = "ERROR: " . mysql_errno() . ":" . mysql_error() . "\nSql: " . $s . "\nLink: " . $_SERVER["REQUEST_URI"] . "\nDate: " . date("d.m.y - H:i:s") . "\nDump:\n"; ob_start(); var_dump($_GET); var_dump($_POST); $tmpa = ob_get_contents(); ob_end_clean(); $out .= $tmpa; mysql_query("insert into " . MYSQL_ERROR_LOG_TABLE . " (errors, tstamp) VALUES ('" . xEscSQL(ToText($out)) . "', NOW())"); $ecount = mysql_fetch_row(mysql_query("select count(*) from " . MYSQL_ERROR_LOG_TABLE)); $ecount = $ecount[0] - 50; if ($ecount > 0) { mysql_query("delete from " . MYSQL_ERROR_LOG_TABLE . " ORDER BY tstamp ASC LIMIT " . $ecount); } // die('Wrong database query!'); } $res["columns"] = array(); $column_index = 0; while ($xwer = @mysql_fetch_field($res["resource"])) { $res["columns"][$xwer->name] = $column_index; $column_index++; } if (isset($gmc) && $gmc == 1) { $sc_82 = getmicrotime(); $sc_4++; $sc_8 = $sc_8 + $sc_82 - $sc_81; } return $res; }
function error_reporting_log($error_num, $error_var, $error_file, $error_line) { $error_write = false; switch ($error_num) { case 1: $error_desc = "ERROR"; $error_write = true; break; case 2: $error_desc = "WARNING"; $error_write = true; break; case 4: $error_desc = "PARSE"; $error_write = true; break; case 8: $error_desc = "NOTICE"; $error_write = false; break; } if ($error_write) { if (strpos($error_file, "mysql.php") == false && strpos($error_file, "smarty") == false) { $out = $error_desc . ": " . $error_var . "\nLine: " . $error_line . "\nFile: " . $error_file . "\nLink: " . $_SERVER["REQUEST_URI"] . "\nDate: " . date("d.m.y - H:i:s") . "\nDump:\n"; ob_start(); var_dump($_GET); var_dump($_POST); $tmpa = ob_get_contents(); ob_end_clean(); $out .= $tmpa; db_query("insert into " . ERROR_LOG_TABLE . " (errors, tstamp) VALUES ('" . xEscSQL(ToText($out)) . "', NOW())"); $ecount = db_fetch_row(db_query("select count(*) from " . ERROR_LOG_TABLE)); $ecount = $ecount[0] - 50; if ($ecount > 0) { db_query("delete from " . ERROR_LOG_TABLE . " ORDER BY tstamp ASC LIMIT " . $ecount); } } } }