}
}
+// 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]
?>
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);
// 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
// CFG: SMTP-HOSTNAME
define('SMTP_HOSTNAME', "");
// CFG: SMTP-USER
-define('SMTP_USER' , "");
+define('SMTP_USER', "");
// CFG: SMTP-PASSWORD
define('SMTP_PASSWORD', "");
// Run SQL command
//* DEBUG: */ echo $sql_string."<br />\n";
$result = mysql_query($sql_string, SQL_GET_LINK())
- or addFatalMessage($F." (".$L."):".mysql_error()."<br />
+ or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
Query string:<br />
".$sql_string);
// 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);
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
} // 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);
$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__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
+ addFatalMessage(__FILE__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
} // END - if
} // END - if
break;
// 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
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
// 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;
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;
}
// 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
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
// 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
// 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
// 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
// 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
} // END - if
// Test if we can append data
- $fp = @fopen($fqfn, 'a');
+ $fp = fopen($fqfn, 'a');
if ($inc == "dummy") {
// Remove dummy file
fclose($fp);
}
// 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);
$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
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)) {
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__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
// Does the user exist?
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />\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
// 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
// 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();
}
} 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__);
}
}
} 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) {
// 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 .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span></li>\n";
// Generate a "link" for the given admin id (aid)
function GENERATE_AID_LINK ($aid) {
// No assigned admin is default
- $admin = "<div class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</div>";
+ $admin = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
// Zero? = Not assigned
if ($aid == "0") {
$tmp = $FQFN.".tmp";
// Open the source file
- $fp = @fopen($FQFN, 'r') or OUTPUT_HTML("<strong>READ:</strong> ".$FQFN."<br />");
+ $fp = fopen($FQFN, 'r') or OUTPUT_HTML("<strong>READ:</strong> ".$FQFN."<br />");
// Is the resource valid?
if (is_resource($fp)) {
// Open temporary file
- $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("<strong>WRITE:</strong> ".$tmp."<br />");
+ $fp_tmp = fopen($tmp, 'w') or OUTPUT_HTML("<strong>WRITE:</strong> ".$tmp."<br />");
// Is the resource again valid?
if (is_resource($fp_tmp)) {
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("<strong>CHANGE:</strong> 404!");
} else {
// File not found, not readable or writeable
OUTPUT_HTML("<strong>404:</strong> ".$FQFN."<br />");
}
+
+ // An error was detected!
+ return false;
}
// Send notification to admin
function SEND_ADMIN_NOTIFICATION($subject, $templateName, $content=array(), $uid="0") {
// 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'))." ";
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
SQL_CLOSE(__FILE__, __LINE__);
} elseif (!isInstalling()) {
// No database link
- addFatalMessage(getMessage('NO_DB_LINK_SHUTDOWN'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('NO_DB_LINK_SHUTDOWN'));
}
}
// 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
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
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;
}
} else {
// Already installed!
- addFatalMessage(getMessage('ALREADY_INSTALLED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('ALREADY_INSTALLED'));
}
//
define('LIFE_YEARS', "Jahr(e)");
define('LANG_MEM_ONLY_1', "Auf das ausgewählte Modul <u>");
define('LANG_MEM_ONLY_2', "</u> dürfen nur eingeloggte Mitglieder zugreifen!");
-define('MEMBER_404_ACTION_1', "Das Mitgliedsaktionsmodul <u>");
-define('MEMBER_404_ACTION_2', "</u> ist nicht auffindbar!");
+define('MEMBER_404_ACTION', "Das Mitgliedsaktionsmodul <u>%s</u> ist nicht auffindbar!");
define('_GUEST', "Gast");
define('_UNKNOWN', "Name ist nicht ladbar");
define('_ADMIN', "Administrator");
}
// 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?) <em>rel="external"</em> ist gesetzt. Bitte nicht den Backlink einbauen, und <strong>nofollow</strong> verwenden! Das schadet allen.");
define('WRONG_PAGE', "Sie oder dieses Script haben eine falsche Seite ausgewählt!");
// 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!");
{
// 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
$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) {
$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
$POST['email'][$id],
$POST['la_mode'][$id],
$id
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
}
// Purge cache
// 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);
// 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) {
// 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);
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);
// 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
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);
} 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")) {
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']);
// 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);
// 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);
}
// 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);
// 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);
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 = "---";
//
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(), "");
// 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]
$this->storeExtensionVersion("cache");
} else {
// Cannot create file
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
}
} else {
// Cannot create file
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
}
} else {
// Cache file not found or not readable
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_LOAD_1.$this->inc.CACHE_CANNOT_LOAD_2);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_LOAD_1.$this->inc.CACHE_CANNOT_LOAD_2);
}
}
$this->rebuilt[$this->name] = true;
} else {
// Not removed!
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->inc.CACHE_CANNOT_UNLINK_2);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->inc.CACHE_CANNOT_UNLINK_2);
}
} // END - if
}
}
} else {
// Cannot write to cache!
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
} // END - foreach
} else {
// Cannot write array!
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
} // END - if
} else {
// Cannot write to cache!
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
//* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />\n";
} else {
// Cannot create file
- addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
}
}
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) {
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
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);
$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(
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));
{
// 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
{
{
// 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__);
}
}
}
// 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);
// 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);
} 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) {
// 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) {
$ADMIN,
GET_REMOTE_ADDR(),
session_id()
- ), __FILE__, __LINE__
+ ), __FUNCTION__, __LINE__
);
} else {
// No entry does exists so we simply add it!
$ADMIN,
session_id(),
GET_REMOTE_ADDR()
- ), __FILE__, __LINE__
+ ), __FUNCTION__, __LINE__
);
}
// 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__);
}
//
$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;
$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
$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
$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("<br /><div align=\"center\">
<div align=\"center\"><strong>{--PAYOUT_NOW--}:</strong></div><br />
// 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);
// 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);
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);
// 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
}
// 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
{
// 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);
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(
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);
} // 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;
// 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);
$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);
// 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) {
// 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...
}
// 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))
{
// 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;
// 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);
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);
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);
// 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);
$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)
{
// 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
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)) {
$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)) {
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
// Add points again, but only directly
// 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) {
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__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />\n";
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):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!<br />\n";
// Insert this level
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!<br />\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)]);
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):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!<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!<br />\n";
} // END - if
} // END - if
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) {
// 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) {
// 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) {
//
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 = "<div class=\\\"guest_failed\\\"> (*)</div>";
$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
//
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")) {
// 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 .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\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,
'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\"";
} 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) {
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
// 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;
// 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
// 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
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);
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;
} 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
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);
} // END - if
} else {
// Not found!
- addFatalMessage(MEMBER_SURFBAR_EXECUTE_ACTION_404, $functionName);
+ addFatalMessage(__FUNCTION__, __LINE__, getMessage('MEMBER_SURFBAR_EXECUTE_ACTION_404'), $functionName);
}
// Return status
//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;
// 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
}
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) {
$urlData['limit'],
$urlData['limit'],
$urlData['reload']
- ), __FILE__, __LINE__
+ ), __FUNCTION__, __LINE__
);
// Return insert id
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
$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
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
///* 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 () {
// 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
// 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);
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
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
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
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
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);
// 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?
userid=%s
ORDER BY
id ASC", array($GLOBALS['userid']),
- __FILE__, __LINE__);
+ __FUNCTION__, __LINE__);
// Load all entries
while (list($lid, $url, $last) = SQL_FETCHROW($result)) {
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);
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) {
// 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) {
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
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__
);
}
$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);
} 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) {
} 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);
} 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);
//
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
$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);
// 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) {
// 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
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);
}
// ... 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));
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"))) {
} 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');
// 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) {
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!");
// 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);
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
// 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
}
// 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
// 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) {
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;
// 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
}
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");
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 {
LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_fatal\">{--ADMIN_LOGOUT_FAILED--}</div>");
// Add fatal message
- addFatalMessage(getMessage('CANNOT_UNREG_SESS'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('CANNOT_UNREG_SESS'));
}
} else {
// Maybe an Admin want's to login?
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
// 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);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
LOAD_INC($INC);
} else {
// "what file" not found
- addFatalMessage(getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
+ addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
?>
// 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']);
}
//
// 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']);
}
//
$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;
}
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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']);
}
//
// 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
// 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) {
// 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
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");
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");
}
//
-function ADMIN_DO_ACTION($wht) {
+function ADMIN_DO_ACTION ($wht) {
global $DATA;
//* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*<br />\n";
// 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)) {
} 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
} // 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 = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_main\">
<tr><td colspan=\"2\" height=\"7\" class=\"seperator\"> </td></tr>\n";
$OUT .= "</NOBR></td>
</tr>\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();
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 ;-) )
$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 = "<select name=\"".$MODE."_menu";
$result = false;
if (!$alwaysAdd) {
if (!empty($whereStatement)) {
- $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}".$tableName."` WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}".$tableName."` WHERE ".$whereStatement." LIMIT 1", __FUNCTION__, __LINE__);
} else {
- $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}".$tableName."` LIMIT 1", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}".$tableName."` LIMIT 1", __FUNCTION__, __LINE__);
}
} // END - if
SQL_FREERESULT($result);
// Simply run generated SQL string
- SQL_QUERY($SQL, __FILE__, __LINE__);
+ SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// Rebuild cache
REBUILD_CACHE("config", "config");
} elseif (GET_EXT_VERSION("admins") >= "0.6.7") {
// Load from database when version of "admins" is enough
$result = SQL_QUERY_ESC("SELECT la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
- array($aid), __FILE__, __LINE__);
+ array($aid), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
list($ADMIN) = SQL_FETCHROW($result);
if (!empty($selected)) {
// Determine new status
$result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1",
- array($row, $table, $idRow, $id), __FILE__, __LINE__);
+ array($row, $table, $idRow, $id), __FUNCTION__, __LINE__);
// Row found?
if (SQL_NUMROWS($result) == 1) {
// Change this status
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s` SET %s='%s' WHERE %s=%s LIMIT 1",
- array($table, $row, $newStatus, $idRow, $id), __FILE__, __LINE__);
+ array($table, $row, $newStatus, $idRow, $id), __FUNCTION__, __LINE__);
// Count up affected rows
$cnt += SQL_AFFECTEDROWS();
$id = bigintval($id);
// Get result from a given column array and table name
- $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id, __FILE__, __LINE__);
+ $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id, __FUNCTION__, __LINE__);
// Is there one entry?
if (SQL_NUMROWS($result) == 1) {
// Load data of entry
$result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1",
- array($table, $idColumn, $id), __FILE__, __LINE__);
+ array($table, $idColumn, $id), __FUNCTION__, __LINE__);
// Fetch the data
$content = SQL_FETCHARRAY($result);
);
// Run the SQL
- SQL_QUERY($SQL, __FILE__, __LINE__);
+ SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// Do we have an URL?
if (isset($content['url'])) {
if (REQUEST_ISSET_POST('uid_raw', $id)) {
// Load all data from that id
$result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1",
- array($table, $idColumn, $id), __FILE__, __LINE__);
+ array($table, $idColumn, $id), __FUNCTION__, __LINE__);
// Fetch the data
$content = SQL_FETCHARRAY($result);
} // END - foreach
// Run the query
- SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FILE__, __LINE__);
+ SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FUNCTION__, __LINE__);
// Was this fine?
if (SQL_AFFECTEDROWS() == count($IDs)) {
$SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1";
// Run this query
- SQL_QUERY($SQL, __FILE__, __LINE__);
+ SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// Add affected rows
$affected += SQL_AFFECTEDROWS();
// Load all data from that id
$result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1",
- array($table, $idColumn, $id), __FILE__, __LINE__);
+ array($table, $idColumn, $id), __FUNCTION__, __LINE__);
// Fetch the data
global $DATA;
// Look up administator login
$result = SQL_QUERY_ESC("SELECT id, login, password FROM `{!_MYSQL_PREFIX!}_admins` WHERE email='%s' LIMIT 1",
- array($email), __FILE__, __LINE__);
+ array($email), __FUNCTION__, __LINE__);
// Is there an account?
if (SQL_NUMROWS($result) == 0) {
// Then try to find that user
$result = SQL_QUERY_ESC("SELECT id, password, email FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
- array($login), __FILE__, __LINE__);
+ array($login), __FUNCTION__, __LINE__);
// Is an account here?
if (SQL_NUMROWS($result) == 1) {
// Update database
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s' WHERE login='%s' LIMIT 1",
- array($passHash, $login), __FILE__, __LINE__);
+ array($passHash, $login), __FUNCTION__, __LINE__);
// Run filters
RUN_FILTER('post_admin_reset_pass', array('login' => $login, 'hash' => $passHash));
function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) {
// Update the task
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE id=%s LIMIT 1",
- array($row, $data, bigintval($id)), __FILE__, __LINE__);
+ array($row, $data, bigintval($id)), __FUNCTION__, __LINE__);
}
//
?>
require($INC);
} elseif (!EXT_IS_ACTIVE("other")) {
// Missing extension!
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "other");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "other");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("yoomedia")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "yoomedia");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "yoomedia");
return;
}
$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;
}
// Send email
$msg = LOAD_EMAIL_TEMPLATE("sponsor_add_points", REQUEST_POST('reason'), true);
- SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_ADD_POINTS, $msg);
+ SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_ADD_POINTS_SUBJ, $msg);
$MSG = ADMIN_SPONSOR_POINTS_ADDED;
} else {
// No points entered to add!
// Send email
$msg = LOAD_EMAIL_TEMPLATE("sponsor_sub_points", REQUEST_POST('reason'), true);
- SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_SUB_POINTS, $msg);
+ SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_SUB_POINTS_SUBJ, $msg);
$MSG = ADMIN_SPONSOR_POINTS_SUBTRACTED;
} else {
// No points entered to add!
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("mailid")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
return;
}
$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;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("mailid")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
return;
}
require($INC);
} elseif ((!EXT_IS_ACTIVE("user")) || (GET_EXT_VERSION("user") == "")) {
// Missing extension!
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("yoomedia")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "yoomedia");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "yoomedia");
return;
} elseif (!EXT_IS_ACTIVE("bonus")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bonus");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bonus");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("order")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("theme")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif (!EXT_IS_ACTIVE("theme")) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
- addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE, "");
+ addFatalMessage(__FILE__, __LINE__, EXTENSION_PROBLEM_EXT_INACTIVE, "");
return;
} elseif ($BLOCK_MODE) {
// Block mode detected
// Ok, we finally load the guest action module
LOAD_INC($INC);
} elseif ($IS_VALID) {
- addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
} else {
- addFatalMessage(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
}
//
// Ok, we finally load the guest action module
LOAD_INC($INC);
} else {
- addFatalMessage(getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
+ addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
}
//
// Ok, we finally load the guest action module
LOAD_INC($INC);
} else {
- addFatalMessage(getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
+ addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
}
//
// Ok, we finally load the guest action module
LOAD_INC($INC);
} else {
- addFatalMessage(getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
+ addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
}
//
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
} elseif ($BLOCK_MODE) {
// Block mode detected
// Ok, we finally load the guest action module
LOAD_INC($INC);
} else {
- addFatalMessage(getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
+ addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
}
//
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("theme")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "active");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "active");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("doubler")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "doubler");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "doubler");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("user")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("mediadata")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mediadata");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mediadata");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("rallye")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "rallye");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "rallye");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("register"))) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "register");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "register");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("top10")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "top10");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "top10");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("wernis")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "wernis");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "wernis");
return;
}
} elseif (!IS_LOGGED_IN()) {
LOAD_URL(URL."/modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
- addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE, "");
+ addFatalMessage(__FILE__, __LINE__, EXTENSION_PROBLEM_EXT_INACTIVE, "");
return;
} elseif ($BLOCK_MODE) {
// Block mode detected
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("bank")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
return;
} elseif ($BLOCK_MODE) {
// Block mode detected
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
return;
} elseif ($BLOCK_MODE) {
// Block mode detected
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
return;
} elseif ($BLOCK_MODE) {
// Block mode detected
// Ok, we finally load the member action module
LOAD_INC($INC);
} else {
- addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
}
//
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("theme")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("bank")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
return;
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("bank")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("bank")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("bank")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("bank")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bank");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php[5~?module=index");
} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php[5~?module=index");
} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bonus");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bonus");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php[5~?module=index");
} elseif ((!EXT_IS_ACTIVE("doubler")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "doubler");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "doubler");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "holiday");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "holiday");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("html_mail")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "html_mail");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "html_mail");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("mydata")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mydata");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mydata");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "newsletter");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "newsletter");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("nickname")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "nickname");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "nickname");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
return;
}
// Not logged in
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("payout")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "payout");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "payout");
return;
}
LOAD_TEMPLATE("member_points");
} elseif (IS_ADMIN()) {
// Missing extension
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
} else {
// Message for user
LOAD_TEMPLATE("admin_settings_saved", false, getMessage('PROBLEM_POINTS_OVERVIEW_UNAVAILABLE'));
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("primera")) && (!IS_ADMIN())) {
// Extension "primera" is not activated
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "primera");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "primera");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("rallye")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "rallye");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "rallye");
return;
}
// User is not logged in
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "refback");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "refback");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
}
} elseif (!IS_MEMBER()){
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("support")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "support");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "support");
return;
}
// Redirect
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
return;
}
// Not logged in
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "surfbar");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("theme")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "theme");
return;
}
} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("transfer")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "transfer");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "transfer");
return;
}
// User is not logged in
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("wernis")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "wernis");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "wernis");
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
return;
} elseif (!IS_MEMBER()) {
// Sorry, no guest access!
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'));
return;
} elseif (!IS_SPONSOR()) {
// No sponsor!
- addFatalMessage(getMessage('SPONSOR_ONLY_AREA_ENTERED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
return;
} elseif (empty($GLOBALS['what'])) {
// Empty what value detected!
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
} elseif (!IS_SPONSOR()) {
// No sponsor!
- addFatalMessage(getMessage('SPONSOR_ONLY_AREA_ENTERED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
} elseif (!IS_SPONSOR()) {
// No sponsor!
- addFatalMessage(getMessage('SPONSOR_ONLY_AREA_ENTERED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
} elseif (!IS_SPONSOR()) {
// No sponsor!
- addFatalMessage(getMessage('SPONSOR_ONLY_AREA_ENTERED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
return;
}
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
} elseif ((!EXT_IS_ACTIVE("sponsor"))
- addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+ addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
return;
} elseif (!IS_SPONSOR()) {
// No sponsor!
- addFatalMessage(getMessage('SPONSOR_ONLY_AREA_ENTERED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
return;
}
// Check if this file is writeable or read-only and warn the user
if ((!isInstalling()) && (isInstalled())) {
// Check for write-permission for config.php and inc directory
+ if (empty($GLOBALS['module'])) $GLOBALS['module'] = REQUEST_GET('module');
if (empty($GLOBALS['module'])) $GLOBALS['module'] = "index";
// CSS array
define('RAND_NUMBER', mt_rand(1000000, 9999999));
}
} else {
- // Add language system
- LOAD_INC_ONCE("inc/language.php");
-
// Wrong database?
- addFatalMessage(getMessage('WRONG_DB_SELECTED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('WRONG_DB_SELECTED'));
}
} else {
- // Add language system
- LOAD_INC_ONCE("inc/language.php");
-
// No link to database!
- addFatalMessage(getMessage('NO_DB_LINK'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('NO_DB_LINK'));
}
} else {
- // Add language system
- LOAD_INC_ONCE("inc/language.php");
-
// Maybe you forgot to enter your MySQL data?
- addFatalMessage(getMessage('MYSQL_DATA_MISSING'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_DATA_MISSING'));
}
} else {
///////////////////////////////////////////////////
if ((!isInstalled()) || (!isAdminRegistered())) {
// Check for file permissions
if (!IS_INC_WRITEABLE("config")) {
- addFatalMessage(getMessage('CONFIG_IS_WRITE_PROTECTED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('CONFIG_IS_WRITE_PROTECTED'));
} // END - if
if (!IS_INC_WRITEABLE("dummy")) {
- addFatalMessage(getMessage('DUMMY_IS_WRITE_PROTECTED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('DUMMY_IS_WRITE_PROTECTED'));
} // END - if
if (!IS_INC_WRITEABLE(".secret/dummy")) {
- addFatalMessage(getMessage('SECRET_IS_WRITE_PROTECTED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('SECRET_IS_WRITE_PROTECTED'));
} // END - if
} // END - if
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
- array($mod), __FILE__, __LINE__);
+ array($mod), __FUNCTION__, __LINE__);
list($name) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
}
} elseif (!EXT_IS_ACTIVE("cache")) {
// Check for module in database
$result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
- array($mod_chk), __FILE__, __LINE__);
+ array($mod_chk), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Read data
list($locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
// to find a loop here... *sigh*
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mod_reg`
(module, locked, hidden, mem_only, admin_only, has_menu) VALUES
-('%s','Y','N','N','N','N')", array($mod_chk), __FILE__, __LINE__);
+('%s','Y','N','N','N','N')", array($mod_chk), __FUNCTION__, __LINE__);
} else {
// Wrong/missing sql_patches!
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mod_reg`
(module, locked, hidden, mem_only, admin_only) VALUES
-('%s','Y','N','N','N')", array($mod_chk), __FILE__, __LINE__);
+('%s','Y','N','N','N')", array($mod_chk), __FUNCTION__, __LINE__);
}
// Everthing is fine?
// Get the title from menu
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' ".$AND." LIMIT 1",
- array($ACC_LVL, $type, $search), __FILE__, __LINE__);
+ array($ACC_LVL, $type, $search), __FUNCTION__, __LINE__);
// Menu found?
if (SQL_NUMROWS($result) == 1) {
// Load SQL data and add the menu to the output stream...
$result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (what='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
- array($MODE), __FILE__, __LINE__);
+ array($MODE), __FUNCTION__, __LINE__);
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$MODE."_menu\">");
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;
} 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 = "";
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)) {
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)) {
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);
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);
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);
// 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) {
// 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);
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);
// 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
// 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);
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
}
} 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);
// 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) {
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);
$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
// Count rows
//* DEBUG: */ echo "COUNT!<br />\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!<br />\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
} 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) {
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />\n";
if (SQL_NUMROWS($result_user) == 1) {
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />\n";
} // END - if
// 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__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\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);
// 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);
} 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
} 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);
} 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);
} 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);
} 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);
$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)) {
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") {
// 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...
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__);
}
//
}
//
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__);
}
}
//
$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
}
} 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);
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")) {
// 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();
$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);
);
// 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)) {
// 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
$target,
bigintval($receiver),
$HTML
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
} else {
// Add regular mail
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus`
$cat,
$target,
bigintval($receiver),
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
}
}
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?
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) {
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!");
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) {
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) {
// 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
// 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
// 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!
// Already installed?
if ((isInstalled()) && (isAdminRegistered())) {
// Add fatal message
- addFatalMessage(getMessage('ALREADY_INSTALLED'));
+ addFatalMessage(__FILE__, __LINE__, getMessage('ALREADY_INSTALLED'));
} // END - if
// Does something goes wrong?
// 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
$GLOBALS['what'] = "";
$GLOBALS['action'] = "";
$GLOBALS['userid'] = 0;
+$GLOBALS['module'] = "";
// Needed include files
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
$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'])));
// 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'))) {
}
// 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
<tr>
<td class="bottom2" width="10" height="40"> </td>
<td class="bottom2" colspan="3" align="center">
- <div class="admin_note">{--ADMIN_SPONSOR_COMPANY_NOTE--}</div>
+ <span class="admin_note">{--ADMIN_SPONSOR_COMPANY_NOTE--}</span>
</td>
<td class="bottom2" width="10"> </td>
</tr>
<td colspan="3" class="seperator" height="5"> </td>
</tr>
<tr>
- <td width="400" align="right">{--ADMIN_BIRTHDAY_POINTS--}:<br />
- <div class="admin_note">({--ADMIN_BIRTHDAY_POINTS_NOTE--})</div></td>
+ <td width="400" align="right">{--ADMIN_BIRTHDAY_POINTS--}:
+ <span class="admin_note">({--ADMIN_BIRTHDAY_POINTS_NOTE--})</span></td>
<td class="seperator" width="5"> </td>
<td width="170"><input type="text" name="birthday_points"
class="admin_normal" value="{!__POINTS_VALUE!}" size="4"
<td class="seperator" width="5"> </td>
<td width="195" align="center"><input type="text"
name="bonus_order" class="admin_normal" size="8" maxlength="20"
- value="{!__ORDER_VALUE!}"> <div class="admin_note">({!POINTS!})</div>
+ value="{!__ORDER_VALUE!}"> <span class="admin_note">({!POINTS!})</span>
</td>
</tr>
<tr>
<td class="seperator" width="5"> </td>
<td width="195" align="center"><input type="text"
name="bonus_ref" class="admin_normal" size="8" maxlength="20"
- value="{!__REF_VALUE!}"> <div class="admin_note">({!POINTS!})</div>
+ value="{!__REF_VALUE!}"> <span class="admin_note">({!POINTS!})</span>
</td>
</tr>
<tr>
<td class="seperator" width="5"> </td>
<td width="195" align="center"><input type="text"
name="bonus_stats" class="admin_normal" size="8" maxlength="20"
- value="{!__STATS_VALUE!}"> <div class="admin_note">({!POINTS!})</div>
+ value="{!__STATS_VALUE!}"> <span class="admin_note">({!POINTS!})</span>
</td>
</tr>
<tr>
<td class="seperator" width="5"> </td>
<td width="195" align="center"><input type="text"
name="login_bonus" class="admin_normal" size="8" maxlength="20"
- value="{!__LOGIN_VALUE!}"> <div class="admin_note">({!POINTS!})</div>
+ value="{!__LOGIN_VALUE!}"> <span class="admin_note">({!POINTS!})</span>
</td>
</tr>
<tr>
<td class="seperator" width="5"> </td>
<td align="center"><input type="text" name="turbo_bonus"
class="admin_normal" size="10" maxlength="20"
- value="{!__TURBO_VALUE!}"> <div class="admin_note">({!POINTS!})</div>
+ value="{!__TURBO_VALUE!}"> <span class="admin_note">({!POINTS!})</span>
</td>
</tr>
<tr>
<td class="seperator" width="5"> </td>
<td width="195" align="center"><input type="text"
name="bonus_notify_points" class="admin_normal" size="8"
- maxlength="20" value="{!__NOTIFY_VALUE!}"> <div class="admin_note">({!POINTS!})</div></td>
+ maxlength="20" value="{!__NOTIFY_VALUE!}"> <span class="admin_note">({!POINTS!})</span></td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td class="bottom2" width="10"> </td>
<td class="bottom2" colspan="3" align="center">
- <div class="admin_note">{--ADMIN_SPONSOR_COMPANY_NOTE--}</div>
+ <span class="admin_note">{--ADMIN_SPONSOR_COMPANY_NOTE--}</span>
</td>
<td class="bottom2" width="10"> </td>
</tr>
</tr>
</table>
-<div class="admin_note"><strong>{--ADMIN_BEG_WINNER_HIGLIGHTED--}</strong><br />
-<br />
-<div class="admin_note">{--ADMIN_BEG_TIMEOUT_1--} <strong>{!__AUTOPURGE_TIMEOUT!}</strong>
-{--ADMIN_BEG_TIMEOUT_2--}</div></div>
+<div class="admin_note">
+ <strong>{--ADMIN_BEG_WINNER_HIGLIGHTED--}</strong>
+
+ <div class="admin_note">
+ {--ADMIN_BEG_TIMEOUT_1--} <strong>{!__AUTOPURGE_TIMEOUT!}</strong> {--ADMIN_BEG_TIMEOUT_2--}
+ </div>
+</div>
{!__RALLYE_USER_ROWS!}
<tr>
<td colspan="4" class="admin_footer">
- <div class="admin_note">{--RALLYE_REF_POINTS_NOTE--}</strong>
+ <span class="admin_note">{--RALLYE_REF_POINTS_NOTE--}</span>
</td>
</tr>
</table>
<tr><td class="seperator bottom2" height="1"> </td></tr>
<tr>
<td class="admin_footer" style="padding-top: 7px; padding-bottom: 7px">
- <div class="admin_note">{--ADMIN_LIST_REFERRALS_NOTE--}</div>
+ <span class="admin_note">{--ADMIN_LIST_REFERRALS_NOTE--}</span>
</td>
</tr>
</table>
{!__SPONSOR_ROWS!}
<tr>
<td colspan="4" class="admin_footer" style="padding: 5px">
- <div class="admin_notes tiny">{--ADMIN_LIST_SPONSOR_NOTES--}</div>
+ <span class="admin_notes tiny">{--ADMIN_LIST_SPONSOR_NOTES--}</span>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed" align="center">
<tr>
<td colspan="3" align="center" class="admin_title bottom2" height="40">
- <strong>{--ADMIN_PAYOUT_ADD_NEW_TITLE--}:</strong><br />
+ <strong>{--ADMIN_PAYOUT_ADD_NEW_TITLE--}:</strong>
<div class="admin_note">({--ADMIN_PAYOUT_ADD_NEW_NOTE--})</div></td>
</tr>
<tr>
<td align="right">{--ADMIN_PAYOUT_RATE--}</td>
<td class="seperator"> </td>
<td><input type="text" name="rate" class="admin_normal" size="5"
- maxlength="10"><div class="admin_note"> ({--ADMIN_PAYOUT_VALUE_NOTE--})</div></td>
+ maxlength="10"><span class="admin_note"> ({--ADMIN_PAYOUT_VALUE_NOTE--})</span></td>
</tr>
<tr>
<td colspan="3" height="3" class="seperator"> </td>
<td align="right">{--ADMIN_PAYOUT_MIN_POINTS--}:</td>
<td class="seperator"> </td>
<td><input type="text" name="mpoi" class="admin_normal" size="5"
- maxlength="10"><div class="admin_note"> ({--ADMIN_PAYOUT_VALUE_NOTE--})</div></td>
+ maxlength="10"><span class="admin_note"> ({--ADMIN_PAYOUT_VALUE_NOTE--})</span></td>
</tr>
<tr>
<td colspan="3" height="3" class="seperator"> </td>
<td align="center" class="admin_header bottom2" height="30"><strong>{--ADMIN_SEND_BONUS_MAILS--}</strong></td>
</tr>
<tr>
- <td style="padding-left: 7px; padding-top: 5px; padding-bottom: 5px"
- class="bottom2"><strong><big>·</big></strong> <a
- href="{!URL!}/modules.php?module=admin&what=send_bonus&mode=normal">{--ADMIN_SEND_BONUS_NORMAL--}</a><br />
- <br />
- <div class="admin_note">{--ADMIN_SEND_BONUS_NORMAL_NOTES--}</div></td>
+ <td style="padding-left: 7px; padding-top: 5px; padding-bottom: 5px" class="bottom2">
+ <strong><big>·</big></strong> <a href="{!URL!}/modules.php?module=admin&what=send_bonus&mode=normal">{--ADMIN_SEND_BONUS_NORMAL--}</a>
+ <div class="admin_note">{--ADMIN_SEND_BONUS_NORMAL_NOTES--}</div>
+ </td>
</tr>
<tr>
<td style="padding-left: 7px; padding-top: 5px; padding-bottom: 5px">
<a href="$content[tester]" target="_blank">{--ADMIN_TEST_URL--}</a>
</td>
<td class="switch_sw$content[sw] top2 right2 admin_misc" align="center">
- <div class="admin_note" title="$content[cat_title]">$content[cat_link]</STRONG>
+ <span class="admin_note" title="$content[cat_title]">$content[cat_link]</span>
</td>
<td class="switch_sw$content[sw] top2 right2 admin_misc" align="center">
- <div class="admin_note" title="$content[pay_title]">$content[pay_link]</STRONG>
+ <span class="admin_note" title="$content[pay_title]">$content[pay_link]</span>
</td>
<td class="switch_sw$content[sw] top2 right2 admin_misc" align="center">
$content[ordered]
<div align="left" class="tiny"> Hallo $username!</div>
</td>
<td align="center" width="300" class="dashed"><div class="tiny">
- Aktueller Admin: [<div class="admin_note" title="Erweiterung admins nicht installiert.">{!__ADMIN_LOGIN!}</div>]
+ Aktueller Admin: [<span class="admin_note" title="Erweiterung admins nicht installiert.">{!__ADMIN_LOGIN!}</span>]
</div></td>
<td align="center" width="100" class="top2 bottom2 right2"><div class="tiny"> <a class="menu_blur admin_logout"
href="{!URL!}/modules.php?module=admin&action=logout">Ausloggen</a>