// Load all active filers
$result = SQL_QUERY("SELECT `filter_name`, `filter_function`, `filter_active`".$ADD."
FROM `{!_MYSQL_PREFIX!}_filters`
-ORDER BY `filter_id` ASC", __FILE__, __LINE__);
+ORDER BY `filter_id` ASC", __FUNCTION__, __LINE__);
// Are there entries?
if (SQL_NUMROWS($result) > 0) {
// Filter for running SQL commands
function FILTER_RUN_SQLS ($data) {
+ // Debug message
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " - Entered!");
+
// Is the array there?
if ((IS_SQLS_VALID()) && ((!isset($data['dry_run'])) || ($data['dry_run'] == false))) {
// Run SQL commands
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " - Found ".COUNT_SQLS()." queries to run.");
foreach (GET_SQLS() as $sql) {
+ // Trim spaces away
$sql = trim($sql);
+
+ // Is there still a query left?
if (!empty($sql)) {
// Do we have an "ALTER TABLE" command?
if (substr(strtolower($sql), 0, 11) == "alter table") {
// Analyse the alteration command
- SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Alterting table: {$sql}");
+ SQL_ALTER_TABLE($sql, __FUNCTION__, __LINE__);
} else {
// Run regular SQL command
- $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Running regular query: {$sql}");
+ $result = SQL_QUERY($sql, __FUNCTION__, __LINE__, false);
}
} // END - if
} // END - foreach
} // END - if
+
+ // Debug message
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " - Left!");
}
// Filter for updating/validating login data
// Load last module and last online time
$result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
+ array($GLOBALS['userid']), __FUNCTION__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Update last module / online time
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
- array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
+ array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FUNCTION__, __LINE__);
} else {
// Destroy session, we cannot update!
destroy_user_session();