From: Roland Häder Date: Sun, 1 Mar 2009 03:59:43 +0000 (+0000) Subject: A lot fixes to templates and missing functions added, more rewrites X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b8c86fa12322603c24a88ea2b0fd3dbeba612752;p=mailer.git A lot fixes to templates and missing functions added, more rewrites --- diff --git a/inc/config-functions.php b/inc/config-functions.php index cde1fa35c3..49d99272cc 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -89,5 +89,13 @@ function incrementConfigEntry ($configEntry, $value=1) { } } +// Checks wether the configuration array is set so the config is loaded +function isConfigLoaded () { + global $_CONFIG; + + // Check all + return ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 0)); +} + // [EOF] ?> diff --git a/inc/config.php b/inc/config.php index 4cfa57bbbf..963738bfcb 100644 --- a/inc/config.php +++ b/inc/config.php @@ -99,10 +99,10 @@ define('PATH', $PATH); define('WEBMASTER', "you@some-hoster.tld.invalid"); // CFG: INSTALLED -define('mxchange_installed', false); +define('mxchange_installed', true); // CFG: ADMIN-SETUP -define('admin_registered', false); +define('admin_registered', true); // CFG: FRAMESET define('frameset_active', false); @@ -130,11 +130,11 @@ $MySQL = array( // CFG: MYSQL-HOST 'host' => "localhost", // CFG: MYSQL-DBASE - 'dbase' => "db", + 'dbase' => "mxchange", // CFG: MYSQL-LOGIN - 'login' => "user", + 'login' => "root", // CFG: MYSQL-PASSWORD - 'password' => "pass", + 'password' => "ab57dk90", ); // CFG: MYSQL-PREIFX @@ -151,7 +151,7 @@ define('LEAD_EXPIRY_TIME' , (30*24*60*60)); // == 30 days // CFG: SMTP-HOSTNAME define('SMTP_HOSTNAME', ""); // CFG: SMTP-USER -define('SMTP_USER' , ""); +define('SMTP_USER', ""); // CFG: SMTP-PASSWORD define('SMTP_PASSWORD', ""); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index deddd14903..24e0edbb1e 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -54,7 +54,7 @@ function SQL_QUERY ($sql_string, $F, $L) { // Run SQL command //* DEBUG: */ echo $sql_string."
\n"; $result = mysql_query($sql_string, SQL_GET_LINK()) - or addFatalMessage($F." (".$L."):".mysql_error()."
+ or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."
Query string:
".$sql_string); @@ -180,7 +180,7 @@ function SQL_RESULT ($res, $row, $field) { // SQL connect function SQL_CONNECT ($host, $login, $password, $F, $L) { // Try to connect - $connect = mysql_connect($host, $login, $password) or addFatalMessage($F." (".$L."):".mysql_error()); + $connect = mysql_connect($host, $login, $password) or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()); // Set the link resource SQL_SET_LINK($connect); @@ -192,7 +192,7 @@ function SQL_SELECT_DB ($dbName, $F, $L) { if (!SQL_IS_LINK_UP()) return false; // Return the result - return mysql_select_db($dbName, SQL_GET_LINK()) or addFatalMessage($F." (".$L."):".mysql_error()); + return mysql_select_db($dbName, SQL_GET_LINK()) or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()); } // SQL close link @@ -213,7 +213,7 @@ function SQL_CLOSE ($F, $L) { } // END - if // Close database link and forget the link - $close = mysql_close(SQL_GET_LINK()) or addFatalMessage($F." (".$L."):".mysql_error()); + $close = mysql_close(SQL_GET_LINK()) or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()); // Close link SQL_SET_LINK(null); diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 5f7a2d412b..6833326e50 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -248,7 +248,7 @@ default: // Do stuff when extension is loaded $GLOBALS['cache_instance'] = new CacheSystem(getConfig('cache_update'), constant('PATH')."inc/".getConfig('cache_path'), getConfig('cache_tested')); if ($GLOBALS['cache_instance']->getStatus() != "done") { // Failed to initialize cache sustem - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE); + addFatalMessage(__FILE__, __LINE__, "(".__LINE__."): ".CACHE_CANNOT_INITIALIZE); } // END - if } // END - if break; diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 89f17b04ec..3670d924a1 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -52,7 +52,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad // Check if mod_rewrite is loadeded if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){ $EXT_REPORTS_FAILURE = true; - addFatalMessage(MOD_REWRITE_ERROR); + addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); } // END - if // SQL commands to run @@ -69,7 +69,7 @@ case "activate": // Do stuff when admin activates this extension if (!IF_APACHE_MODULE_LOADED('mod_rewrite')) { SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__); $EXT_REPORTS_FAILURE = true; - addFatalMessage(MOD_REWRITE_ERROR); + addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); } // END - if // SQL commands to run @@ -148,7 +148,7 @@ case "update": // Update an extension // Check if mod_rewrite is loadeded if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){ $EXT_REPORTS_FAILURE = true; - //addFatalMessage(MOD_REWRITE_ERROR); + //addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); } // END - if $UPDATE_NOTES = "Es wird beim Registrieren und aktivieren geprüft, ob im Apache das Modul mod_rewrite geladen wurde. Wenn mod_rewrite nicht gefunden werden konnte, wird abgebrochen."; break; @@ -163,7 +163,7 @@ default: // Do stuff when extension is loaded if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){ $EXT_REPORTS_FAILURE = true; SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__); - if (!IS_ADMIN())addFatalMessage(MOD_REWRITE_ERROR); + if (!IS_ADMIN()) addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR')); } // END - if break; } diff --git a/inc/filters.php b/inc/filters.php index 64de90acd5..8cdf487833 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -42,7 +42,7 @@ function INIT_FILTER_SYSTEM () { // Is the filter already initialized? if ((isset($GLOBALS['filters']['chains'])) && (is_array($GLOBALS['filters']['chains']))) { // Then abort here - addFatalMessage(getMessage('FILTER_FAILED_ALREADY_INIT')); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_ALREADY_INIT')); return false; } // END - if @@ -140,7 +140,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo if ((isset($GLOBALS['filters']['chains'][$filterName][$filterFunction])) && (!$force)) { // Then abort here if (!$silentAbort) { - addFatalMessage(getMessage('FILTER_FAILED_ALREADY_ADDED'), array($filterFunction, $filterName)); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_ALREADY_ADDED'), array($filterFunction, $filterName)); } // END - if // Abort here @@ -150,7 +150,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo // Is the function there? if (!function_exists($filterFunction)) { // Then abort here - addFatalMessage(getMessage('FILTER_FAILED_NOT_FOUND'), array($filterFunction, $filterName)); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_NOT_FOUND'), array($filterFunction, $filterName)); return false; } // END - if @@ -172,7 +172,7 @@ function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $dry_r // Is that filter there? if ((!isset($GLOBALS['filters']['chains'][$filterName][$filterFunction])) && (!$force)) { // Not found, so abort here - addFatalMessage(getMessage('FILTER_FAILED_NOT_REMOVED'), array($filterFunction, $filterName)); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_NOT_REMOVED'), array($filterFunction, $filterName)); return false; } // END - if @@ -191,7 +191,7 @@ function RUN_FILTER ($filterName, $data = null, $silentAbort = true) { // Then abort here (quick'N'dirty hack) if ((!$silentAbort) && (defined('FILTER_FAILED_NO_FILTER_FOUND'))) { // Add fatal message - addFatalMessage(getMessage('FILTER_FAILED_NO_FILTER_FOUND'), $filterName); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_NO_FILTER_FOUND'), $filterName); } // END - if // Abort here @@ -243,7 +243,7 @@ function FILTER_FLUSH_FILTERS () { // Is a database link here and not in installation mode? if ((!SQL_IS_LINK_UP()) && (!isInstalling())) { // Abort here - addFatalMessage(getMessage('FILTER_FLUSH_FAILED_NO_DATABASE')); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FLUSH_FAILED_NO_DATABASE')); return false; } // END - if diff --git a/inc/functions.php b/inc/functions.php index d9e2c4ad7c..8bfa1eaac3 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -48,7 +48,7 @@ function IS_INC_WRITEABLE($inc) { } // END - if // Test if we can append data - $fp = @fopen($fqfn, 'a'); + $fp = fopen($fqfn, 'a'); if ($inc == "dummy") { // Remove dummy file fclose($fp); @@ -194,7 +194,7 @@ function getFatalArray () { } // Add a fatal error message to the queue array -function addFatalMessage ($message, $extra="") { +function addFatalMessage ($F, $L, $message, $extra="") { if (is_array($extra)) { // Multiple extras for a message with masks $message = call_user_func_array('sprintf', $extra); @@ -207,7 +207,7 @@ function addFatalMessage ($message, $extra="") { $GLOBALS['fatal_messages'][] = $message; // Log fatal messages away - DEBUG_LOG(__FUNCTION__, __LINE__, " message={$message}"); + DEBUG_LOG($F, $L, " message={$message}"); } // Getter for total fatal message count @@ -249,7 +249,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) { if ($template == "member_support_form") { // Support request of a member $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FUNCTION__, __LINE__); // Is content an array? if (is_array($content)) { @@ -404,7 +404,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { return; } else { // Load email address - $result_email = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__); + $result_email = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result_email)."
\n"; // Does the user exist? @@ -804,12 +804,12 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NICKNAME!
\n"; // Load nickname $result = SQL_QUERY_ESC("SELECT surname, family, gender, email, nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($UID)), __FILE__, __LINE__); + array(bigintval($UID)), __FUNCTION__, __LINE__); } else { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NO-NICK!
\n"; /// Load normal data $result = SQL_QUERY_ESC("SELECT surname, family, gender, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($UID)), __FILE__, __LINE__); + array(bigintval($UID)), __FUNCTION__, __LINE__); } // Fetch and merge data @@ -925,7 +925,7 @@ function LOAD_URL ($URL, $addUrlData=true) { // Get output buffer //* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL)); - DEBUG_LOG(__FUNCTION__, __LINE__, $URL); + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL); $OUTPUT = ob_get_contents(); // Clear it only if there is content @@ -1601,11 +1601,11 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) { // Check which admin shall receive this mail $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM `{!_MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY admin_id", - array($template), __FILE__, __LINE__); + array($template), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Create new entry (to all admins) SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins_mails` (admin_id, mail_template) VALUES (0, '%s')", - array($template), __FILE__, __LINE__); + array($template), __FUNCTION__, __LINE__); } else { // Load admin IDs... $aids = array(); @@ -1635,10 +1635,10 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) { } } elseif ($aid == "0") { // Select all email adresses - $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`", __FUNCTION__, __LINE__); } else { // If Admin-ID is not "to-all" select - $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE id IN (%s) ORDER BY `id`", array($aid), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE id IN (%s) ORDER BY `id`", array($aid), __FUNCTION__, __LINE__); } } @@ -2429,7 +2429,7 @@ function THEME_GET_ID ($name) { } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1", - array($name), __FILE__, __LINE__); + array($name), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -2620,7 +2620,7 @@ function debug_get_printable_backtrace () { // Get and prepare backtrace for output $backtraceArray = debug_backtrace(); foreach ($backtraceArray as $key => $trace) { - if (!isset($trace['file'])) $trace['file'] = __FILE__; + if (!isset($trace['file'])) $trace['file'] = __FUNCTION__; if (!isset($trace['line'])) $trace['line'] = __LINE__; if (!isset($trace['args'])) $trace['args'] = array(); $backtrace .= "
  • ".basename($trace['file']).":".$trace['line'].", ".$trace['function']."(".count($trace['args']).")
  • \n"; @@ -2715,7 +2715,7 @@ function REDIRCT_ON_UNINSTALLED_EXTENSION ($ext_name) { // Generate a "link" for the given admin id (aid) function GENERATE_AID_LINK ($aid) { // No assigned admin is default - $admin = "
    {--ADMIN_NO_ADMIN_ASSIGNED--}
    "; + $admin = "{--ADMIN_NO_ADMIN_ASSIGNED--}"; // Zero? = Not assigned if ($aid == "0") { @@ -2882,12 +2882,12 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) { $tmp = $FQFN.".tmp"; // Open the source file - $fp = @fopen($FQFN, 'r') or OUTPUT_HTML("READ: ".$FQFN."
    "); + $fp = fopen($FQFN, 'r') or OUTPUT_HTML("READ: ".$FQFN."
    "); // Is the resource valid? if (is_resource($fp)) { // Open temporary file - $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("WRITE: ".$tmp."
    "); + $fp_tmp = fopen($tmp, 'w') or OUTPUT_HTML("WRITE: ".$tmp."
    "); // Is the resource again valid? if (is_resource($fp_tmp)) { @@ -2922,8 +2922,8 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) { if (($done) && ($found)) { // Copy back tmp file and delete tmp :-) - @copy($tmp, $FQFN); - @unlink($tmp); + copy($tmp, $FQFN); + return unlink($tmp); } elseif (!$found) { OUTPUT_HTML("CHANGE: 404!"); } else { @@ -2934,6 +2934,9 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) { // File not found, not readable or writeable OUTPUT_HTML("404: ".$FQFN."
    "); } + + // An error was detected! + return false; } // Send notification to admin function SEND_ADMIN_NOTIFICATION($subject, $templateName, $content=array(), $uid="0") { diff --git a/inc/header.php b/inc/header.php index 226c9918cd..a57016954a 100644 --- a/inc/header.php +++ b/inc/header.php @@ -49,7 +49,7 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) { // Add title decorations? (left) if (!defined('__PAGE_TITLE')) { // Config and database connection valid? - if ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 1) && (SQL_IS_LINK_UP())) { + if ((isConfigLoaded()) && (SQL_IS_LINK_UP())) { // Title decoration enabled? if ((getConfig('enable_title_deco') == "Y") && (getConfig('title_left') != "")) $TITLE .= trim(getConfig('title_left'))." "; @@ -78,16 +78,16 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) { define('__PAGE_TITLE', $TITLE); } elseif ((!isInstalled()) || (!isAdminRegistered())) { // Load language here - LOAD_INC_ONCE("inc/language.php"); + LOAD_INC_ONCE("inc/language/install_".GET_LANGUAGE().".php"); // Installation mode - define('__PAGE_TITLE', getMessage('INSTALLATION_OF_MXCHANGE')); + define('__PAGE_TITLE', sprintf(getMessage('INSTALLATION_OF_MXCHANGE'), constant('MAIN_TITLE'))); } else { // Configuration not found! define('__PAGE_TITLE', getMessage('NO_CONFIG_FOUND_TITLE')); // Do not add the fatal message in installation mode - if (basename($_SERVER['PHP_SELF']) != "install.php") addFatalMessage(getMessage('NO_CONFIG_FOUND')); + if (basename($_SERVER['PHP_SELF']) != "install.php") addFatalMessage(__FILE__, __LINE__, getMessage('NO_CONFIG_FOUND')); } } // END - if diff --git a/inc/hooks.php b/inc/hooks.php index 592c24d5dd..48d9e1009b 100644 --- a/inc/hooks.php +++ b/inc/hooks.php @@ -47,7 +47,7 @@ function __SHUTDOWN_HOOK () { SQL_CLOSE(__FILE__, __LINE__); } elseif (!isInstalling()) { // No database link - addFatalMessage(getMessage('NO_DB_LINK_SHUTDOWN')); + addFatalMessage(__FILE__, __LINE__, getMessage('NO_DB_LINK_SHUTDOWN')); } } diff --git a/inc/install-inc.php b/inc/install-inc.php index b7ed234cea..fd5572b033 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -297,7 +297,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) // Are some SQLs found? if (count($SQLs) == 0) { // Abort here - addFatalMessage(getMessage('INSTALL_SQL_IMPORT_FAILED')); + addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_SQL_IMPORT_FAILED')); return; } // END - if @@ -334,7 +334,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) changeDataInFile(REQUEST_POST('spath')."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0); } else { // Installation area not found! - addFatalMessage(getMessage('INSTALL_MISSING_DUMPS')); + addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS')); } } // END - if } // END - if @@ -368,7 +368,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) LOAD_TEMPLATE("install_finished"); } else { // Something goes wrong during installation! :-( - addFatalMessage(getMessage('INSTALL_FINALIZER_FAILED')); + addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_FINALIZER_FAILED')); LOAD_INC("inc/fatal_errors.php"); } break; @@ -380,7 +380,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) } } else { // Already installed! - addFatalMessage(getMessage('ALREADY_INSTALLED')); + addFatalMessage(__FILE__, __LINE__, getMessage('ALREADY_INSTALLED')); } // diff --git a/inc/language/de.php b/inc/language/de.php index eb063ea9a8..6e2c3c3d1b 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -315,8 +315,7 @@ define('LIFE_MONTHS', "Monat(e)"); define('LIFE_YEARS', "Jahr(e)"); define('LANG_MEM_ONLY_1', "Auf das ausgewählte Modul "); define('LANG_MEM_ONLY_2', " dürfen nur eingeloggte Mitglieder zugreifen!"); -define('MEMBER_404_ACTION_1', "Das Mitgliedsaktionsmodul "); -define('MEMBER_404_ACTION_2', " ist nicht auffindbar!"); +define('MEMBER_404_ACTION', "Das Mitgliedsaktionsmodul %s ist nicht auffindbar!"); define('_GUEST', "Gast"); define('_UNKNOWN', "Name ist nicht ladbar"); define('_ADMIN', "Administrator"); diff --git a/inc/language/install_de.php b/inc/language/install_de.php index c171e777b0..c663fc67cc 100644 --- a/inc/language/install_de.php +++ b/inc/language/install_de.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } // Language definitions -define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script"); +define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script - %s"); define('INSTALL_MISSING_DUMPS', "Die SQL-Dumps wurden nicht gefunden! Diese sollten auch mit hochgeladen werden und lesbar sein (CHMOD 644)."); define('INSTALL_ENABLE_BACKLINK', "Backlink (=Rückverlinkung zu mxchange.org setzen?) rel="external" ist gesetzt. Bitte nicht den Backlink einbauen, und nofollow verwenden! Das schadet allen."); define('WRONG_PAGE', "Sie oder dieses Script haben eine falsche Seite ausgewählt!"); diff --git a/inc/language/sponsor_de.php b/inc/language/sponsor_de.php index 694fe3742b..0dac5d6dde 100644 --- a/inc/language/sponsor_de.php +++ b/inc/language/sponsor_de.php @@ -200,8 +200,8 @@ define('ADMIN_LIST_SPONSOR_ORDERS', "Bestellungen bearbeiten"); // Subject lines define('SPONSOR_UNLOCKED_SUBJ', "HINWEIS: Freischaltung Ihres Sponsorenaccounts"); -define('ADMIN_SPONSOR_ADD_POINTS', "HINWEIS: Gutschrift durch den Admin!"); -define('ADMIN_SPONSOR_SUB_POINTS', "HINWEIS: Abzug durch den Admin!"); +define('ADMIN_SPONSOR_ADD_POINTS_SUBJ', "HINWEIS: Gutschrift durch den Admin!"); +define('ADMIN_SPONSOR_SUB_POINTS_SUBJ', "HINWEIS: Abzug durch den Admin!"); define('SPONSOR_SUBJECT_LOCKED', "HINWEIS: Sperrung Ihres Sponsorenaccounts!"); define('SPONSOR_SUBJECT_UNLOCKED', "HINWEIS: Freigabe Ihres Sponsorenaccounts!"); define('ADMIN_SPONSOR_EDIT_SUBJECT', "HINWEIS: Sponsorenaccount geändert durch Admin!"); diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 71e179e00e..0a5c58363e 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -106,11 +106,11 @@ function ADMINS_CHECK_ACL($act, $wht) { { // Main menu $result = SQL_QUERY_ESC("SELECT access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' LIMIT 1", - array(bigintval($aid), $act), __FILE__, __LINE__); + array(bigintval($aid), $act), __FUNCTION__, __LINE__); } elseif (!empty($wht)) { // Sub menu $result = SQL_QUERY_ESC("SELECT access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND what_menu='%s' LIMIT 1", - array(bigintval($aid), $wht), __FILE__, __LINE__); + array(bigintval($aid), $wht), __FUNCTION__, __LINE__); } // Get number of lines @@ -137,7 +137,7 @@ function ADMINS_CREATE_EMAIL_LINK ($email, $mod="admin") { $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE email='%s'".$locked." LIMIT 1", - array($email), __FILE__, __LINE__); + array($email), __FUNCTION__, __LINE__); // Is there an entry? if (SQL_NUMROWS($result) == 1) { @@ -217,7 +217,7 @@ WHERE id=%s LIMIT 1", $POST['mode'][$id], $POST['la_mode'][$id], $id - ), __FILE__, __LINE__); + ), __FUNCTION__, __LINE__); } else { // Do not allow it here SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET @@ -230,7 +230,7 @@ WHERE id=%s LIMIT 1", $POST['email'][$id], $POST['la_mode'][$id], $id - ), __FILE__, __LINE__); + ), __FUNCTION__, __LINE__); } // Purge cache @@ -266,7 +266,7 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) { // Get the admin's data $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array($id), __FILE__, __LINE__); + array($id), __FUNCTION__, __LINE__); if ((SQL_NUMROWS($result) == 1) && ($sel == 1)) { // Entry found $content = SQL_FETCHARRAY($result); @@ -300,7 +300,7 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) { // Delete given admin accounts function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) { // Check if this account is the last one which cannot be deleted... - $result_main = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admins`", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admins`", __FUNCTION__, __LINE__); $accounts = SQL_NUMROWS($result_main); SQL_FREERESULT($result_main); if ($accounts > 1) { @@ -312,7 +312,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) { // Get the admin's data $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array($id), __FILE__, __LINE__); + array($id), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found $content = SQL_FETCHARRAY($result); @@ -351,11 +351,11 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) { if (($del == 1) && (GET_CURRENT_ADMIN_ID() != $id)) { // Rewrite his tasks to all admins SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE assigned_admin=%s", - array($id), __FILE__, __LINE__); + array($id), __FUNCTION__, __LINE__); // Remove account SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array($id), __FILE__, __LINE__); + array($id), __FUNCTION__, __LINE__); // Purge cache CACHE_PURGE_ADMIN_MENU($id); @@ -370,7 +370,7 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) { // List all admin accounts function ADMINS_LIST_ADMIN_ACCOUNTS() { // Select all admin accounts - $result = SQL_QUERY("SELECT id, login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY login ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY login ASC", __FUNCTION__, __LINE__); $SW = 2; $OUT = ""; while ($content = SQL_FETCHARRAY($result)) { // Compile some variables diff --git a/inc/libs/autopurge_functions.php b/inc/libs/autopurge_functions.php index e7c1b667a8..71fec0aa33 100644 --- a/inc/libs/autopurge_functions.php +++ b/inc/libs/autopurge_functions.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { function AUTOPURGE_ADD_POINTS($uid, $points) { // Check if he has locked points or not $result = SQL_QUERY_ESC("SELECT ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); list($payout) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -61,7 +61,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points) { } else { // .. to user's account SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth=0 LIMIT 1", - array($target, $target, $points, bigintval($uid)), __FILE__, __LINE__); + array($target, $target, $points, bigintval($uid)), __FUNCTION__, __LINE__); // Update mediadata as well if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($target == "points")) { diff --git a/inc/libs/beg_functions.php b/inc/libs/beg_functions.php index 31cbc83d2d..8803990fd0 100644 --- a/inc/libs/beg_functions.php +++ b/inc/libs/beg_functions.php @@ -47,7 +47,7 @@ function BEG_ADD_POINTS ($uid, $points) { if (getConfig('beg_rallye') == "Y") { // Add points to rallye account SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=beg_points+%s WHERE userid=%s LIMIT 1", - array($points, $uid), __FILE__, __LINE__); + array($points, $uid), __FUNCTION__, __LINE__); } else { // Add points to account unset($GLOBALS['ref_level']); diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index f97467bf1b..058770d325 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -71,7 +71,7 @@ function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) { // Check for entry $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE userid=%s AND %s=%s LIMIT 1", - array($uid, $column, $mid), __FILE__, __LINE__); + array($uid, $column, $mid), __FUNCTION__, __LINE__); // Load clicks from table as current rank list($rank) = SQL_FETCHROW($result); @@ -100,11 +100,11 @@ function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) { // Add points to his account directly SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET turbo_bonus=turbo_bonus+".$points." WHERE userid=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); // Rember this whole data for displaying ranking list SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus_turbo` (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '%s', '%s', UNIX_TIMESTAMP())", - array(bigintval($uid), bigintval($mail), bigintval($bonus), $rank, $points), __FILE__, __LINE__); + array(bigintval($uid), bigintval($mail), bigintval($bonus), $rank, $points), __FUNCTION__, __LINE__); if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points); } @@ -117,7 +117,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { // Load current user's data $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND userid=%s LIMIT 1", - array($type, $data, $uid), __FILE__, __LINE__); + array($type, $data, $uid), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data list($rank, $points, $mark) = SQL_FETCHROW($result); @@ -136,7 +136,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { // Load rankings $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s ORDER BY level LIMIT %s", - array($type, $data, getConfig('bonus_lines')), __FILE__, __LINE__); + array($type, $data, getConfig('bonus_lines')), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start generating the ranking list $max = SQL_NUMROWS($result); @@ -145,7 +145,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { for ($rank = 1; $rank <= $max; $rank++) { // Load data $result_users = SQL_QUERY_ESC("SELECT userid, points, timemark FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND level=%s LIMIT 1", - array($type, $data, $rank), __FILE__, __LINE__); + array($type, $data, $rank), __FUNCTION__, __LINE__); // Nothing found by default $userid = "---"; $points = "---"; @@ -233,7 +233,7 @@ function BONUS_POINTS_HANDLER ($MODE) { // function BONUS_PURGE_EXPIRED_TURBO_BONUS() { // Remove entries - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FUNCTION__, __LINE__); if (SQL_AFFECTEDROWS() > 0) { // Send out email to admin SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), ""); diff --git a/inc/libs/booking_functions.php b/inc/libs/booking_functions.php index bb3aac762f..b6289ef402 100644 --- a/inc/libs/booking_functions.php +++ b/inc/libs/booking_functions.php @@ -48,7 +48,7 @@ function ADD_BOOKING_RECORD ($subject, $uid, $points, $mode) { // Add record entry here SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_book` (`userid`,`subject`,`mode`,`points`) VALUES(%s,'%s','%s',%s)", - array($uid, $subject, $mode, $points), __FILE__, __LINE__); + array($uid, $subject, $mode, $points), __FUNCTION__, __LINE__); } // [EOF] diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index 2ba4bd0a35..8a766cdaa9 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -112,7 +112,7 @@ class CacheSystem { $this->storeExtensionVersion("cache"); } else { // Cannot create file - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -141,7 +141,7 @@ class CacheSystem { } } else { // Cannot create file - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -204,7 +204,7 @@ class CacheSystem { } } else { // Cache file not found or not readable - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->inc.CACHE_CANNOT_LOAD_2); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_CANNOT_LOAD_1.$this->inc.CACHE_CANNOT_LOAD_2); } } @@ -227,7 +227,7 @@ class CacheSystem { $this->rebuilt[$this->name] = true; } else { // Not removed! - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->inc.CACHE_CANNOT_UNLINK_2); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_CANNOT_UNLINK_1.$this->inc.CACHE_CANNOT_UNLINK_2); } } // END - if } @@ -258,7 +258,7 @@ class CacheSystem { } } else { // Cannot write to cache! - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -282,7 +282,7 @@ class CacheSystem { } // END - foreach } else { // Cannot write array! - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -319,7 +319,7 @@ class CacheSystem { } // END - if } else { // Cannot write to cache! - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } @@ -337,7 +337,7 @@ class CacheSystem { //* DEBUG: */ print __METHOD__."(".__LINE__."): {$this->name} - {$ext_name}={$ext_ver}
    \n"; } else { // Cannot create file - addFatalMessage(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".CACHE_PROBLEMS_DETECTED); } } diff --git a/inc/libs/country_functions.php b/inc/libs/country_functions.php index 30b1cfec4f..f802148a0f 100644 --- a/inc/libs/country_functions.php +++ b/inc/libs/country_functions.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { function COUNTRY_GENERATE_INFO ($id) { // Load code and description $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); // Is there an entry? if (SQL_NUMROWS($result) == 1) { diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 4d64435e51..01720837be 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -69,7 +69,7 @@ function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") { FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='".$done."' AND is_ref='".$ref."'".$ADD." ORDER BY timemark ".$sort." -LIMIT ".$limit, __FILE__, __LINE__); +LIMIT ".$limit, __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List entries @@ -122,7 +122,7 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT() { if (getConfig('doubler_jackpot') == "Y") { // Load jackpot - $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__); list($jackpot) = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index 1e74c62d32..0f19fee5f3 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -43,19 +43,19 @@ function HOLIDAY_STOP_HOLIDAYS () { $result_stop = SQL_QUERY("SELECT userid, holiday_start, holiday_end, comments FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE holiday_end <= UNIX_TIMESTAMP() -ORDER BY userid", __FILE__, __LINE__); +ORDER BY userid", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_stop) > 0) { // We foud at least one $admin = ""; while (list($uid, $start, $end, $comments) = SQL_FETCHROW($result_stop)) { // Stop holiday SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); // Unlock account SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='N', holiday_activated='0' -WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); +WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__); // Prepare array $content = array( diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index 236cd6ee6f..ded98b9128 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -48,7 +48,7 @@ function HTML_ADD_VALID_TAGS() { return $OUT; } // -function HTML_CHECK_TAGS($html { +function HTML_CHECK_TAGS ($html) { $test = stripslashes($html); while (ereg("<", $test) && ereg(">", $test)) { $check = strtolower(substr($test, strpos($test, "<") + 1, strpos($test, ">") - strpos($test, "<") - 1)); diff --git a/inc/libs/mediadata_functions.php b/inc/libs/mediadata_functions.php index 50f921272a..7eeb878e92 100644 --- a/inc/libs/mediadata_functions.php +++ b/inc/libs/mediadata_functions.php @@ -47,12 +47,12 @@ function MEDIA_UPDATE_ENTRY($keys_array, $mode, $value) { // First check if it does exist $result_media = SQL_QUERY_ESC("SELECT media_key FROM `{!_MYSQL_PREFIX!}_mediadata` -WHERE media_key = '%s' LIMIT 1", array($key), __FILE__, __LINE__); +WHERE media_key = '%s' LIMIT 1", array($key), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_media) == 0) { // Not found so we create it (mode will be ignored here!) SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mediadata` (media_key, media_value) VALUES ('%s', '%s')", - array($key, $value), __FILE__, __LINE__); + array($key, $value), __FUNCTION__, __LINE__); } else { @@ -66,13 +66,13 @@ WHERE media_key = '%s' LIMIT 1", array($key), __FILE__, __LINE__); { // Initialize entry SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mediadata` SET media_value=%s WHERE media_key='%s' LIMIT 1", - array($value, $key), __FILE__, __LINE__); + array($value, $key), __FUNCTION__, __LINE__); } else { // Update entry SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mediadata` SET media_value=media_value".$mode."%s WHERE media_key='%s' LIMIT 1", - array($value, $key), __FILE__, __LINE__); + array($value, $key), __FUNCTION__, __LINE__); } } } @@ -86,7 +86,7 @@ function MEDIA_GET_ENTRY($key) // Check for entry $result = SQL_QUERY_ESC("SELECT media_value FROM `{!_MYSQL_PREFIX!}_mediadata` WHERE media_key='%s' LIMIT 1", - array($key), __FILE__, __LINE__); + array($key), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data list($value) = SQL_FETCHROW($result); diff --git a/inc/libs/nickname_functions.php b/inc/libs/nickname_functions.php index 116e35f658..e4922a69f6 100644 --- a/inc/libs/nickname_functions.php +++ b/inc/libs/nickname_functions.php @@ -53,7 +53,7 @@ function NICKNAME_IS_ACTIVE ($uidNick) { // Search in database // @TODO Can we replace this with GET_TOTAL_DATA() ? $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s OR nickname='%s' LIMIT 1", - array(bigintval($uidNick), $uidNick), __FILE__, __LINE__); + array(bigintval($uidNick), $uidNick), __FUNCTION__, __LINE__); // Check existence of nickname $ret = (SQL_NUMROWS($result) == 1); @@ -84,7 +84,7 @@ function NICKNAME_GET_NICK ($userid) { } elseif (NICKNAME_IS_ACTIVE($userid)) { // Search for non-empty nickname $result = SQL_QUERY_ESC("SELECT nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND nickname != '' LIMIT 1", - array(bigintval($userid)), __FILE__, __LINE__); + array(bigintval($userid)), __FUNCTION__, __LINE__); // Found? if (SQL_NUMROWS($result) == 1) { diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index 96400dc2b1..2a475b86aa 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -70,7 +70,7 @@ function FILTER_UPDATE_ONLINE_LIST () { // Now search for the user $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_online` WHERE sid='%s' LIMIT 1", - array(session_id()), __FILE__, __LINE__); + array(session_id()), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -96,7 +96,7 @@ WHERE sid='%s' LIMIT 1", $ADMIN, GET_REMOTE_ADDR(), session_id() - ), __FILE__, __LINE__ + ), __FUNCTION__, __LINE__ ); } else { // No entry does exists so we simply add it! @@ -111,7 +111,7 @@ WHERE sid='%s' LIMIT 1", $ADMIN, session_id(), GET_REMOTE_ADDR() - ), __FILE__, __LINE__ + ), __FUNCTION__, __LINE__ ); } @@ -120,7 +120,7 @@ WHERE sid='%s' LIMIT 1", // Purge old entries SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_online` WHERE timestamp <= (UNIX_TIMESTAMP() - %s)", - array(getConfig('online_timeout')), __FILE__, __LINE__); + array(getConfig('online_timeout')), __FUNCTION__, __LINE__); } // diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php index 5c953dd061..88cd90537c 100644 --- a/inc/libs/optimize_functions.php +++ b/inc/libs/optimize_functions.php @@ -46,7 +46,7 @@ function REPAIR_OPTIMIZE_DB() $tot_data = 0; $tabs = 0; $opts = 0; $tot_idx = 0; $total_gain = 0; $tot_all = 0; - $result = @SQL_QUERY("SHOW TABLE STATUS FROM ".__DB_NAME, __FILE__, __LINE__); + $result = @SQL_QUERY("SHOW TABLE STATUS FROM ".__DB_NAME, __FUNCTION__, __LINE__); $tabs = @SQL_NUMROWS($result); $ret['total_size'] = 0; $ret['total_tabs'] = $tabs; @@ -66,11 +66,11 @@ function REPAIR_OPTIMIZE_DB() $gain = round ($gain, 3); // Repair table - $result1 = SQL_QUERY("REPAIR TABLE ".$row['Name'], __FILE__, __LINE__); + $result1 = SQL_QUERY("REPAIR TABLE ".$row['Name'], __FUNCTION__, __LINE__); $rep = SQL_FETCHARRAY($result1); // Optimize table - $result1 = SQL_QUERY("OPTIMIZE TABLE ".$row['Name'], __FILE__, __LINE__); + $result1 = SQL_QUERY("OPTIMIZE TABLE ".$row['Name'], __FUNCTION__, __LINE__); $opt = SQL_FETCHARRAY($result1); // Add data to array @@ -85,10 +85,10 @@ function REPAIR_OPTIMIZE_DB() $ret['total_gain'] = $total_gain; // Insert new row - $result = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_optimize_gain` (gain) VALUES ('".$total_gain."')", __FILE__, __LINE__); + $result = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_optimize_gain` (gain) VALUES ('".$total_gain."')", __FUNCTION__, __LINE__); // Get total runs and total optimization count - $result = SQL_QUERY("SELECT COUNT(id) AS rows, SUM(gain) AS opti FROM `{!_MYSQL_PREFIX!}_optimize_gain`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id) AS rows, SUM(gain) AS opti FROM `{!_MYSQL_PREFIX!}_optimize_gain`", __FUNCTION__, __LINE__); list($total_rows, $total_opti) = SQL_FETCHROW($result); // Free memory diff --git a/inc/libs/payout_functions.php b/inc/libs/payout_functions.php index 4df56e3a20..5d886f1f09 100644 --- a/inc/libs/payout_functions.php +++ b/inc/libs/payout_functions.php @@ -46,7 +46,7 @@ function PAYOUT_OUTPUT_PAYOUT_LIST ($points) { $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE %s >= min_points -ORDER BY type", array($points), __FILE__, __LINE__); +ORDER BY type", array($points), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { OUTPUT_HTML("
    {--PAYOUT_NOW--}:

    diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index aa4859a4e1..039f36d788 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -50,10 +50,10 @@ function RALLYE_AUTOSTART_RALLYES($result) // Set notified to Y SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET notified='Y' WHERE id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); // Do a snapshot off all user refs - $result_user = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY userid", __FILE__, __LINE__); + $result_user = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY userid", __FUNCTION__, __LINE__); // Transfer all neccessary data to the global $DATA array $DATA['uid_cnt'] = SQL_NUMROWS($result_user); @@ -92,7 +92,7 @@ function RALLYE_AUTOSTART_RALLYES($result) // Check if line is already included... $result_ref = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1", - array(bigintval($id), bigintval($uid)), __FILE__, __LINE__); + array(bigintval($id), bigintval($uid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_ref) == 0) { // Free memory SQL_FREERESULT($result_ref); @@ -103,7 +103,7 @@ FROM `{!_MYSQL_PREFIX!}_user_points` AS p LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid WHERE d.`status`='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s", - array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__); + array(getConfig('ref_payout'), bigintval($uid)), __FUNCTION__, __LINE__); list($cpoints) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); @@ -112,7 +112,7 @@ WHERE d.`status`='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND // Add info line SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs, curr_points) VALUES ('%s','%s','%s','%s')", - array(bigintval($id), bigintval($uid), bigintval($cnt), $cpoints), __FILE__, __LINE__); + array(bigintval($id), bigintval($uid), bigintval($cnt), $cpoints), __FUNCTION__, __LINE__); $un = true; } // END - if @@ -147,7 +147,7 @@ function RALLYE_ADD_PRICES($rallye,$mode="email") } // Load prices - $result_prices = SQL_QUERY("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id='".$rallye."' ORDER BY price_level", __FILE__, __LINE__); + $result_prices = SQL_QUERY("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id='".$rallye."' ORDER BY price_level", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_prices) > 0) { // Load prices @@ -186,7 +186,7 @@ function RALLYE_ADD_TOPUSERS($rallye,$default=0) { // First check how many prices are set $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", - array(bigintval($rallye)), __FILE__, __LINE__); + array(bigintval($rallye)), __FUNCTION__, __LINE__); $prices = SQL_NUMROWS($result); SQL_FREERESULT($result); @@ -195,7 +195,7 @@ function RALLYE_ADD_TOPUSERS($rallye,$default=0) LEFT JOIN `{!_MYSQL_PREFIX!}_refsystem` AS r ON u.userid=r.userid WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC", - array(bigintval($rallye)), __FILE__, __LINE__); + array(bigintval($rallye)), __FUNCTION__, __LINE__); // Load users $DATA = array( @@ -214,7 +214,7 @@ WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC", LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid WHERE d.userid=%s AND d.`status`='CONFIRMED' AND p.ref_depth=1 AND d.max_mails > 0 AND d.mails_confirmed >= %s -LIMIT 1", array(bigintval($uid), getConfig('ref_payout')), __FILE__, __LINE__); +LIMIT 1", array(bigintval($uid), getConfig('ref_payout')), __FUNCTION__, __LINE__); list($refpoints) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); @@ -279,7 +279,7 @@ function RALLYE_AUTOADD_USER($uid) } // END - if // Check for an auto-add rallye - $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$ADD." FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$ADD." FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Init variables $min_users = 0; $min_prices = 0; @@ -295,14 +295,14 @@ function RALLYE_AUTOADD_USER($uid) // Check if line is already included... $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1", - array(bigintval($id), bigintval($uid)), __FILE__, __LINE__); + array(bigintval($id), bigintval($uid)), __FUNCTION__, __LINE__); // Is this user added? if (SQL_NUMROWS($result) == 0) { // Add userid and his ref count to table SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs) VALUES ('%s','%s','0')", - array(bigintval($id), bigintval($uid)), __FILE__, __LINE__); + array(bigintval($id), bigintval($uid)), __FUNCTION__, __LINE__); } else { // Free memory SQL_FREERESULT($result); @@ -372,7 +372,7 @@ function RALLYE_EXPIRE_RALLYES($result) $result = SQL_QUERY_ESC("SELECT COUNT(userid) AS active FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' -LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); +LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__); list($active) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -392,7 +392,7 @@ LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Expire rallye SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET expired='Y' WHERE id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); // Run array through (by uid is the most important 2nd-level-array) foreach($prices['uid'] as $key => $uid) { @@ -463,7 +463,7 @@ LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Add task SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created) VALUES ('NEW','RALLYE_EXPIRED','".RALLYE_ADMIN_EXPIRED.": %s','".RALLYE_ADMIN_EXPIRED_TEXT."',UNIX_TIMESTAMP())", - array($title), __FILE__, __LINE__); + array($title), __FUNCTION__, __LINE__); // All work done here... } @@ -475,7 +475,7 @@ function RALLYE_LOAD_USER_DATA($uids_array) // Load users $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid IN(%s) AND `status`='CONFIRMED' ORDER BY userid LIMIT %s", - array($uid_string, count($uids_array)), __FILE__, __LINE__); + array($uid_string, count($uids_array)), __FUNCTION__, __LINE__); $ret = ""; while (list($u, $gender, $surname, $family, $email) = SQL_FETCHROW($result)) { @@ -497,7 +497,7 @@ function RALLYE_LOAD_PRICES_ARRAY($rallye) // Load prices $result = SQL_QUERY_ESC("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", - array(bigintval($rallye)), __FILE__, __LINE__); + array(bigintval($rallye)), __FUNCTION__, __LINE__); while (list($level, $points, $info) = SQL_FETCHROW($result)) { $prices['level'][] = $level; @@ -526,7 +526,7 @@ function RALLYE_LOAD_USERS_ARRAY ($rallye) { // Load users uid old points earned $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid", - array(bigintval($rallye)), __FILE__, __LINE__); + array(bigintval($rallye)), __FUNCTION__, __LINE__); while (list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user)) { // Load current ref count $cnt = RALLYE_GET_REFCOUNT($uid, $refs); @@ -537,7 +537,7 @@ FROM `{!_MYSQL_PREFIX!}_user_points` AS p LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid WHERE d.`status`='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s", - array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__); + array(getConfig('ref_payout'), bigintval($uid)), __FUNCTION__, __LINE__); list($refpoints) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); @@ -578,7 +578,7 @@ WHERE d.`status`='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND function RALLYE_LIST_WINNERS ($rallye, $default=0) { // First check how many prices are set $result_prices = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", - array(bigintval($rallye)), __FILE__, __LINE__); + array(bigintval($rallye)), __FUNCTION__, __LINE__); $prices = SQL_NUMROWS($result_prices); SQL_FREERESULT($result_prices); @@ -594,7 +594,7 @@ function RALLYE_LIST_WINNERS ($rallye, $default=0) { // active = 1: account is still confirmed // active = 0: account is deleted or locked $result_active = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1", - array(bigintval($DATA['uid'][$idx])), __FILE__, __LINE__); + array(bigintval($DATA['uid'][$idx])), __FUNCTION__, __LINE__); list($active) = SQL_FETCHROW($result_active); SQL_FREERESULT($result_active); @@ -654,7 +654,7 @@ function RALLYE_DELETE_EXPIRED_RALLYES() $result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'", - array($EXPIRE), __FILE__, __LINE__); + array($EXPIRE), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_rallye) > 0) { @@ -672,17 +672,17 @@ WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'", // Purge whole rallye SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); } // Add task SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created) VALUES ('NEW','RALLYE_PURGED','{--RALLYE_ADMIN_PURGED--}: %s','{--RALLYE_ADMIN_PURGED_TEXT--}',UNIX_TIMESTAMP())", - array($title), __FILE__, __LINE__); + array($title), __FUNCTION__, __LINE__); } // Free memory @@ -777,7 +777,7 @@ function RALLYE_GET_REFCOUNT($uid, $old=0) { FROM `{!_MYSQL_PREFIX!}_refsystem` AS s LEFT JOIN `{!_MYSQL_PREFIX!}_refdepths` AS d ON s.level=d.level -WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FILE__, __LINE__); +WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FUNCTION__, __LINE__); list($cnt) = SQL_FETCHROW($result_ref); SQL_FREERESULT($result_ref); if (empty($cnt)) { diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index dc3d068160..6f45e9307e 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -47,7 +47,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { $return = $points; // Get all ref levels - $result_refs = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level > 0 ORDER BY level ASC", __FILE__, __LINE__); + $result_refs = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level > 0 ORDER BY level ASC", __FUNCTION__, __LINE__); // "Walk" through all level while (list($level, $perc) = SQL_FETCHROW($result_refs)) { @@ -72,7 +72,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { // Update refback table ("refid" and "uid" must be exchanged!) SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET points=points+%s WHERE userid=%s AND refid=%s LIMIT 1", - array($refback, $refid, $uid), __FILE__, __LINE__); + array($refback, $refid, $uid), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")
    \n"; // Add points again, but only directly @@ -112,7 +112,7 @@ function GET_REFBACK_PERCENTS ($uid, $ref) { // Get percents from database $result = SQL_QUERY_ESC("SELECT refback FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND refid=%s LIMIT 1", - array($ref, $uid), __FILE__, __LINE__); + array($ref, $uid), __FUNCTION__, __LINE__); // Entry found? (Should be!) if (SQL_NUMROWS($result) == 1) { @@ -145,7 +145,7 @@ function GET_REFBACK_USERID_ARRAY ($rid, $level) { FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE refid=%s AND level=%s ORDER BY userid ASC", - array($rid,$level), __FILE__, __LINE__); + array($rid,$level), __FUNCTION__, __LINE__); // Entries found? //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result)."
    \n"; @@ -179,7 +179,7 @@ function UPDATE_REFBACK_TABLE($uid) { // Check for his referal $result_refid = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s ORDER BY userid ASC", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); // When no entry was updated then we have to create it here //* DEBUG: */ print __FUNCTION__."(".__LINE__."):found=".SQL_NUMROWS($result_refid)."
    \n"; @@ -203,7 +203,7 @@ function UPDATE_REFBACK_TABLE($uid) { // Check existence $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1", - array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__); + array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__); // Do we have no entry? //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!
    \n"; @@ -211,7 +211,7 @@ function UPDATE_REFBACK_TABLE($uid) { // Insert this level //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!
    \n"; SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)", - array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__); + array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__); // Move to next referal level and count his counter one up! $GLOBALS['cache_array']['back_level']++; UPDATE_REFBACK_TABLE($GLOBALS['cache_array']['up_refid'][($GLOBALS['cache_array']['back_level'] - 1)]); @@ -224,14 +224,14 @@ function UPDATE_REFBACK_TABLE($uid) { // Shall we add this as well? $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1", - array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__); + array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__); // Do we have no entry? //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!
    \n"; if (SQL_NUMROWS($result) == 0) { // Insert this level SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)", - array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__); + array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!
    \n"; } // END - if } // END - if @@ -279,7 +279,7 @@ LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON r.refid=d.userid WHERE r.userid=%s AND r.level=%s ORDER BY r.refid ASC", - array(bigintval($uid), bigintval($level)), __FILE__, __LINE__); + array(bigintval($uid), bigintval($level)), __FUNCTION__, __LINE__); // Are there some entries? if (SQL_NUMROWS($result) > 0) { @@ -309,7 +309,7 @@ function GET_USER_REF_ENTRY ($id) { // Get entry from database $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE id=%s AND userid=%s LIMIT 1", - array($id, $GLOBALS['userid']), __FILE__, __LINE__); + array($id, $GLOBALS['userid']), __FUNCTION__, __LINE__); // Is there an entry? if (SQL_NUMROWS($result) == 1) { @@ -361,7 +361,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) { // Update entry SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET refback='%s' WHERE id=%s AND userid=%s LIMIT 1", - array($percents, $id, $GLOBALS['userid']), __FILE__, __LINE__); + array($percents, $id, $GLOBALS['userid']), __FUNCTION__, __LINE__); // Entry updated? if (SQL_AFFECTEDROWS() < 1) { diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 5f82f17270..f3af140f19 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { // function REGISTER_FILL_MUST_CONSTANTS() { - $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FUNCTION__, __LINE__); while (list($name, $required) = SQL_FETCHROW($result)) { $value = ""; if ($required == "Y") $value = "
     (*)
    "; @@ -63,7 +63,7 @@ function REGISTER_CHECK_REQUIRED_FIELDS(&$array) $ret = false; foreach ($array as $key => $value) { - $result = SQL_QUERY("SELECT field_required FROM `{!_MYSQL_PREFIX!}_must_register` WHERE field_name='".$key."' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT field_required FROM `{!_MYSQL_PREFIX!}_must_register` WHERE field_name='".$key."' LIMIT 1", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // "Must-line" found @@ -87,7 +87,7 @@ function REGISTER_CHECK_REQUIRED_FIELDS(&$array) // function REGISTER_OUTPUT_REQUIRE_CHECK(&$array) { - $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FUNCTION__, __LINE__); while (list($name, $required) = SQL_FETCHROW($result)) { if (($array[$name] == "!") && ($required == "Y")) { @@ -111,13 +111,18 @@ function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) { // Admins are allowed to see every category... if (IS_ADMIN()) $AND = ""; - $result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List alle visible modules (or all to the admin) $SW = 2; $OUT .= "\n"; while (list($id, $cat, $visible) = SQL_FETCHROW($result)) { - if (!REQUEST_ISSET_POST(('cat', $id))) REQUEST_POST('cat', $id) = ""; + // Is the array element not set? + if (!REQUEST_ISSET_POST('cat', $id)) { + // Then set it + REQUEST_SET_POST(array('cat', $id), ""); + } // END - if + // Prepare array for the template $content = array( 'sw' => $SW, @@ -127,7 +132,7 @@ function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) { 'id' => $id, ); - if ((REQUEST_POST('cat', $id) == "Y") || ((getConfig('register_default') == "Y") && (!REQUEST_ISSET_POST(('cat', $id))))) { + if ((REQUEST_POST('cat', $id) == "Y") || ((getConfig('register_default') == "Y") && (!REQUEST_ISSET_POST('cat', $id)))) { $content['def_y'] = " checked=\"checked\""; } else { $content['def_n'] = " checked=\"checked\""; diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 5a24877ff0..5d99a7d5a5 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -70,7 +70,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S } else { // Do we want to add a new sponsor or update his data? $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1", - array($POST['email']), __FILE__, __LINE__); + array($POST['email']), __FUNCTION__, __LINE__); // Is a sponsor alread in the db? if (SQL_NUMROWS($result) == 1) { @@ -188,7 +188,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S if (!empty($SQL)) { // Run SQL command - $result = SQL_QUERY_ESC($SQL, $DATA['values'], __FILE__, __LINE__); + $result = SQL_QUERY_ESC($SQL, $DATA['values'], __FUNCTION__, __LINE__); } // Output message @@ -251,7 +251,7 @@ function IS_SPONSOR () { // Check cookies against database records... $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' AND password='%s' AND `status`='CONFIRMED' LIMIT 1", - array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); + array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // All is fine $ret = true; @@ -274,7 +274,7 @@ function GENERATE_SPONSOR_MENU($current) // Load main menu entries $result_main = SQL_QUERY("SELECT action, title FROM `{!_MYSQL_PREFIX!}_sponsor_menu` WHERE (what='' OR `what` IS NULL) ".$WHERE." -ORDER BY `sort`", __FILE__, __LINE__); +ORDER BY `sort`", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // Load every menu and it's sub menus @@ -283,7 +283,7 @@ ORDER BY `sort`", __FILE__, __LINE__); // Load sub menus $result_sub = SQL_QUERY_ESC("SELECT what, title FROM `{!_MYSQL_PREFIX!}_sponsor_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$WHERE." -ORDER BY `sort`", array($action), __FILE__, __LINE__); +ORDER BY `sort`", array($action), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_sub) > 0) { // Load sub menus @@ -361,7 +361,7 @@ function UPDATE_SPONSOR_LOGIN () { SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET last_online=UNIX_TIMESTAMP() WHERE id='%s' AND password='%s' LIMIT 1", - array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); + array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FUNCTION__, __LINE__); // This update went fine? $login = (SQL_AFFECTEDROWS() == 1); @@ -472,7 +472,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { if (SQL_AFFECTEDROWS() == 1) { if (!empty($templ) && !empty($subj)) { // Run SQL command and check for success - $result = SQL_QUERY_ESC($SQL, $DATA, __FILE__, __LINE__); + $result = SQL_QUERY_ESC($SQL, $DATA, __FUNCTION__, __LINE__); // Add all data to content global $DATA; diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index cab4fb587d..a2c33f9a6f 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -243,7 +243,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) { } else { // Log invalid request DEBUG_LOG(__FUNCTION__, __LINE__, " action={$formData['action']},id={$formData['id']},function={$functionName}"); - addFatalMessage("Invalid member action! action=%s,id=%s,function=%s", array($formData['action'], $formData['id'], $functionName)); + addFatalMessage(__FUNCTION__, __LINE__, "Invalid member action! action=%s,id=%s,function=%s", array($formData['action'], $formData['id'], $functionName)); } // Return status @@ -253,7 +253,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) { function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) { // Search for the requested action/status combination in database $result = SQL_QUERY_ESC("SELECT new_status FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE `action`='%s' AND `status`='%s' LIMIT 1", - array($action, $status), __FILE__, __LINE__); + array($action, $status), __FUNCTION__, __LINE__); // Is the entry there? $isValid = (SQL_NUMROWS($result) == 1); @@ -401,7 +401,7 @@ function SURFBAR_MEMBER_EXECUTE_ACTION ($action, $urlData) { } // END - if } else { // Not found! - addFatalMessage(MEMBER_SURFBAR_EXECUTE_ACTION_404, $functionName); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('MEMBER_SURFBAR_EXECUTE_ACTION_404'), $functionName); } // Return status @@ -421,7 +421,7 @@ function SURFBAR_MEMBER_EXECUTE_EDIT_ACTION ($urlData) { //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) { // Run the query SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE id=%s AND `status`='%s' LIMIT 1", - array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FILE__, __LINE__); + array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__); // All fine $status = true; @@ -492,7 +492,7 @@ function SURFBAR_HANDLE_LOW_POINTS () { // Update last notified SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET surfbar_low_notified=NOW() WHERE userid=%s LIMIT 1", - array($uid), __FILE__, __LINE__); + array($uid), __FUNCTION__, __LINE__); } // END - if } // END - foreach } @@ -537,7 +537,7 @@ FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE %s='%s'".$add." ORDER BY %s %s %s", - array($column, $searchTerm, $order, $sort, $limit), __FILE__, __LINE__); + array($column, $searchTerm, $order, $sort, $limit), __FUNCTION__, __LINE__); // Is there at least one record? if (SQL_NUMROWS($result) > 0) { @@ -620,7 +620,7 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { $urlData['limit'], $urlData['limit'], $urlData['reload'] - ), __FILE__, __LINE__ + ), __FUNCTION__, __LINE__ ); // Return insert id @@ -804,7 +804,7 @@ INNER JOIN `{!_MYSQL_PREFIX!}_surfbar_urls` AS u ON u.id=l.url_id WHERE l.userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND (((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR u.fixed_reload = 0) LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__ + array($GLOBALS['userid']), __FUNCTION__, __LINE__ ); // Fetch row @@ -844,7 +844,7 @@ function SURFBAR_GET_TOTAL_URLS ($status="ACTIVE", $excludeUserId=0) { $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'", - array($status), __FILE__, __LINE__ + array($status), __FUNCTION__, __LINE__ ); // Fetch row @@ -895,7 +895,7 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") { FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE userid=%s".$ADD." LIMIT %s", - array($uid, getConfig('surfbar_max_order')), __FILE__, __LINE__ + array($uid, getConfig('surfbar_max_order')), __FUNCTION__, __LINE__ ); // Fetch row @@ -966,11 +966,11 @@ function SURFBAR_LOCKDOWN_ID ($urlId) { ///* DEBUG: */ return; // Just add it to the database SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_locks` (userid, url_id) VALUES (%s, %s)", - array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__); + array($GLOBALS['userid'], bigintval($urlId)), __FUNCTION__, __LINE__); // Remove the salt from database SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_surfbar_salts` WHERE url_id=%s AND userid=%s LIMIT 1", - array(bigintval($urlId), $GLOBALS['userid']), __FILE__, __LINE__); + array(bigintval($urlId), $GLOBALS['userid']), __FUNCTION__, __LINE__); } // Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf" function SURFBAR_PAY_POINTS () { @@ -1000,17 +1000,17 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () { // Update URL stats SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET views_total=views_total+1".$ADD." WHERE id=%s LIMIT 1", - array(SURFBAR_GET_ID()), __FILE__, __LINE__); + array(SURFBAR_GET_ID()), __FUNCTION__, __LINE__); // Update the stats entry SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_stats` SET count=count+1 WHERE userid=%s AND url_id=%s LIMIT 1", - array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__); + array($GLOBALS['userid'], SURFBAR_GET_ID()), __FUNCTION__, __LINE__); // Was that update okay? if (SQL_AFFECTEDROWS() < 1) { // No, then insert entry SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_stats` (userid,url_id,count) VALUES (%s,%s,1)", - array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__); + array($GLOBALS['userid'], SURFBAR_GET_ID()), __FUNCTION__, __LINE__); } // END - if // Update total/daily/weekly/monthly counter @@ -1029,7 +1029,7 @@ function SURFBAR_UPDATE_SALT_STATS () { // Simply store the salt from cache away in database... SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_salts` SET last_salt='%s' WHERE url_id=%s AND userid=%s LIMIT 1", - array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), $GLOBALS['userid']), __FILE__, __LINE__); + array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), $GLOBALS['userid']), __FUNCTION__, __LINE__); // Debug message //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".$GLOBALS['userid']."", false); @@ -1038,7 +1038,7 @@ function SURFBAR_UPDATE_SALT_STATS () { if (SQL_AFFECTEDROWS() < 1) { // Insert missing entry! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_salts` (url_id,userid,last_salt) VALUES (%s, %s, '%s')", - array(SURFBAR_GET_ID(), $GLOBALS['userid'], SURFBAR_GET_SALT()), __FILE__, __LINE__); + array(SURFBAR_GET_ID(), $GLOBALS['userid'], SURFBAR_GET_SALT()), __FUNCTION__, __LINE__); } // END - if // Debug message @@ -1056,7 +1056,7 @@ FROM `{!_MYSQL_PREFIX!}_surfbar_locks` WHERE userid=%s AND url_id=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(last_surfed) ORDER BY last_surfed ASC LIMIT 1", - array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__ + array($GLOBALS['userid'], bigintval($urlId)), __FUNCTION__, __LINE__ ); // Fetch counter @@ -1093,7 +1093,7 @@ ON u.userid=d.userid WHERE u.userid NOT IN (%s,0) AND u.`status`='ACTIVE' GROUP BY u.userid ORDER BY u.userid ASC", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FUNCTION__, __LINE__); } else { // Get all userid $result = SQL_QUERY("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified @@ -1102,7 +1102,7 @@ INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON u.userid=d.userid WHERE u.`status`='ACTIVE' GROUP BY u.userid -ORDER BY u.userid ASC", __FILE__, __LINE__); +ORDER BY u.userid ASC", __FUNCTION__, __LINE__); } // Load all userid @@ -1137,7 +1137,7 @@ function SURFBAR_DETERMINE_TOTAL_ONLINE () { FROM `{!_MYSQL_PREFIX!}_surfbar_stats` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) <= %s GROUP BY userid", - array(getConfig('online_timeout')), __FILE__, __LINE__); + array(getConfig('online_timeout')), __FUNCTION__, __LINE__); // Fetch count $cnt = SQL_NUMROWS($result); @@ -1198,7 +1198,7 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) // Update the status now // ---------- Comment out for debugging/developing member actions! --------- //SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET `status`='%s' WHERE id=%s LIMIT 1", - // array($newStatus, bigintval($urlId)), __FILE__, __LINE__); + // array($newStatus, bigintval($urlId)), __FUNCTION__, __LINE__); // ---------- Comment out for debugging/developing member actions! --------- // Was that fine? @@ -1316,7 +1316,7 @@ WHERE userid=%s ORDER BY id ASC", array($GLOBALS['userid']), - __FILE__, __LINE__); + __FUNCTION__, __LINE__); // Load all entries while (list($lid, $url, $last) = SQL_FETCHROW($result)) { @@ -1364,7 +1364,7 @@ ON sbu.id=sbs.url_id LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l ON sbu.id=l.url_id WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.`status`='ACTIVE'".$ADD." -GROUP BY sbu.id", __FILE__, __LINE__); +GROUP BY sbu.id", __FUNCTION__, __LINE__); // Log last query //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".getConfig('db_last_query')."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false); @@ -1388,7 +1388,7 @@ function SURFBAR_GET_USER_URLS () { FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u WHERE u.userid=%s AND u.status != 'DELETED' ORDER BY u.id ASC", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FUNCTION__, __LINE__); // Are there entries? if (SQL_NUMROWS($result) > 0) { @@ -1412,7 +1412,7 @@ function SURFBAR_GET_ACTION_ARRAY ($status) { // Get all assigned actions $result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE `status`='%s' ORDER BY `id` ASC", - array($status), __FILE__, __LINE__); + array($status), __FUNCTION__, __LINE__); // Some entries there? if (SQL_NUMROWS($result) > 0) { @@ -1490,7 +1490,7 @@ WHERE sbu.userid NOT IN (".implode(",", $UIDs['uid']).") AND sbu.`status`='ACTIV GROUP BY sbu.id ORDER BY l.last_surfed ASC, sbu.id ASC LIMIT %s,1", - array($randNum), __FILE__, __LINE__ + array($randNum), __FUNCTION__, __LINE__ ); } else { // Get data from specified id number @@ -1502,7 +1502,7 @@ LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l ON sbu.id=l.url_id WHERE sbu.userid != %s AND sbu.`status`='ACTIVE' AND sbu.id=%s AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) LIMIT 1", - array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__ + array($GLOBALS['userid'], bigintval($urlId)), __FUNCTION__, __LINE__ ); } diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index cfd0277d8d..92bd5e2b87 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -540,7 +540,7 @@ function TASK_CREATE_EXTRA_ROWS ($SQLs, $WHATs, $DESCRs, $TITLEs) { $OUT = ""; $SW = 2; $MAX = sizeof($SQLs) - 1; foreach ($SQLs as $key => $sql) { // Run SQL command, get line numbers and free memory - $result = SQL_QUERY($sql, __FILE__, __LINE__); + $result = SQL_QUERY($sql, __FUNCTION__, __LINE__); // Get rows $value = SQL_NUMROWS($result); diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 58c866dc7f..e97d76721c 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -100,7 +100,7 @@ function THEME_GET_VERSION ($name) { } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Load version from database $result = SQL_QUERY_ESC("SELECT theme_ver FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1", - array($name), __FILE__, __LINE__); + array($name), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -143,7 +143,7 @@ function THEME_IS_ACTIVE ($name) { } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not $result = SQL_QUERY_ESC("SELECT theme_active FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", - array($name), __FILE__, __LINE__); + array($name), __FUNCTION__, __LINE__); // Is the theme active and installed? $active = (SQL_NUMROWS($result) == 1); @@ -177,7 +177,7 @@ function GET_CURR_THEME_NAME () { } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not $result = SQL_QUERY_ESC("SELECT theme_name FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", - array($name), __FILE__, __LINE__); + array($name), __FUNCTION__, __LINE__); // Load theme name list($name) = SQL_FETCHROW($result); diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php index 48fccd8de3..53b8937e71 100644 --- a/inc/libs/transfer_functions.php +++ b/inc/libs/transfer_functions.php @@ -40,31 +40,31 @@ if (!defined('__SECURITY')) { // function TRANSFER_AUTPPURGE($max, $age) { // First get total in-going lines - $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_in` ORDER BY `id`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_in` ORDER BY `id`", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > $max) { // Update overdue transfers $remove = SQL_NUMROWS($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_in` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FILE__, __LINE__); + $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_in` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FUNCTION__, __LINE__); } // Second get total out-going lines - $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY `id`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY `id`", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > $max) { // Update overdue transfers $remove = SQL_NUMROWS($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_out` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FILE__, __LINE__); + $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_out` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FUNCTION__, __LINE__); } // Remove old in-going transfers - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FUNCTION__, __LINE__); $REMOVE = SQL_AFFECTEDROWS(); // Remove old out-going transfers - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FUNCTION__, __LINE__); $REMOVE += SQL_AFFECTEDROWS(); // Only send email to admin(s) when we have removed entries diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index b0de254c1e..5fbf397828 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -200,7 +200,7 @@ function USER_CREATE_EMAIL_LINK($email, $mod="admin") { $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email='%s'".$locked." LIMIT 1", - array($email), __FILE__, __LINE__); + array($email), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load userid list($uid) = SQL_FETCHROW($result); @@ -233,7 +233,7 @@ function SELECT_RANDOM_REFID () { // Look for random user $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1", - array(getConfig('user_min_confirmed'), $randNum), __FILE__, __LINE__); + array(getConfig('user_min_confirmed'), $randNum), __FUNCTION__, __LINE__); // Do we have one entry there? if (SQL_NUMROWS($result) == 1) { @@ -242,7 +242,7 @@ function SELECT_RANDOM_REFID () { // Reset this user's counter SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `rand_confirmed`=0 WHERE userid=%s LIMIT 1", - array($refid), __FILE__, __LINE__); + array($refid), __FUNCTION__, __LINE__); } // END - if // Free result @@ -267,13 +267,13 @@ function USER_DO_LOGIN ($uid, $passwd) { if ((EXT_IS_ACTIVE("nickname")) && (NICKNAME_PROBE_ON_USERID($uid))) { // Nickname entered $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$lastOnline." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND `status`='CONFIRMED' LIMIT 1", - array($uid), __FILE__, __LINE__); + array($uid), __FUNCTION__, __LINE__); list($uid2, $password, $online, $login) = SQL_FETCHROW($result); if (!empty($uid2)) $uid = bigintval($uid2); } else { // Direct userid entered $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$lastOnline." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1", - array($uid, $hash), __FILE__, __LINE__); + array($uid, $hash), __FUNCTION__, __LINE__); list($uid2, $password, $online, $login) = SQL_FETCHROW($result); } @@ -300,7 +300,7 @@ function USER_DO_LOGIN ($uid, $passwd) { // ... and update database SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1", - array($hash, $uid), __FILE__, __LINE__); + array($hash, $uid), __FUNCTION__, __LINE__); // No login bonus by default // @TODO Make this filter working: $ADDON = RUN_FILTER('post_login_update', array('login' => $login, 'online' => $online)); @@ -334,7 +334,7 @@ function USER_DO_LOGIN ($uid, $passwd) { if ((set_session('userid', $uid )) && (set_session('u_hash', $hash))) { // Update database records SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET total_logins=total_logins+1".$ADD." WHERE userid=%s LIMIT 1", - array($uid), __FILE__, __LINE__); + array($uid), __FUNCTION__, __LINE__); if (SQL_AFFECTEDROWS() == 1) { // Procedure to checking for login data if (($BONUS) && (EXT_IS_ACTIVE("bonus"))) { @@ -355,7 +355,7 @@ function USER_DO_LOGIN ($uid, $passwd) { } elseif (GET_EXT_VERSION("sql_patches") >= "0.6.1") { // Update failture counter SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET login_failures=login_failures+1,last_failure=NOW() WHERE userid=%s LIMIT 1", - array($uid), __FILE__, __LINE__); + array($uid), __FUNCTION__, __LINE__); // Wrong password! $URL = "modules.php?module=index&what=login&login=".constant('CODE_WRONG_PASS'); @@ -364,7 +364,7 @@ function USER_DO_LOGIN ($uid, $passwd) { // Other account status? // @TODO Can this query be merged with above query? $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array($uid), __FILE__, __LINE__); + array($uid), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -402,15 +402,15 @@ function USER_DO_NEW_PASSWORD ($email, $uid) { if ((EXT_IS_ACTIVE("nickname")) && (NICKNAME_PROBE_ON_USERID($uid))) { // Nickname entered $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' OR email='%s' LIMIT 1", - array($uid, $email), __FILE__, __LINE__); + array($uid, $email), __FUNCTION__, __LINE__); } elseif (($uid > 0) && (empty($email))) { // Direct userid entered $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); } elseif (!empty($email)) { // Email entered $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1", - array($email), __FILE__, __LINE__); + array($email), __FUNCTION__, __LINE__); } else { // Userid not set! DEBUG_LOG(__FUNCTION__, __LINE__, "Userid is not set! BUG!"); @@ -426,7 +426,7 @@ function USER_DO_NEW_PASSWORD ($email, $uid) { // Ooppps, this was missing! ;-) We should update the database... $NEW_PASS = GEN_PASS(); SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1", - array(generateHash($NEW_PASS), $uid), __FILE__, __LINE__); + array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__); // Prepare data and message for email $msg = LOAD_EMAIL_TEMPLATE("new-pass", array('new_pass' => $NEW_PASS), $uid); diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index ba46ef374f..d33fd89875 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -322,7 +322,7 @@ function WERNIS_TRANSFER_STATUS ($status) { function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", $status = "") { // Register this wernis movement SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')", - array($GLOBALS['userid'], bigintval($wdsId), bigintval($amount), $type, $message, $status), __FILE__, __LINE__); + array($GLOBALS['userid'], bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__); } // Take fees and factor diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index e167b07b95..41ea321a7f 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -241,7 +241,7 @@ function YOOMEDIA_EXCLUDE_MAIL ($data, $mode) { // Add the entry SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_yoomedia_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')", - array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); + array($mode, bigintval($data['id']), bigintval($data['reload'])), __FUNCTION__, __LINE__); } // END - if } @@ -252,7 +252,7 @@ function YOOMEDIA_UNLIST_MAIL ($data, $mode) { // Add the entry SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", - array($mode, bigintval($data['id'])), __FILE__, __LINE__); + array($mode, bigintval($data['id'])), __FUNCTION__, __LINE__); } // "Translates" the index number into an assosiative value @@ -302,7 +302,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) { // Query database $result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", - array($type, bigintval($id)), __FILE__, __LINE__); + array($type, bigintval($id)), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -313,7 +313,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) { if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) { // Remove entry SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE id=%s LIMIT 1", - array($id), __FILE__, __LINE__); + array($id), __FUNCTION__, __LINE__); } else { // Dont' sent again this mail $reloaded = $time; @@ -336,7 +336,7 @@ function YOOMEDIA_RELOAD_LOCK ($data, $mode) { // Add the entry SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_yoomedia_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)", - array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); + array($mode, bigintval($data['id']), bigintval($data['reload'])), __FUNCTION__, __LINE__); } // END - if } diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 198995ae10..18156e298c 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -37,12 +37,6 @@ if (!defined('__SECURITY')) { require($INC); } -// Login is default -if ((empty($GLOBALS['action'])) && (CHECK_MODULE($GLOBALS['module']) == "admin_only")) { - // Redirect to right URL - LOAD_URL("modules.php?module=admin&action=login"); -} // END - if - // Load include file LOAD_INC_ONCE("inc/modules/admin/admin-inc.php"); @@ -71,8 +65,8 @@ if (!isAdminRegistered()) { switch ($ret) { case "done": - changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0); - if (!constant('_FATAL')) { + $done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0); + if ($done === true) { // Registering is done LOAD_URL("modules.php?module=admin&action=login®ister=done"); } else { @@ -338,7 +332,7 @@ if (!isAdminRegistered()) { LOAD_TEMPLATE("admin_settings_saved", false, "
    {--ADMIN_LOGOUT_FAILED--}
    "); // Add fatal message - addFatalMessage(getMessage('CANNOT_UNREG_SESS')); + addFatalMessage(__FILE__, __LINE__, getMessage('CANNOT_UNREG_SESS')); } } else { // Maybe an Admin want's to login? @@ -375,13 +369,13 @@ if (!isAdminRegistered()) { case "404": // Administrator login not found REQUEST_SET_POST('ok', $ret); destroyAdminSession(); - addFatalMessage(getMessage('ADMIN_NOT_FOUND')); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_NOT_FOUND')); break; case "pass": // Wrong password REQUEST_SET_POST('ok', $ret); destroyAdminSession(); - addFatalMessage(getMessage('WRONG_PASS')); + addFatalMessage(__FILE__, __LINE__, getMessage('WRONG_PASS')); break; default: // Others will be logged diff --git a/inc/modules/admin/action- b/inc/modules/admin/action- index cdaccba72d..f880409ae9 100644 --- a/inc/modules/admin/action- +++ b/inc/modules/admin/action- @@ -46,7 +46,7 @@ if (FILE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); + addFatalMessage(__FILE__, __LINE__, ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2); } // diff --git a/inc/modules/admin/action-admins.php b/inc/modules/admin/action-admins.php index 2187e4b3b9..f9ff0a04ee 100644 --- a/inc/modules/admin/action-admins.php +++ b/inc/modules/admin/action-admins.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-bank.php b/inc/modules/admin/action-bank.php index 1a5574468f..5dc321b9bf 100644 --- a/inc/modules/admin/action-bank.php +++ b/inc/modules/admin/action-bank.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-country.php b/inc/modules/admin/action-country.php index c1d9e00825..021ff5e3fb 100644 --- a/inc/modules/admin/action-country.php +++ b/inc/modules/admin/action-country.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-doubler.php b/inc/modules/admin/action-doubler.php index 6d06785ff6..e46963e93b 100644 --- a/inc/modules/admin/action-doubler.php +++ b/inc/modules/admin/action-doubler.php @@ -47,7 +47,7 @@ if (INCLUDE_READABLE($INC)) { LOAD_INC($INC); } else { // "what file" not found - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-email.php b/inc/modules/admin/action-email.php index cc1d9fc1d2..14319eff01 100644 --- a/inc/modules/admin/action-email.php +++ b/inc/modules/admin/action-email.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-holiday.php b/inc/modules/admin/action-holiday.php index 5c51869d83..ba61268cf7 100644 --- a/inc/modules/admin/action-holiday.php +++ b/inc/modules/admin/action-holiday.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-login.php b/inc/modules/admin/action-login.php index f83e30f781..6d5e7526be 100644 --- a/inc/modules/admin/action-login.php +++ b/inc/modules/admin/action-login.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-menu.php b/inc/modules/admin/action-menu.php index a794d55c67..80157d237c 100644 --- a/inc/modules/admin/action-menu.php +++ b/inc/modules/admin/action-menu.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-misc.php b/inc/modules/admin/action-misc.php index 3c263d3491..6862a81cfa 100644 --- a/inc/modules/admin/action-misc.php +++ b/inc/modules/admin/action-misc.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-mods.php b/inc/modules/admin/action-mods.php index ba7354036a..c40409e279 100644 --- a/inc/modules/admin/action-mods.php +++ b/inc/modules/admin/action-mods.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-newsletter.php b/inc/modules/admin/action-newsletter.php index e1338dae6c..bb78a246a0 100644 --- a/inc/modules/admin/action-newsletter.php +++ b/inc/modules/admin/action-newsletter.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-payouts.php b/inc/modules/admin/action-payouts.php index ccd1a7f505..c6c6d532e4 100644 --- a/inc/modules/admin/action-payouts.php +++ b/inc/modules/admin/action-payouts.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-primera.php b/inc/modules/admin/action-primera.php index 8e3189f463..2257e966f4 100644 --- a/inc/modules/admin/action-primera.php +++ b/inc/modules/admin/action-primera.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-rallye.php b/inc/modules/admin/action-rallye.php index 8edbbb8de7..62ecfa2ce8 100644 --- a/inc/modules/admin/action-rallye.php +++ b/inc/modules/admin/action-rallye.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-repair.php b/inc/modules/admin/action-repair.php index ddbe8b17c2..baed5bf298 100644 --- a/inc/modules/admin/action-repair.php +++ b/inc/modules/admin/action-repair.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-setup.php b/inc/modules/admin/action-setup.php index 3a3e189877..7cd97ecf3c 100644 --- a/inc/modules/admin/action-setup.php +++ b/inc/modules/admin/action-setup.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-sponsor.php b/inc/modules/admin/action-sponsor.php index 920011de1a..aca47c54b3 100644 --- a/inc/modules/admin/action-sponsor.php +++ b/inc/modules/admin/action-sponsor.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // ?> diff --git a/inc/modules/admin/action-stats.php b/inc/modules/admin/action-stats.php index 850508f9af..768c8b1944 100644 --- a/inc/modules/admin/action-stats.php +++ b/inc/modules/admin/action-stats.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-surfbar.php b/inc/modules/admin/action-surfbar.php index 603de19805..961f2e6c92 100644 --- a/inc/modules/admin/action-surfbar.php +++ b/inc/modules/admin/action-surfbar.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-task.php b/inc/modules/admin/action-task.php index 98254c531d..a969513207 100644 --- a/inc/modules/admin/action-task.php +++ b/inc/modules/admin/action-task.php @@ -36,7 +36,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("task")) { - addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "task"); + addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "task"); return; } @@ -49,7 +49,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-theme.php b/inc/modules/admin/action-theme.php index 71aef41007..5534ea0fa0 100644 --- a/inc/modules/admin/action-theme.php +++ b/inc/modules/admin/action-theme.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-transfer.php b/inc/modules/admin/action-transfer.php index 4065cb3065..01b2dcd59d 100644 --- a/inc/modules/admin/action-transfer.php +++ b/inc/modules/admin/action-transfer.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-user.php b/inc/modules/admin/action-user.php index d3f352fd6e..567814bfe8 100644 --- a/inc/modules/admin/action-user.php +++ b/inc/modules/admin/action-user.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/action-wernis.php b/inc/modules/admin/action-wernis.php index 9677e2b57c..dc52af7d39 100644 --- a/inc/modules/admin/action-wernis.php +++ b/inc/modules/admin/action-wernis.php @@ -46,7 +46,7 @@ if (INCLUDE_READABLE($INC)) { // Ok, we finally load the admin action module LOAD_INC($INC); } else { - addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']); } // diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 8d98c3d7ea..228fdf5018 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -44,13 +44,13 @@ function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER) { // Lookup the user $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", - array($user), __FILE__, __LINE__); + array($user), __FUNCTION__, __LINE__); // Is the entry there? if (SQL_NUMROWS($result) == 0) { // Ok, let's create the admin login SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins` (login, password, email) VALUES ('%s', '%s', '%s')", - array($user, $md5, $email), __FILE__, __LINE__); + array($user, $md5, $email), __FUNCTION__, __LINE__); $ret = "done"; } // END - if @@ -90,7 +90,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { // Get password from DB $result = SQL_QUERY_ESC("SELECT password".$ADD." FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array($aid), __FILE__, __LINE__); + array($aid), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { @@ -139,11 +139,11 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { // Update password and reset login failures SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s',login_failures=0,last_failure='0000-00-00 00:00:00' WHERE id=%s LIMIT 1", - array($data['password'], $aid), __FILE__, __LINE__); + array($data['password'], $aid), __FUNCTION__, __LINE__); } else { // Update password SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s' WHERE id=%s LIMIT 1", - array($data['password'], $aid), __FILE__, __LINE__); + array($data['password'], $aid), __FUNCTION__, __LINE__); } // Rebuild cache @@ -172,7 +172,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { if (($ret == "pass") && (GET_EXT_VERSION("admins") >= "0.7.0")) { // Update counter SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=login_failures+1,last_failure=NOW() WHERE id=%s LIMIT 1", - array($aid), __FILE__, __LINE__); + array($aid), __FUNCTION__, __LINE__); // Rebuild cache REBUILD_CACHE("admins", "admin"); @@ -189,7 +189,7 @@ function LOGIN_ADMIN ($adminLogin, $passHash) { if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) { // Reset counter on out-dated sql_patches version SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=0,last_failure='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1", - array($adminLogin), __FILE__, __LINE__); + array($adminLogin), __FUNCTION__, __LINE__); // Rebuild cache REBUILD_CACHE("admins", "admin"); @@ -231,7 +231,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) { } // -function ADMIN_DO_ACTION($wht) { +function ADMIN_DO_ACTION ($wht) { global $DATA; //* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*
    \n"; @@ -266,9 +266,8 @@ function ADMIN_DO_ACTION($wht) { // Check if action/what pair is valid $result_action = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR `what` IS NULL) AND '%s'='overview')) -LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); +LIMIT 1", array($act, $wht, $wht), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_action) == 1) { - // Is valid but does the inlcude file exists? $INC = sprintf("inc/modules/admin/action-%s.php", $act); if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true)) { @@ -277,16 +276,16 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); } elseif (__ACL_ALLOW == false) { // Access denied LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED')); - addFatalMessage(getMessage('ADMIN_ACCESS_DENIED')); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACCESS_DENIED')); } else { // Include file not found! :-( LOAD_TEMPLATE("admin_menu_failed", false, sprintf(getMessage('ADMIN_ACTION_404'), $act)); - addFatalMessage(getMessage('ADMIN_ACTION_404'), $act); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACTION_404'), $act); } } else { // Invalid action/what pair found! LOAD_TEMPLATE("admin_menu_failed", false, sprintf(getMessage('ADMIN_ACTION_INVALID'), $act."/".$wht)); - addFatalMessage(getMessage('ADMIN_ACTION_INVALID'), $act."/".$wht); + addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACTION_INVALID'), $act."/".$wht); } // Free memory @@ -330,7 +329,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } // END - if // Build main menu - $result_main = SQL_QUERY("SELECT action, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`, id DESC", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT action, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`, id DESC", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { $OUT = "
    \n"; @@ -371,7 +370,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { $OUT .= "\n"; $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC", - array($menu), __FILE__, __LINE__); + array($menu), __FUNCTION__, __LINE__); if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu)) { $GLOBALS['menu']['description'] = array(); @@ -484,7 +483,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $none=false, $field="userid") { // Output selection form with all confirmed user accounts listed - $result = SQL_QUERY("SELECT userid, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` ORDER BY userid", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT userid, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` ORDER BY userid", __FUNCTION__, __LINE__); $OUT = ""; // USe this only for adding points (e.g. adding refs really makes no sence ;-) ) @@ -519,7 +518,7 @@ function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") { $wht = "`what` != ''"; if ($MODE == "action") $wht = "(what='' OR `what` IS NULL) AND action !='login'"; $result = SQL_QUERY_ESC("SELECT %s, title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$wht." ORDER BY `sort`", - array($MODE), __FILE__, __LINE__); + array($MODE), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load menu as selection $OUT = "
     
    "); @@ -381,7 +381,7 @@ function ADD_MENU ($MODE, $act, $wht) { LOAD_TEMPLATE($MODE."_menu_title", false, $content); $result_sub = SQL_QUERY_ESC("SELECT title, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`", - array($MODE, $main_action), __FILE__, __LINE__); + array($MODE, $main_action), __FUNCTION__, __LINE__); $ctl = SQL_NUMROWS($result_sub); if ($ctl > 0) { $cnt=0; @@ -490,7 +490,7 @@ function IS_ADMIN ($admin="") { } elseif ((!empty($admin)) && ((!EXT_IS_ACTIVE("cache"))) || (!isset($GLOBALS['cache_array']['admins']['password'][$admin]))) { // Search for admin $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY password FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", - array($admin), __FILE__, __LINE__); + array($admin), __FUNCTION__, __LINE__); // Is he admin? $passDB = ""; @@ -526,7 +526,7 @@ function ADD_MAX_RECEIVE_LIST ($MODE, $default = "", $return = false) { switch ($MODE) { case "guest": // Guests (in the registration form) are not allowed to select 0 mails per day. - $result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value > 0 ORDER BY value", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value > 0 ORDER BY value", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { $OUT = ""; while (list($value, $comment) = SQL_FETCHROW($result)) { @@ -549,7 +549,7 @@ function ADD_MAX_RECEIVE_LIST ($MODE, $default = "", $return = false) { case "member": // Members are allowed to set to zero mails per day (we will change this soon!) - $result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` ORDER BY value", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` ORDER BY value", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { $OUT = ""; while (list($value, $comment) = SQL_FETCHROW($result)) { @@ -582,7 +582,7 @@ function ADD_MAX_RECEIVE_LIST ($MODE, $default = "", $return = false) { function SEARCH_EMAIL_USERTAB ($email) { // Query the database $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email LIKE '{PER}%s{PER}' LIMIT 1", - array($email), __FILE__, __LINE__); + array($email), __FUNCTION__, __LINE__); // Is the email there? $ret = (SQL_NUMROWS($result) == 1); @@ -614,7 +614,7 @@ function IS_MEMBER () { if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash'))) { // Cookies are set with values, but are they valid? $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data from cookies list($password, $status, $mod, $onl) = SQL_FETCHROW($result); @@ -681,19 +681,19 @@ function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) { if (($MODE != "admin") && ($UPDATE === true)) { // Update guest or member menu $SQL = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$ADD." LIMIT 1", - array($MODE, $act, $wht), __FILE__, __LINE__, false); + array($MODE, $act, $wht), __FUNCTION__, __LINE__, false); } elseif (($wht != "overview") && (!empty($wht))) { // Other actions $SQL = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$ADD." ORDER BY action DESC LIMIT 1", - array($MODE, $act, $wht), __FILE__, __LINE__, false); + array($MODE, $act, $wht), __FUNCTION__, __LINE__, false); } else { // Admin login overview $SQL = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND (what='' OR `what` IS NULL)".$ADD." ORDER BY action DESC LIMIT 1", - array($MODE, $act), __FILE__, __LINE__, false); + array($MODE, $act), __FUNCTION__, __LINE__, false); } // Run SQL command - $result = SQL_QUERY($SQL, __FILE__, __LINE__); + $result = SQL_QUERY($SQL, __FUNCTION__, __LINE__); if ($UPDATE === true) { // Check updated/affected rows $ret = (SQL_AFFECTEDROWS() == 1); @@ -725,7 +725,7 @@ function GET_MOD_DESCR($MODE, $wht, $column="what") { // Look for title $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1", - array($MODE, $column, $wht), __FILE__, __LINE__); + array($MODE, $column, $wht), __FUNCTION__, __LINE__); // Is there an entry? if (SQL_NUMROWS($result) == 1) { @@ -743,7 +743,7 @@ function SEND_MODE_MAILS($mod, $modes) { // Load hash $result_main = SQL_QUERY_ESC("SELECT password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_main) == 1) { // Load hash from database list($hashDB) = SQL_FETCHROW($result_main); @@ -756,7 +756,7 @@ function SEND_MODE_MAILS($mod, $modes) { if (($hash == get_session('u_hash')) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) { // Load user's data $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND password='%s' LIMIT 1", - array($GLOBALS['userid'], $hashDB), __FILE__, __LINE__); + array($GLOBALS['userid'], $hashDB), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load the data $DATA = SQL_FETCHROW($result); @@ -860,14 +860,16 @@ function SEND_MODE_MAILS($mod, $modes) { // Load template LOAD_TEMPLATE("admin_settings_saved", false, $content); } + // Update module counter function COUNT_MODULE($mod) { if ($mod != "css") { // Do count all other modules but not accesses on CSS file css.php! SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET clicks=clicks+1 WHERE module='%s' LIMIT 1", - array($mod), __FILE__, __LINE__); + array($mod), __FUNCTION__, __LINE__); } // END - if } + // Get action value from mode (admin/guest/member) and what-value function GET_ACTION ($MODE, &$wht) { // Init status @@ -907,7 +909,7 @@ function GET_ACTION ($MODE, &$wht) { // Load from database $result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `what`='%s' LIMIT 1", - array($MODE, $wht), __FILE__, __LINE__); + array($MODE, $wht), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load action value and pray that this one is the right you want... ;-) list($ret) = SQL_FETCHROW($result); @@ -920,7 +922,7 @@ function GET_ACTION ($MODE, &$wht) { if (isAdminRegistered()) { // Redirect // @TODO Why does this lead into an endless loop but we still need it??? - LOAD_URL("admin.php"); + // Commented out LOAD_URL("admin.php"); } // END - if } @@ -940,7 +942,7 @@ function GET_CATEGORY ($cid) { } elseif ($cid > 0) { // Lookup the category in database $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", - array(bigintval($cid)), __FILE__, __LINE__); + array(bigintval($cid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Category found... :-) list($ret) = SQL_FETCHROW($result); @@ -961,7 +963,7 @@ function GET_PAYMENT ($pid, $full=false) { // Load payment data $result = SQL_QUERY_ESC("SELECT mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1", - array(bigintval($pid)), __FILE__, __LINE__); + array(bigintval($pid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Payment type found... :-) if (!$full) { @@ -985,7 +987,7 @@ function GET_PAYMENT ($pid, $full=false) { function GET_PAY_POINTS ($pid, $lookFor = "price") { $ret = "-1"; $result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1", - array($lookFor, $pid), __FILE__, __LINE__); + array($lookFor, $pid), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Payment type found... :-) list($ret) = SQL_FETCHROW($result); @@ -1009,12 +1011,12 @@ function REMOVE_RECEIVER (&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fa $type = "NORMAL"; $rowName = "stats_id"; if ($bonus) { $type = "BONUS"; $rowName = "bonus_id"; } $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1", - array($rowName, $stats_id, bigintval($uid), $type), __FILE__, __LINE__); + array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 0) { // No, so we add one! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_links` (%s, userid, link_type) VALUES ('%s','%s','%s')", - array($rowName, $stats_id, bigintval($uid), $type), __FILE__, __LINE__); + array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__); $ret = "done"; } else @@ -1039,12 +1041,12 @@ function GET_TOTAL_DATA ($search, $tableName, $lookFor, $whereStatement="userid" // Count rows //* DEBUG: */ echo "COUNT!
    \n"; $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add, - array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__); + array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__); } else { // Add all rows //* DEBUG: */ echo "SUM!
    \n"; $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add, - array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__); + array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__); } // Load row @@ -1084,7 +1086,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { } elseif (!EXT_IS_ACTIVE("cache")) { // Get referal data $result_lvl = SQL_QUERY_ESC("SELECT percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1", - array(bigintval($level)), __FILE__, __LINE__); + array(bigintval($level)), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result_lvl) == 1) { @@ -1151,7 +1153,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid // Check user account $result_user = SQL_QUERY_ESC("SELECT refid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}
    \n"; if (SQL_NUMROWS($result_user) == 1) { @@ -1178,14 +1180,14 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid // Update points... SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth='%s' LIMIT 1", - array($data, $data, $ref_points, bigintval($uid), bigintval($GLOBALS['ref_level'])), __FILE__, __LINE__); + array($data, $data, $ref_points, bigintval($uid), bigintval($GLOBALS['ref_level'])), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")
    \n"; // No entry updated? if (SQL_AFFECTEDROWS() < 1) { // First ref in this level! :-) SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid,ref_depth,%s) VALUES (%s,'%s',%s)", - array($data, bigintval($uid), bigintval($GLOBALS['ref_level']), $ref_points), __FILE__, __LINE__); + array($data, bigintval($uid), bigintval($GLOBALS['ref_level']), $ref_points), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")
    \n"; } // END - if @@ -1248,20 +1250,20 @@ function UPDATE_REF_COUNTER ($uid) { // Update counter SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1", - array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FILE__, __LINE__); + array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__); // When no entry was updated then we have to create it here //* DEBUG: */ print __FUNCTION__."(".__LINE__."):updated=".SQL_AFFECTEDROWS()."
    \n"; if (SQL_AFFECTEDROWS() < 1) { // First count! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (userid, level, counter) VALUES (%s,%s,1)", - array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FILE__, __LINE__); + array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid}
    \n"; } // END - if // Check for his referal $result = SQL_QUERY_ESC("SELECT refid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); // Load refid list($ref) = SQL_FETCHROW($result); @@ -1293,7 +1295,7 @@ function UPDATE_REF_COUNTER ($uid) { // OBSOLETE: Sends out mail to all administrators function SEND_ADMIN_EMAILS ($subj, $msg) { // Load all admin email addresses - $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id` ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id` ASC", __FUNCTION__, __LINE__); while (list($email) = SQL_FETCHROW($result)) { // Send the email out SEND_EMAIL($email, $subj, $msg); @@ -1320,7 +1322,7 @@ function GET_ADMIN_ID ($login) { } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", - array($login), __FILE__, __LINE__); + array($login), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { list($ret) = SQL_FETCHROW($result); } // END - if @@ -1357,7 +1359,7 @@ function GET_ADMIN_HASH ($aid) { } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT password FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array($aid), __FILE__, __LINE__); + array($aid), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Fetch data list($ret) = SQL_FETCHROW($result); @@ -1385,7 +1387,7 @@ function GET_ADMIN_LOGIN ($aid) { } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result = SQL_QUERY_ESC("SELECT login FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array(bigintval($aid)), __FILE__, __LINE__); + array(bigintval($aid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Fetch data list($ret) = SQL_FETCHROW($result); @@ -1413,7 +1415,7 @@ function GET_ADMIN_EMAIL ($aid) { } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result_aid = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array(bigintval($aid)), __FILE__, __LINE__); + array(bigintval($aid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_aid) == 1) { // Get data list($ret) = SQL_FETCHROW($result_aid); @@ -1443,7 +1445,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) { } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", - array(bigintval($aid)), __FILE__, __LINE__); + array(bigintval($aid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result_aid) == 1) { // Fetch data list($ret) = SQL_FETCHROW($result_aid); @@ -1479,7 +1481,7 @@ function ADD_OPTION_LINES ($table, $id, $name, $default="", $special="", $where= $ORDER = $name.$SPEC; if ($table == "country") $ORDER = $special; $result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM `{!_MYSQL_PREFIX!}_%s` ".$where." ORDER BY %s", - array($id, $ORDER, $table, $name), __FILE__, __LINE__); + array($id, $ORDER, $table, $name), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option while (list($value, $title, $add) = SQL_FETCHROW($result)) { @@ -1529,14 +1531,14 @@ function DELETE_USER_ACCOUNT($uid, $reason) FROM `{!_MYSQL_PREFIX!}_user_points` AS p LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid -WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); +WHERE p.userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Save his points to add them to the jackpot list($points) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Delete points entries as well - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__); // Update mediadata as well if (GET_EXT_VERSION("mediadata") >= "0.0.4") { @@ -1550,12 +1552,12 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); // Delete category selections as well... SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); // Remove from rallye if found if (EXT_IS_ACTIVE("rallye")) { SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE userid=%s", - array(bigintval($uid)), __FILE__, __LINE__); + array(bigintval($uid)), __FUNCTION__, __LINE__); } // Now a mail to the user and that's all... @@ -1563,7 +1565,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); SEND_EMAIL($uid, getMessage('ADMIN_DEL_ACCOUNT'), $msg); // Ok, delete the account! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__); } // @@ -1582,17 +1584,17 @@ function META_DESCRIPTION ($mod, $wht) { } // function ADD_JACKPOT($points) { - $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Create line - SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok','%s')", array($points), __FILE__, __LINE__); + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok','%s')", array($points), __FUNCTION__, __LINE__); } else { // Free memory SQL_FREERESULT($result); // Update points SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_jackpot` SET points=points+%s WHERE ok='ok' LIMIT 1", - array($points), __FILE__, __LINE__); + array($points), __FUNCTION__, __LINE__); } } // @@ -1601,17 +1603,17 @@ function SUB_JACKPOT($points) { $ret = "-1"; // Get current points - $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Create line - SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok', 0.00000)", __FILE__, __LINE__); + SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok', 0.00000)", __FUNCTION__, __LINE__); } else { // Read points list($jackpot) = SQL_FETCHROW($result); if ($jackpot >= $points) { // Update points when there are enougth points in jackpot SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_jackpot` SET points=points-%s WHERE ok='ok' LIMIT 1", - array($points), __FILE__, __LINE__); + array($points), __FUNCTION__, __LINE__); $ret = $jackpot - $points; } // END - if } @@ -1642,7 +1644,7 @@ function LOAD_CONFIG ($no="0") { } elseif ((!EXT_IS_ACTIVE("cache")) || (!isset($GLOBALS['cache_array']['config'][$no]))) { // Load config from DB $result_config = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_config` WHERE config=%d LIMIT 1", - array(bigintval($no)), __FILE__, __LINE__); + array(bigintval($no)), __FUNCTION__, __LINE__); // Get config from database $CFG_DUMMY = SQL_FETCHARRAY($result_config); @@ -1686,7 +1688,7 @@ function GET_WHAT($modCheck) { function SUB_POINTS ($subject, $uid, $points) { // Add points to used points SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `used_points`=`used_points`+%s WHERE userid=%s LIMIT 1", - array($points, bigintval($uid)), __FILE__, __LINE__); + array($points, bigintval($uid)), __FUNCTION__, __LINE__); // Insert booking record if (EXT_IS_ACTIVE("booking")) { @@ -1752,7 +1754,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") { // Run database update //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "entries={$entries}"); - SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_config` SET ".$entries." WHERE config=0 LIMIT 1", __FILE__, __LINE__); + SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_config` SET ".$entries." WHERE config=0 LIMIT 1", __FUNCTION__, __LINE__); // Get affected rows $affectedRows = SQL_AFFECTEDROWS(); @@ -1784,7 +1786,7 @@ function GET_TOTAL_RECEIVERS ($mode="normal") { $result_all = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND receive_mails > 0 ".PREPARE_SQL_HTML_HOLIDAY($mode), - __FILE__, __LINE__); + __FUNCTION__, __LINE__); // Get num rows $numRows = SQL_NUMROWS($result_all); @@ -1810,7 +1812,7 @@ function ADD_CATEGORY_OPTIONS ($mode) { ); // Get categories - $result = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // ... and begin loading stuff while (list($id, $cat) = SQL_FETCHROW($result)) { @@ -1820,14 +1822,14 @@ function ADD_CATEGORY_OPTIONS ($mode) { // Check which users are in this category $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FUNCTION__, __LINE__); // Start adding all $uid_cnt = 0; while (list($ucat) = SQL_FETCHROW($result_uids)) { $result_ver = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' AND receive_mails > 0".PREPARE_SQL_HTML_HOLIDAY($mode)." LIMIT 1", - array(bigintval($ucat)), __FILE__, __LINE__); + array(bigintval($ucat)), __FUNCTION__, __LINE__); $uid_cnt += SQL_NUMROWS($result_ver); // Free memory @@ -1902,7 +1904,7 @@ VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s $target, bigintval($receiver), $HTML - ), __FILE__, __LINE__); + ), __FUNCTION__, __LINE__); } else { // Add regular mail SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus` @@ -1918,7 +1920,7 @@ VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')", $cat, $target, bigintval($receiver), - ), __FILE__, __LINE__); + ), __FUNCTION__, __LINE__); } } @@ -1955,11 +1957,11 @@ function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") { if ((EXT_IS_ACTIVE("html_mail")) && ($mode == "html")) { // Only include HTML receivers $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s", - array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__); + array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FUNCTION__, __LINE__); } else { // Include all $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s", - array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__); + array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FUNCTION__, __LINE__); } // Entries found? @@ -2002,7 +2004,7 @@ function USER_STATS_GET_TIMESTAMP ($type, $data, $uid = 0) { FROM `{!_MYSQL_PREFIX!}_user_stats_data` WHERE userid=%s AND stats_type='%s' AND stats_data='%s' LIMIT 1", - array(bigintval($uid), $type, $data), __FILE__, __LINE__); + array(bigintval($uid), $type, $data), __FUNCTION__, __LINE__); // Is the entry there? if (SQL_NUMROWS($result) == 1) { @@ -2029,7 +2031,7 @@ function USER_STATS_INSERT_RECORD ($uid, $type, $data) { if ((!USER_STATS_GET_TIMESTAMP($type, $data, $uid)) && (!is_array($data))) { // Then insert it! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')", - array(bigintval($uid), $type, $data), __FILE__, __LINE__); + array(bigintval($uid), $type, $data), __FUNCTION__, __LINE__); } elseif (is_array($data)) { // Invalid data! DEBUG_LOG(__FUNCTION__, __LINE__, " uid={$uid},type={$type},data={".gettype($data).": Invalid statistics data type!"); @@ -2057,7 +2059,7 @@ LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS ud ON ur.refid=ud.userid WHERE ur.userid=%s AND ur.level=%s ORDER BY ur.refid ASC", - array(bigintval($uid), bigintval($level)), __FILE__, __LINE__); + array(bigintval($uid), bigintval($level)), __FUNCTION__, __LINE__); // Are there some entries? if (SQL_NUMROWS($result) > 0) { @@ -2109,7 +2111,7 @@ ORDER BY ur.refid ASC", function REDUCT_RECIPIENT_RECEIVED_MAILS ($column, $id, $count) { // Search for mail in database $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `%s`=%s ORDER BY `userid` ASC LIMIT %s", - array($column, bigintval($id), $count), __FILE__, __LINE__); + array($column, bigintval($id), $count), __FUNCTION__, __LINE__); // Are there entries? if (SQL_NUMROWS($result) > 0) { @@ -2121,7 +2123,7 @@ function REDUCT_RECIPIENT_RECEIVED_MAILS ($column, $id, $count) { // Now update all user accounts SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s", - array(implode(",", $UIDs), count($UIDs)), __FILE__, __LINE__); + array(implode(",", $UIDs), count($UIDs)), __FUNCTION__, __LINE__); } // END - if // Free result diff --git a/inc/request-functions.php b/inc/request-functions.php index b110317396..740f7bd52e 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -94,6 +94,11 @@ function REQUEST_GET_COUNT () { // Return value } +// Setter for element in $_GET +function REQUEST_SET_GET ($element, $value) { + $_GET[SQL_ESCAPE($element)] = SQL_ESCAPE($value); +} + // Wrapper for elements in $_POST function REQUEST_POST ($element) { // By default no element is there @@ -145,6 +150,26 @@ function REQUEST_POST_COUNT () { // Return value } +// Setter for element in $_POST +function REQUEST_SET_POST ($element, $value) { + if (is_array($element)) { + // Set array + $eval = "\$_POST['"; + + // Add all entries + $eval .= implode("', '", $element); + + // Finish eval() command + $eval .= sprintf("'] = \"%s\";", SQL_ESCAPE($value)); + + // And run it + eval($eval); + } else { + // Set regular entry + $_POST[SQL_ESCAPE($element)] = SQL_ESCAPE($value); + } +} + // Checks wether a form was sent. If so, the $_POST['ok'] element must be set function IS_FORM_SENT () { // Simply wrap it! diff --git a/install.php b/install.php index 238ae1317f..35fc2cc270 100644 --- a/install.php +++ b/install.php @@ -71,7 +71,7 @@ if (!REQUEST_ISSET_GET('page')) { // Already installed? if ((isInstalled()) && (isAdminRegistered())) { // Add fatal message - addFatalMessage(getMessage('ALREADY_INSTALLED')); + addFatalMessage(__FILE__, __LINE__, getMessage('ALREADY_INSTALLED')); } // END - if // Does something goes wrong? diff --git a/mailid_top.php b/mailid_top.php index 7e63705eaa..fc3c4ab0ea 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -49,7 +49,7 @@ if (isInstalled()) { // Is the extension active if (!EXT_IS_ACTIVE("mailid", true)) { // Is not activated/installed yet! - addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid"); + addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid"); } // END - if // Secure all data diff --git a/modules.php b/modules.php index 5a372e0fc4..323b0d9189 100644 --- a/modules.php +++ b/modules.php @@ -43,6 +43,7 @@ $GLOBALS['output_mode'] = 0; $GLOBALS['what'] = ""; $GLOBALS['action'] = ""; $GLOBALS['userid'] = 0; +$GLOBALS['module'] = ""; // Needed include files require("inc/config.php"); @@ -50,13 +51,6 @@ require("inc/config.php"); // Fix missing module to "index" if (!REQUEST_ISSET_GET(('module'))) REQUEST_SET_GET('module', "index"); -// Secure action/what if present -if (REQUEST_ISSET_GET(('action'))) $GLOBALS['action'] = secureString(REQUEST_GET('action')); -if (REQUEST_ISSET_GET(('what'))) $GLOBALS['what'] = secureString(REQUEST_GET('what')); - -// Secure the module name (very important line!) -$GLOBALS['module'] = secureString(REQUEST_GET('module')); - // Check if logged in if (IS_MEMBER()) { // Is still logged in so we welcome him with his name @@ -100,7 +94,7 @@ LOAD_INC_ONCE("inc/header.php"); $MOD_VALID = false; $check = "failed"; if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != "admin")) { // Maintain mode is active and you are no admin - addFatalMessage(getMessage('LANG_DOWN_MAINTAINCE')); + addFatalMessage(__FILE__, __LINE__, getMessage('LANG_DOWN_MAINTAINCE')); } elseif ((SQL_IS_LINK_UP()) && (getTotalFatalErrors() == 0)) { // Construct module name define('__MODULE', sprintf("inc/modules/%s.php", SQL_ESCAPE($GLOBALS['module']))); @@ -120,32 +114,32 @@ if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != // An URL was specified so we load the de-referrer module LOAD_URL(DEREFERER($URL)); } elseif (getTotalFatalErrors() == 0) { - addFatalMessage(sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module'])); } break; case "404": - addFatalMessage(sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module'])); break; case "locked": if (!FILE_READABLE(constant('__MODULE'))) { // Module does addionally not exists - addFatalMessage(sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module'])); } // END - if // Add fatal message - addFatalMessage(sprintf(getMessage('LANG_MOD_REG_LOCKED'), $GLOBALS['module'])); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_LOCKED'), $GLOBALS['module'])); break; default: DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, $GLOBALS['module'])); - addFatalMessage(sprintf(getMessage('LANG_MOD_REG_UNKNOWN'), $check)); + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_UNKNOWN'), $check)); break; } } elseif (getTotalFatalErrors() == 0) { // MySQL problems! - addFatalMessage(getMessage('MYSQL_ERRORS')); + addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_ERRORS')); } if (($MOD_VALID) && (defined('__MODULE'))) { diff --git a/ref.php b/ref.php index c26ce8bfde..66d545f342 100644 --- a/ref.php +++ b/ref.php @@ -60,8 +60,8 @@ if (isInstalled()) { } // Get referal ID from ref or refid variable - if (REQUEST_ISSET_GET(('ref'))) $ref = secureString(REQUEST_GET('ref')); - elseif (REQUEST_ISSET_GET(('refid'))) $ref = secureString(REQUEST_GET('refid')); + if (REQUEST_ISSET_GET(('ref'))) $ref = REQUEST_GET('ref'); + elseif (REQUEST_ISSET_GET(('refid'))) $ref = REQUEST_GET('refid'); if (!empty($ref)) { // Test if nickname or numeric id diff --git a/templates/de/html/admin/admin_add_sponsor.tpl b/templates/de/html/admin/admin_add_sponsor.tpl index bd7148358b..de0b7ada53 100644 --- a/templates/de/html/admin/admin_add_sponsor.tpl +++ b/templates/de/html/admin/admin_add_sponsor.tpl @@ -10,7 +10,7 @@ diff --git a/templates/de/html/admin/admin_config_birthday.tpl b/templates/de/html/admin/admin_config_birthday.tpl index 4b4c985222..03bd5af6c3 100644 --- a/templates/de/html/admin/admin_config_birthday.tpl +++ b/templates/de/html/admin/admin_config_birthday.tpl @@ -9,8 +9,8 @@ - + @@ -133,7 +133,7 @@ @@ -145,7 +145,7 @@ @@ -157,7 +157,7 @@ @@ -175,7 +175,7 @@ @@ -311,7 +311,7 @@ + maxlength="20" value="{!__NOTIFY_VALUE!}"> ({!POINTS!}) diff --git a/templates/de/html/admin/admin_edit_sponsor_edit.tpl b/templates/de/html/admin/admin_edit_sponsor_edit.tpl index 59ed7c1027..97e6a52488 100644 --- a/templates/de/html/admin/admin_edit_sponsor_edit.tpl +++ b/templates/de/html/admin/admin_edit_sponsor_edit.tpl @@ -8,7 +8,7 @@ diff --git a/templates/de/html/admin/admin_list_beg.tpl b/templates/de/html/admin/admin_list_beg.tpl index 00808b3afa..eafff4ab15 100644 --- a/templates/de/html/admin/admin_list_beg.tpl +++ b/templates/de/html/admin/admin_list_beg.tpl @@ -27,7 +27,10 @@
      -
    {--ADMIN_SPONSOR_COMPANY_NOTE--}
    + {--ADMIN_SPONSOR_COMPANY_NOTE--}
     
     
    {--ADMIN_BIRTHDAY_POINTS--}:
    -
    ({--ADMIN_BIRTHDAY_POINTS_NOTE--})
    {--ADMIN_BIRTHDAY_POINTS--}: + ({--ADMIN_BIRTHDAY_POINTS_NOTE--})      
    ({!POINTS!})
    + value="{!__ORDER_VALUE!}"> ({!POINTS!})
       
    ({!POINTS!})
    + value="{!__REF_VALUE!}"> ({!POINTS!})
       
    ({!POINTS!})
    + value="{!__STATS_VALUE!}"> ({!POINTS!})
       
    ({!POINTS!})
    + value="{!__LOGIN_VALUE!}"> ({!POINTS!})
       
    ({!POINTS!})
    + value="{!__TURBO_VALUE!}"> ({!POINTS!})
       
    ({!POINTS!})
     
      -
    {--ADMIN_SPONSOR_COMPANY_NOTE--}
    + {--ADMIN_SPONSOR_COMPANY_NOTE--}
     
    -
    {--ADMIN_BEG_WINNER_HIGLIGHTED--}
    -
    -
    {--ADMIN_BEG_TIMEOUT_1--} {!__AUTOPURGE_TIMEOUT!} -{--ADMIN_BEG_TIMEOUT_2--}
    +
    + {--ADMIN_BEG_WINNER_HIGLIGHTED--} + +
    + {--ADMIN_BEG_TIMEOUT_1--} {!__AUTOPURGE_TIMEOUT!} {--ADMIN_BEG_TIMEOUT_2--} +
    +
    diff --git a/templates/de/html/admin/admin_list_rallye_usr.tpl b/templates/de/html/admin/admin_list_rallye_usr.tpl index 8c00d910d0..f19f41ad50 100644 --- a/templates/de/html/admin/admin_list_rallye_usr.tpl +++ b/templates/de/html/admin/admin_list_rallye_usr.tpl @@ -12,7 +12,7 @@ {!__RALLYE_USER_ROWS!} -
    {--RALLYE_REF_POINTS_NOTE--} + {--RALLYE_REF_POINTS_NOTE--} diff --git a/templates/de/html/admin/admin_list_refs2.tpl b/templates/de/html/admin/admin_list_refs2.tpl index 61ba1b78d2..2007985222 100644 --- a/templates/de/html/admin/admin_list_refs2.tpl +++ b/templates/de/html/admin/admin_list_refs2.tpl @@ -9,7 +9,7 @@ $content[rows]   -
    {--ADMIN_LIST_REFERRALS_NOTE--}
    + {--ADMIN_LIST_REFERRALS_NOTE--} diff --git a/templates/de/html/admin/admin_list_sponsor.tpl b/templates/de/html/admin/admin_list_sponsor.tpl index a6cf5755e0..f5e41e3b1d 100644 --- a/templates/de/html/admin/admin_list_sponsor.tpl +++ b/templates/de/html/admin/admin_list_sponsor.tpl @@ -8,7 +8,7 @@ {!__SPONSOR_ROWS!} -
    {--ADMIN_LIST_SPONSOR_NOTES--}
    + {--ADMIN_LIST_SPONSOR_NOTES--} diff --git a/templates/de/html/admin/admin_payout_add_new.tpl b/templates/de/html/admin/admin_payout_add_new.tpl index 17505881cb..ce3855fe07 100644 --- a/templates/de/html/admin/admin_payout_add_new.tpl +++ b/templates/de/html/admin/admin_payout_add_new.tpl @@ -2,7 +2,7 @@ @@ -21,7 +21,7 @@ + maxlength="10">  ({--ADMIN_PAYOUT_VALUE_NOTE--}) @@ -30,7 +30,7 @@ + maxlength="10">  ({--ADMIN_PAYOUT_VALUE_NOTE--}) diff --git a/templates/de/html/admin/admin_send_bonus_select.tpl b/templates/de/html/admin/admin_send_bonus_select.tpl index 5adcaf8eef..d07dac6e49 100644 --- a/templates/de/html/admin/admin_send_bonus_select.tpl +++ b/templates/de/html/admin/admin_send_bonus_select.tpl @@ -3,11 +3,10 @@ - +
    - {--ADMIN_PAYOUT_ADD_NEW_TITLE--}:
    + {--ADMIN_PAYOUT_ADD_NEW_TITLE--}:
    ({--ADMIN_PAYOUT_ADD_NEW_NOTE--})
    {--ADMIN_PAYOUT_RATE--}  
      ({--ADMIN_PAYOUT_VALUE_NOTE--})
     {--ADMIN_PAYOUT_MIN_POINTS--}:  
      ({--ADMIN_PAYOUT_VALUE_NOTE--})
     {--ADMIN_SEND_BONUS_MAILS--}
    · {--ADMIN_SEND_BONUS_NORMAL--}
    -
    -
    {--ADMIN_SEND_BONUS_NORMAL_NOTES--}
    + · {--ADMIN_SEND_BONUS_NORMAL--} +
    {--ADMIN_SEND_BONUS_NORMAL_NOTES--}
    +
    diff --git a/templates/de/html/admin/admin_unlock_emails_row.tpl b/templates/de/html/admin/admin_unlock_emails_row.tpl index fe6a9719c2..1f373451fd 100644 --- a/templates/de/html/admin/admin_unlock_emails_row.tpl +++ b/templates/de/html/admin/admin_unlock_emails_row.tpl @@ -14,10 +14,10 @@ {--ADMIN_TEST_URL--} -
    $content[cat_link] + $content[cat_link]
    -
    $content[pay_link] + $content[pay_link]
    $content[ordered] diff --git a/templates/de/html/admin/admin_welcome.tpl b/templates/de/html/admin/admin_welcome.tpl index 39c0e80464..21cc4c246b 100644 --- a/templates/de/html/admin/admin_welcome.tpl +++ b/templates/de/html/admin/admin_welcome.tpl @@ -6,7 +6,7 @@
      Hallo $username!
    - Aktueller Admin: [
    {!__ADMIN_LOGIN!}
    ] + Aktueller Admin: [{!__ADMIN_LOGIN!}]