* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
foreach (
array(
// Member accounts
- 'confirmed_members','unconfirmed_members','locked_members','random_refid',
+ 'confirmed_members','unconfirmed_members','locked_members','random_refid','testers',
// Tasks
'update_tasks','new_tasks','closed_tasks','your_tasks','deleted_tasks','solved_tasks',
// Mail orders
} // END - foreach
// Extension updates found
- $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
+ $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
if ($value > 0) {
$content['update_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=updates%}">' . $value . '</a>';
} // END - if
- //
- // First check for all account status seperately
- //
- // Confirmed accounts
- $value = getTotalConfirmedUser();
-
- if ($value > 0) {
- $content['confirmed_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=confirmed%}">' . $value . '</a>';
- } // END - if
-
- // Unconfirmed accounts
- $value = getTotalUnconfirmedUser();
+ // Do this only if ext-user is installed
+ if (isExtensionInstalled('user')) {
+ //
+ // First check for all account status seperately
+ //
+ // Confirmed accounts
+ $value = getTotalConfirmedUser();
+ if ($value > 0) {
+ $content['confirmed_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=confirmed%}">' . $value . '</a>';
+ } // END - if
- if ($value > 0) {
- $content['unconfirmed_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=UNCONFIRMED%}">' . $value . '</a>';
- } // END - if
+ // Unconfirmed accounts
+ $value = getTotalUnconfirmedUser();
+ if ($value > 0) {
+ $content['unconfirmed_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=unconfirmed%}">' . $value . '</a>';
+ } // END - if
- // And locked accounts
- $value = getTotalLockedUser();
- if ($value > 0) {
- $content['locked_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=locked%}">' . $value . '</a>';
+ // Locked accounts
+ $value = getTotalLockedUser();
+ if ($value > 0) {
+ $content['locked_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=locked%}">' . $value . '</a>';
+ } // END - if
} // END - if
if (isExtensionInstalledAndNewer('user', '0.3.4')) {
// And random refid
$value = getTotalRandomRefidUser();
if ($value > 0) {
- $content['random_refid'] = '<a href="{%url=modules.php?module=admin&what=list_user&mode=random_refid%}">' . $value . '</a>';
+ $content['random_refid'] = '<a href="{%url=modules.php?module=admin&what=list_user&do=random_refid%}">' . $value . '</a>';
+ } // END - if
+
+ if (isExtensionInstalledAndNewer('user', '0.5.0')) {
+ // And tester accounts
+ $value = getTotalTesterUsers();
+ if ($value > 0) {
+ $content['testers'] = '<a href="{%url=modules.php?module=admin&what=list_user&do=testers%}">' . $value . '</a>';
+ } // END - if
} // END - if
} // END - if
//
// Unassigned tasks
//
- $value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
+ $value = countSumTotalData(NULL, 'task_system', 'id', 'assigned_admin', TRUE, " AND `status` != 'DELETED'");
if ($value > 0) {
$content['new_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=unassigned%}">' . $value . '</a>';
//
// Closed tasks
//
- $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', true);
+ $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', TRUE);
if ($value > 0) {
$content['closed_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=closed%}">' . $value . '</a>';
//
// Deleted tasks
//
- $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', true);
+ $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', TRUE);
if ($value > 0) {
$content['deleted_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=deleted%}">' . $value . '</a>';
//
// Solved tasks
//
- $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
+ $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', TRUE, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
if ($value > 0) {
$content['solved_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=solved%}">' . $value . '</a>';
//
// Your tasks
//
- $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
+ $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
if ($value > 0) {
$content['your_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task%}">' . $value . '</a>';
//
// Mails waiting to be approved
//
- $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['pending_mails'] = '<a href="{%url=modules.php?module=admin&what=unlock_emails%}">' . $value . '</a>';
//
// Unfinished mail orders
//
- $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['canceled_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
//
// Sent mail orders
//
- $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['send_emails'] = '<a href="{%url=modules.php?module=admin&what=email_archiv%}">' . $value . '</a>';
//
if (isExtensionActive('autopurge')) {
// Get auto-purged mails
- $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['purged_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
//
if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
// Get auto-purged bonus mails
- $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', true);
+ $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['purged_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
} elseif (isExtensionActive('bonus')) {
$content['purged_bonus_mails'] = '{%message,ADMIN_EXTENSION_BONUS_OUTDATED=0.1.8%}';
} else {
- $content['purged_bonus_mails'] = '<span class="notice">{--ADMIN_EXTENSION_BONUS_404--}</span>';
+ $content['purged_bonus_mails'] = '<span class="bad">{--ADMIN_EXTENSION_BONUS_404--}</span>';
}
} else {
- $content['purged_bonus_mails'] = '<span class="notice">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
- $content['purged_mails'] = '<span class="notice">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
+ $content['purged_bonus_mails'] = '<span class="bad">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
+ $content['purged_mails'] = '<span class="bad">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
}
//
//
if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
// Get sent bonus mails (but not notifications)
- $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'");
+ $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', TRUE, " AND `is_notify`='N'");
if ($value > 0) {
$content['send_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
// Both extensions must be there
if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) {
// Start finding them...
- $EXCLUDE_LIST = '';
-
- // Check for more extensions
- // @TODO These can be rewritten to filter
- if (isValidUserId(getDefRefid())) $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}';
- if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
- if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
- if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.`userid` != {?doubler_userid?}';
- if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- // Recent ext-holiday found
- $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
+ $userExclusionSql = ' ';
+ $excludedUserids = runFilterChain('config_userid_exclusion_sql', array());
+ if (count($excludedUserids) > 0) {
+ // Exclude all
+ $userExclusionSql .= ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
} // END - if
// Check for all accounts
addSql("SELECT
- d.userid, d.email, d.last_online
+ `d`.`userid`,
+ `d`.`email`,
+ `d`.`last_online`
FROM
- `{?_MYSQL_PREFIX?}_user_data` AS d
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
WHERE
- d.`status`='CONFIRMED' AND
- (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND
- (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND
- (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?}
-".$EXCLUDE_LIST."
+ `d`.`status`='CONFIRMED' AND
+ (UNIX_TIMESTAMP() - `d`.`joined`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - `d`.`last_online`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - `d`.`ap_notified`) >= {?ap_inactive_since?}
+ " . runFilterChain('user_exclusion_sql', ' ' . $userExclusionSql) . "
ORDER BY
- d.userid ASC");
+ `d`.`userid` ASC");
$WHATs[] = 'list_autopurge';
$DESCRs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE--}';
$TITLEs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE--}';
- }
+ } // END - if
if ((isExtensionInstalledAndNewer('sql_patches', '0.3.4')) && (isExtensionActive('user'))) {
// Check for accounts without referral
- addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 OR `refid` IS NULL ORDER BY `userid` ASC");
+ addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 OR `refid` IS NULL ' . runFilterChain('user_exclusion_sql', ' ') . ' ORDER BY `userid` ASC');
$DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL_TITLE--}';
- $WHATs[] = 'list_user&mode=norefs';
+ $WHATs[] = 'list_user&do=norefs';
} // END - if
if (isExtensionActive('payout')) {
$TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}';
} // END - if
- if (isExtensionActive('primera')) {
- // List new primera requests
- addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC');
- $WHATs[] = 'list_primera';
- $DESCRs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL--}';
- $TITLEs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL_TITLE--}';
- } // END - if
-
if (isExtensionActive('holiday')) {
// List holiday requests
addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC');
// Both extensions must be there
if ((isExtensionInstalledAndNewer('bonus', '0.2.3')) && (isExtensionActive('user'))) {
// Get more columns
- $add = runFilterChain('add_bonus_points_user_columns', '');
+ $add = trim(runFilterChain('add_bonus_points_user_columns', ''));
// Active rallye, so add more point columns, if not empty
- $USE = '`turbo_bonus`';
+ $pointsColumns = '';
if (!empty($add)) {
- $USE = '(0' . $add . ')';
+ $pointsColumns = '(0' . $add . ')';
} // END - if
// Init variable
$lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
- addSql("SELECT
- " . $USE . " AS `points`
+ // Is it empty?
+ if (!empty($ointsColumns)) {
+ // No, then add it
+ addSql("SELECT
+ " . $pointsColumns . " AS `points`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED' AND
- " . $USE . " > 0
+ " . $pointsColumns . " > 0
" . $lastOnline . "
ORDER BY
`points` DESC,
`userid` ASC");
- $WHATs[] = 'list_bonus';
- $DESCRs[] = '{--ADMIN_TASK_LIST_BONUS--}';
- $TITLEs[] = '{--ADMIN_TASK_LIST_BONUS_TITLE--}';
- }
+ $WHATs[] = 'list_bonus';
+ $DESCRs[] = '{--ADMIN_TASK_LIST_BONUS--}';
+ $TITLEs[] = '{--ADMIN_TASK_LIST_BONUS_TITLE--}';
+ } // END - if
+ } // END - if
// Again both extensions must be there
if ((isExtensionInstalledAndNewer('beg', '0.1.2')) && (isExtensionActive('user'))) {
if (isExtensionActive('doubler')) {
// List waiting payouts
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` WHERE `completed`='N' ORDER BY `id` ASC");
- $WHATs[] = 'list_doubler&mode=waiting&select=all';
+ $WHATs[] = 'list_doubler&do=waiting&select=all';
$DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE--}';
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC');
$TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE--}';
} // END - if
+ if (isExtensionInstalled('server_name')) {
+ // Check for wrong "SERVER_NAME" entries
+ addSql('SELECT `server_name_id` FROM `{?_MYSQL_PREFIX?}_server_name_log`');
+ $DESCRs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG--}';
+ $TITLEs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG_TITLE--}';
+ $WHATs[] = 'list_server_name';
+ } // END - if
+
+ if (isExtensionInstalled('network')) {
+ // Check for HTTP logging entries
+ addSql('SELECT `network_header_id` FROM `{?_MYSQL_PREFIX?}_network_header_logging`');
+ $DESCRs[] = '{--ADMIN_TASK_LIST_NETWORK_HEADER_LOG--}';
+ $TITLEs[] = '{--ADMIN_TASK_LIST_NETWORK_HEADER_LOG_TITLE--}';
+ $WHATs[] = 'list_network_http_header';
+
+ // Check for API cache entries
+ addSql('SELECT `network_cache_id` FROM `{?_MYSQL_PREFIX?}_network_cache`');
+ $DESCRs[] = '{--ADMIN_TASK_LIST_NETWORK_API_CACHE--}';
+ $TITLEs[] = '{--ADMIN_TASK_LIST_NETWORK_API_CACHE_TITLE--}';
+ $WHATs[] = 'list_network_api';
+ } // END - if
+
// Generate extra overview rows
$EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs);
$content['extra_table'] = $EXTRAS;
// Simply load the template... :-)
- loadTemplate('admin_overview_task', false, $content);
+ loadTemplate('admin_overview_task', FALSE, $content);
}
//
// New format...
foreach ($sqls as $key => $sql) {
// Run SQL command, get line numbers and free memory
- $result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
+ $result = sqlQuery($sql, __FUNCTION__, __LINE__);
// Prepare array for output
$content = array(
$content['bottom'] = 'bottom';
} // END - if
- if ((!SQL_HASZERONUMS($result)) && (!empty($WHATs[$key]))) {
+ if ((!ifSqlHasZeroNumRows($result)) && (!empty($WHATs[$key]))) {
if (empty($TITLEs[$key])) {
$TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
} // END - if
- $content['row_link'] = '<a href="{%url=modules.php?module=admin&what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . SQL_NUMROWS($result) . '</a>';
+ $content['row_link'] = '<a href="{%url=modules.php?module=admin&what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . sqlNumRows($result) . '</a>';
} else {
$content['row_link'] = '0';
}
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// And insert the final string into extras template
- $OUT .= loadTemplate('admin_overview_task_rows', true, $content);
+ $OUT .= loadTemplate('admin_overview_task_rows', TRUE, $content);
} // END- foreach
} // END - foreach
// Return output in the template
- return loadTemplate('admin_overview_task_extras', true, $OUT);
+ return loadTemplate('admin_overview_task_extras', TRUE, $OUT);
}
// [EOF]