0) {
$content['update_tasks'] = '' . $value . '';
} // END - if
// 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'] = '' . $value . '';
} // END - if
// Unconfirmed accounts
$value = getTotalUnconfirmedUser();
if ($value > 0) {
$content['unconfirmed_members'] = '' . $value . '';
} // END - if
// Locked accounts
$value = getTotalLockedUser();
if ($value > 0) {
$content['locked_members'] = '' . $value . '';
} // END - if
} // END - if
if (isExtensionInstalledAndNewer('user', '0.3.4')) {
// And random refid
$value = getTotalRandomRefidUser();
if ($value > 0) {
$content['random_refid'] = '' . $value . '';
} // END - if
if (isExtensionInstalledAndNewer('user', '0.5.0')) {
// And tester accounts
$value = getTotalTesterUsers();
if ($value > 0) {
$content['testers'] = '' . $value . '';
} // END - if
} // END - if
} // END - if
//
// Unassigned tasks
//
$value = countSumTotalData(NULL, 'task_system', 'id', 'assigned_admin', TRUE, " AND `status` != 'DELETED'");
if ($value > 0) {
$content['new_tasks'] = '' . $value . '';
} // END - if
//
// Closed tasks
//
$value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', TRUE);
if ($value > 0) {
$content['closed_tasks'] = '' . $value . '';
} // END - if
//
// Deleted tasks
//
$value = countSumTotalData('DELETED', 'task_system', 'id', 'status', TRUE);
if ($value > 0) {
$content['deleted_tasks'] = '' . $value . '';
} // END - if
//
// Solved tasks
//
$value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', TRUE, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
if ($value > 0) {
$content['solved_tasks'] = '' . $value . '';
} // END - if
//
// Your tasks
//
$value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
if ($value > 0) {
$content['your_tasks'] = '' . $value . '';
} // END - if
//
// Mails waiting to be approved
//
$value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['pending_mails'] = '' . $value . '';
} // END - if
//
// Unfinished mail orders
//
$value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['canceled_mails'] = '' . $value . '';
} // END - if
//
// Sent mail orders
//
$value = countSumTotalData('SEND', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['send_emails'] = '' . $value . '';
} // END - if
//
// Autopurged mails
//
if (isExtensionActive('autopurge')) {
// Get auto-purged mails
$value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['purged_mails'] = '' . $value . '';
} // END - if
//
// Autopurged bonus mails
//
if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
// Get auto-purged bonus mails
$value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['purged_bonus_mails'] = '' . $value . '';
} // END - if
} elseif (isExtensionActive('bonus')) {
$content['purged_bonus_mails'] = '{%message,ADMIN_EXTENSION_BONUS_OUTDATED=0.1.8%}';
} else {
$content['purged_bonus_mails'] = '{--ADMIN_EXTENSION_BONUS_404--}';
}
} else {
$content['purged_bonus_mails'] = '{--ADMIN_EXTENSION_AUTOPURGE_404--}';
$content['purged_mails'] = '{--ADMIN_EXTENSION_AUTOPURGE_404--}';
}
//
// Sent bonus mails
//
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'");
if ($value > 0) {
$content['send_bonus_mails'] = '' . $value . '';
} // END - if
} elseif (isExtensionActive('bonus')) {
$content['send_bonus_mails'] = '{%message,ADMIN_EXTENSION_BONUS_OUTDATED=0.1.8%}';
} else {
$content['send_bonus_mails'] = '{--ADMIN_EXTENSION_BONUS_404--}';
}
// Both extensions must be there
if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) {
// Start finding them...
$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`
FROM
`{?_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?}
" . runFilterChain('user_exclusion_sql', ' ' . $userExclusionSql) . "
ORDER BY
`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 ' . 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&do=norefs';
} // END - if
if (isExtensionActive('payout')) {
// List new payout requests
addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY `userid` ASC");
$WHATs[] = 'list_payouts';
$DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING_TITLE--}';
addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC');
$WHATs[] = 'list_payouts';
$DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE--}';
} // END - if
if (isExtensionActive('wernis')) {
// List new wernis requests
addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC');
$WHATs[] = 'list_wernis';
$DESCRs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}';
} // END - if
if (isExtensionActive('holiday')) {
// List holiday requests
addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC');
$WHATs[] = 'list_holiday';
$DESCRs[] = '{--ADMIN_TASK_LIST_HOLIDAYS--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_HOLIDAYS_TITLE--}';
} // END - if
if (isExtensionInstalledAndNewer('bonus', '0.8.7')) {
// List all notifications
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `is_notify`='Y' ORDER BY `timestamp` DESC");
$WHATs[] = 'list_notifications';
$DESCRs[] = '{--ADMIN_TASK_LIST_NOTIFICATIONS--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_NOTIFICATIONS_TITLE--}';
} // END - if
// Both extensions must be there
if ((isExtensionInstalledAndNewer('bonus', '0.2.3')) && (isExtensionActive('user'))) {
// Get more columns
$add = trim(runFilterChain('add_bonus_points_user_columns', ''));
// Active rallye, so add more point columns, if not empty
$pointsColumns = '';
if (!empty($add)) {
$pointsColumns = '(0' . $add . ')';
} // END - if
// Init variable
$lastOnline = '';
// Autopurge installed?
if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
// Use last online timestamp to keep inactive members away from here
$lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Is it empty?
if (!empty($ointsColumns)) {
// No, then add it
addSql("SELECT
" . $pointsColumns . " AS `points`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED' AND
" . $pointsColumns . " > 0
" . $lastOnline . "
ORDER BY
`points` DESC,
`userid` ASC");
$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'))) {
// ----- Begging rallye -----
// Init variable
$lastOnline = '';
// Autopurge installed?
if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
// Use last online timestamp to keep inactive members away from here
$lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
addSql("SELECT
`userid`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED' AND
`beg_points` > 0
".$lastOnline."
ORDER BY
`beg_points` DESC,
`userid` ASC");
$WHATs[] = 'list_beg';
$DESCRs[] = '{--ADMIN_TASK_LIST_BEG--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_BEG_TITLE--}';
} // END - if
if (isExtensionActive('doubler')) {
// List waiting payouts
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` WHERE `completed`='N' ORDER BY `id` ASC");
$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');
$WHATs[] = 'list_doubler';
$DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL_TITLE--}';
} // END - if
//
// All referral banner
//
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC');
$WHATs[] = 'refbanner';
$DESCRs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL_TITLE--}';
//
// All activated referral banner
//
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y' ORDER BY `id` ASC");
$WHATs[] = 'refbanner';
$DESCRs[] = '{--ADMIN_TASK_LIST_REFBANNER_ACTIVE--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ACTIVE_TITLE--}';
//
// All extensions
//
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC');
$WHATs[] = 'extensions';
$DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL_TITLE--}';
//
// All activated extensions
//
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_active`='Y' ORDER BY `id` ASC");
$WHATs[] = 'extensions&active=Y';
$DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ACTIVE--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ACTIVE_TITLE--}';
if (isExtensionActive('sponsor')) {
// List all sponsors
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC');
$WHATs[] = 'list_sponsor';
$DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_TITLE--}';
// List confirmed sponsor accounts
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='CONFIRMED' ORDER BY `id` ASC");
$WHATs[] = 'list_sponsor';
$DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_CONFIRMED--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_CONFIRMED_TITLE--}';
// List unconfirmed sponsor accounts
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='UNCONFIRMED' ORDER BY `id` ASC");
$WHATs[] = 'list_sponsor';
$DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED_TITLE--}';
// List locked sponsor accounts
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='LOCKED' ORDER BY `id` ASC");
$WHATs[] = 'list_sponsor';
$DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_LOCKED--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_LOCKED_TITLE--}';
// List waiting sponsor accounts to be approved
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='PENDING' ORDER BY `id` ASC");
$WHATs[] = 'unlock_sponsor';
$DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_PENDING--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_PENDING_TITLE--}';
// Waiting payments
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `pay_status`='PENDING' ORDER BY `id` ASC");
$WHATs[] = 'list_sponsor_pays';
$DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_ORDERS--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_ORDERS_TITLE--}';
} // END - if
if (isExtensionActive('country')) {
// List country codes
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC');
$WHATs[] = 'list_country';
$DESCRs[] = '{--ADMIN_TASK_LIST_COUNTRY--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_COUNTRY_TITLE--}';
} // END - if
if (isExtensionActive('theme')) {
// List all themes
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC');
$WHATs[] = 'theme_edit';
$DESCRs[] = '{--ADMIN_TASK_LIST_THEME_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_THEME_ALL_TITLE--}';
// List active themes
addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` WHERE `theme_active`='Y' ORDER BY `id` ASC");
$WHATs[] = 'theme_edit';
$DESCRs[] = '{--ADMIN_TASK_LIST_THEME_ACTIVE--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_THEME_ACTIVE_TITLE--}';
} // END - if
if (isExtensionActive('admins')) {
// List all administrator logins
addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC');
$WHATs[] = 'admins_edit';
$DESCRs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL_TITLE--}';
} // END - if
if (isExtensionActive('surfbar')) {
// List all URLs in surfbar
addSql('SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC');
$WHATs[] = 'list_surfbar_urls';
$DESCRs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE--}';
// List all pending URLs in surfbar
addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` WHERE `url_status`='PENDING' ORDER BY `url_id` ASC");
$WHATs[] = 'unlock_surfbar_urls';
$DESCRs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING--}';
$TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE--}';
} // END - if
if (isExtensionInstalledAndNewer('sql_patches', '0.9.2')) {
// 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';
} // END - if
// Generate extra overview rows
$EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs);
// If empty just keep a forced-space left for CSS issues
if (empty($EXTRAS)) {
$EXTRAS = ' ';
} // END - if
// Add compiled string to constant for final template
$content['extra_table'] = $EXTRAS;
// Simply load the template... :-)
loadTemplate('admin_overview_task', FALSE, $content);
}
//
function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
// Init variables
$OUT = '';
// Sadly this cannot be rewritten to a filter... :(
foreach (getSqls() as $sqls) {
// New format...
foreach ($sqls as $key => $sql) {
// Run SQL command, get line numbers and free memory
$result = sqlQuery($sql, __FUNCTION__, __LINE__);
// Prepare array for output
$content = array(
'row_descr' => $DESCRs[$key],
'bottom' => '',
);
// Rewrite CSS class if not last entry is reached
if ($key < (count($sqls) - 1)) {
$content['bottom'] = 'bottom';
} // END - if
if ((!ifSqlHasZeroNums($result)) && (!empty($WHATs[$key]))) {
if (empty($TITLEs[$key])) {
$TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
} // END - if
$content['row_link'] = '' . sqlNumRows($result) . '';
} else {
$content['row_link'] = '0';
}
// Free result
sqlFreeResult($result);
// And insert the final string into extras template
$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);
}
// [EOF]
?>