$data['action'] = '';
if (!isExtensionInstalledAndNewer('sql_patches', '0.0.5')) {
- // sql_patches is missing so choose depending on mode
+ // ext-sql_patches is missing so choose depending on mode
$what = determineWhat($module);
} elseif ((empty($what)) && ($module != 'admin')) {
// Use configured 'home'
// Free memory
SQL_FREERESULT($result);
} elseif ((!isExtensionInstalled('sql_patches')) && ($module != 'admin') && ($module != 'unknown')) {
- // No sql_patches installed, but maybe we need to register an admin?
+ // No ext-sql_patches installed, but maybe we need to register an admin?
if (isAdminRegistered()) {
// Redirect to admin area
redirectToUrl('admin.php');
$type
), __FUNCTION__, __LINE__);
- // Update 'mails_sent' if sql_patches is updated
+ // Update 'mails_sent' if ext-sql_patches is updated
if (isExtensionInstalledAndNewer('sql_patches', '0.7.4')) {
// Update the pool
SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_pool` SET `mails_sent`=`mails_sent`+1 WHERE `id`=%s LIMIT 1',
// By default an invalid ACL value is returned
$data['default_acl'] = 'NO-ACL';
- // Is sql_patches there and was it found in cache?
+ // Is ext-sql_patches there and was it found in cache?
if (!isExtensionActive('sql_patches')) {
// Not found, which is bad, so we need to allow all
$data['default_acl'] = 'allow';
// By default an invalid mode
$data['la_mode'] = 'INVALID';
- // Is sql_patches there and was it found in cache?
+ // Is ext-sql_patches there and was it found in cache?
if (!isExtensionActive('sql_patches')) {
// Not found, which is bad, so we need to allow all
$data['la_mode'] = 'global';
$result = SQL_QUERY_ESC("SELECT
(SUM(p.`points`) - d.`used_points`) AS `points`
FROM
- `{?_MYSQL_PREFIX?}_user_points` AS p
+ `{?_MYSQL_PREFIX?}_user_points` AS `p`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_user_data` AS d
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
ON
p.`userid`=d.`userid`
WHERE
if (count($userids) > 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(',', $userids), count($userids)), __FUNCTION__, __LINE__);
+ array(
+ implode(',', $userids),
+ count($userids)
+ ), __FUNCTION__, __LINE__);
} else {
// Nothing deleted
displayMessage('{%message,ADMIN_MAIL_NOTHING_DELETED=' . $id . '%}');
// Creates a new task
function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId = NULL, $strip = TRUE) {
// Insert the task data into the database
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s, %s, 'NEW', '%s', '%s', '%s', UNIX_TIMESTAMP())",
array(
convertZeroToNull($adminId),
convertZeroToNull($userid),
}
// Updates last module / online time
-function updateLastActivity($userid) {
+function updateLastActivity ($userid) {
// Is 'what' set?
if (isWhatSet()) {
// Run the update query
SQL_QUERY_ESC("UPDATE
`{?_MYSQL_PREFIX?}_user_data`
SET
- `%s`='%s',
+ `{%%pipe,getUserLastWhatName%%}`='{%%pipe,getWhat%%}',
`last_online`=UNIX_TIMESTAMP(),
- `REMOTE_ADDR`='%s'
+ `REMOTE_ADDR`='{%%pipe,detectRemoteAddr%%}'
WHERE
`userid`=%s
LIMIT 1",
array(
- getUserLastWhatName(),
- getWhat(),
- detectRemoteAddr(),
bigintval($userid)
), __FUNCTION__, __LINE__);
} else {
SQL_QUERY_ESC("UPDATE
`{?_MYSQL_PREFIX?}_user_data`
SET
- `%s`=NULL,
+ `{%%pipe,getUserLastWhatName%%}`=NULL,
`last_online`=UNIX_TIMESTAMP(),
- `REMOTE_ADDR`='%s'
+ `REMOTE_ADDR`='{%%pipe,detectRemoteAddr%%}'
WHERE
`userid`=%s
LIMIT 1",
array(
- getUserLastWhatName(),
- detectRemoteAddr(),
bigintval($userid)
), __FUNCTION__, __LINE__);
}