* -------------------------------------------------------------------- *
* Kurzbeschreibung : Spezielle task-Funktionen *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
+if (!defined('__SECURITY')) {
+ die();
}
+
//
// The advanced overview shows detailed informations to your exchange script:
// - Unconfirmed / locked accounts
// - Your own tasks
// - ...
//
-function OUTPUT_ADVANCED_OVERVIEW (&$result_main)
-{
- global $_CONFIG;
-
+// @TODO Move all extension-dependent queries into filters
+function outputAdvancedOverview (&$result_main) {
// Init variables/arrays
- $EXTRAS = ""; $OUT = ""; $SQLs = array(); $WHATs = array(); $DESCRs = array(); $TITLEs = array();
+ $EXTRAS = '';
+ $OUT = '';
+ $WHATs = array();
+ $DESCRs = array();
+ $TITLEs = array();
// Chheck for new extensions and updates
- $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_main);
-
- if (!$JOBS_DONE) {
- // New extensions or updates found
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='%s' AND status='NEW' AND task_type='EXTENSION_UPDATE'",
- array(GET_ADMIN_ID($_SESSION['admin_login'])), __FILE__, __LINE__);
-
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $jobsDone = outputStandardOverview($result_main);
+
+ // Init SQLs
+ initSqls();
+
+ // Init contentn
+ foreach (
+ array(
+ // Member accounts
+ 'confirmed_members','unconfirmed_members','locked_members',
+ // Tasks
+ 'update_tasks','new_tasks','closed_tasks','your_tasks','deleted_tasks','solved_tasks',
+ // Mail orders
+ 'pending_mails','canceled_mails','send_emails',
+ // Bonus mails
+ 'send_bonus_mails',
+ // Purging
+ 'purged_mails','purged_bonus_mails'
+ ) as $entry) {
+ // Set it to zero
+ $content[$entry] = 0;
+ } // END - foreach
+
+ // Extension updates found
+ $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
- if ($value > 0) {
- define ('__TASK_UPDATE_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=updates\">".$value."</A>");
- } else {
- define ('__TASK_UPDATE_VALUE', "0");
- }
- } else {
- define ('__TASK_UPDATE_VALUE', "0");
- }
+ 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
- $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- define('__CONFIRMED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_user&mode=confirmed\">".$value."</A>");
- } else {
- define('__CONFIRMED_VALUE', "0");
- }
+ $content['confirmed_members'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_user&status=confirmed\">".$value."</a>";
+ } // END - if
// Unconfirmed accounts
- $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='UNCONFIRMED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- define('__UNCONFIRMED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=chk_regs\">".$value."</A>");
- } else {
- define('__UNCONFIRMED_VALUE', "0");
- }
+ $content['unconfirmed_members'] = "<a href=\"{?URL?}/modules.php?module=admin&what=chk_regs\">".$value."</a>";
+ } // END - if
- // And locked accounts
- $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='LOCKED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ // And locked accounts
+ $value = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- define('__LOCKED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_user&mode=locked\">".$value."</A>");
- } else {
- define('__LOCKED_VALUE', "0");
- }
+ $content['locked_members'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_user&status=locked\">".$value."</a>";
+ } // END - if
//
// Unassigned tasks
//
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='0' AND status != 'DELETED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
if ($value > 0) {
- define('__TASK_NEW_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=unassigned\">".$value."</A>");
- } else {
- define('__TASK_NEW_VALUE', "0");
- }
+ $content['new_tasks'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_task&type=unassigned\">".$value."</a>";
+ } // END - if
//
// Closed tasks
//
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'CLOSED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', true);
if ($value > 0) {
- define('__TASK_CLOSED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=closed\">".$value."</A>");
- } else {
- define('__TASK_CLOSED_VALUE', "0");
- }
+ $content['closed_tasks'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_task&type=closed\">".$value."</a>";
+ } // END - if
//
// Deleted tasks
//
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'DELETED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', true);
if ($value > 0) {
- define('__TASK_DELETED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=deleted\">".$value."</A>");
- } else {
- define('__TASK_DELETED_VALUE', "0");
- }
+ $content['deleted_tasks'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_task&type=deleted\">".$value."</a>";
+ } // END - if
//
// Solved tasks
//
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'SOLVED' AND assigned_admin='%s'",
- array(GET_ADMIN_ID($_SESSION['admin_login'])), __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
if ($value > 0) {
- define('__TASK_SOLVED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=solved\">".$value."</A>");
- } else {
- define('__TASK_SOLVED_VALUE', "0");
- }
+ $content['solved_tasks'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_task&type=solved\">".$value."</a>";
+ } // END - if
//
// Your tasks
//
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='%s' AND status = 'NEW' AND task_type != 'EXTENSION_UPDATE'",
- array(GET_ADMIN_ID($_SESSION['admin_login'])), __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
if ($value > 0) {
- define('__TASK_YOUR_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task\">".$value."</A>");
- } else {
- define('__TASK_YOUR_VALUE', "0");
- }
+ $content['your_tasks'] = "<a href=\"{?URL?}/modules.php?module=admin&what=list_task\">".$value."</a>";
+ } // END - if
//
// Mails waiting to be approved
//
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='ADMIN'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_ADMIN_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=unlock_emails\">".$value."</A>");
- } else {
- define('__MAIL_ADMIN_VALUE', "0");
- }
+ $content['pending_mails'] = "<a href=\"{?URL?}/modules.php?module=admin&what=unlock_emails\">".$value."</a>";
+ } // END - if
//
// Unfinished mail orders
//
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='TEMP'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_TEMP_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
- } else {
- define('__MAIL_TEMP_VALUE', "0");
- }
+ $content['canceled_mails'] = "<a href=\"{?URL?}/modules.php?module=admin&what=email_details\">".$value."</a>";
+ } // END - if
//
// Sent mail orders
//
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='SEND'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_SEND_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_archiv\">".$value."</A>");
- } else {
- define('__MAIL_SEND_VALUE', "0");
- }
+ $content['send_emails'] = "<a href=\"{?URL?}/modules.php?module=admin&what=email_archiv\">".$value."</a>";
+ } // END - if
//
// Autopurged mails
//
- if (EXT_IS_ACTIVE("autopurge")) {
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='DELETED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ if (isExtensionActive('autopurge')) {
+ // Get auto-purged mails
+ $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_DELETED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
- } else {
- define('__MAIL_DELETED_VALUE', "0");
- }
+ $content['purged_mails'] = "<a href=\"{?URL?}/modules.php?module=admin&what=email_details\">".$value."</a>";
+ } // END - if
//
// Autopurged bonus mails
//
- if (GET_EXT_VERSION("bonus") >= "0.1.8") {
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE data_type='DELETED'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
+ // Get auto-purged bonus mails
+ $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_BONUS_AP_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
- } else {
- define('__MAIL_BONUS_AP_VALUE', "0");
- }
- } elseif (EXT_IS_ACTIVE("bonus")) {
- define('__MAIL_BONUS_AP_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
+ $content['purged_bonus_mails'] = "<a href=\"{?URL?}/modules.php?module=admin&what=email_details\">".$value."</a>";
+ } // END - if
+ } elseif (isExtensionActive('bonus')) {
+ $content['purged_bonus_mails'] = sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED'), '0.1.8');
} else {
- define('__MAIL_BONUS_AP_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_BONUS_404."</FONT>");
+ $content['purged_bonus_mails'] = "<span class=\"admin_note\">{--ADMIN_EXT_BONUS_404--}</span>";
}
} else {
- define('__MAIL_BONUS_AP_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</FONT>");
- define('__MAIL_DELETED_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</FONT>");
+ $content['purged_bonus_mails'] = "<span class=\"admin_note\">{--ADMIN_EXT_AUTOPURGE_404--}</span>";
+ $content['purged_mails'] = "<span class=\"admin_note\">{--ADMIN_EXT_AUTOPURGE_404--}</span>";
}
//
// Sent bonus mails
//
- if (GET_EXT_VERSION("bonus") >= "0.1.8") {
- $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE data_type='SEND'", __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ 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) {
- define('__MAIL_BONUS_SEND_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
- } else {
- define('__MAIL_BONUS_SEND_VALUE', "0");
- }
- } elseif (EXT_IS_ACTIVE("bonus")) {
- define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
+ $content['send_bonus_mails'] = "<a href=\"{?URL?}/modules.php?module=admin&what=email_details\">".$value."</a>";
+ } // END - if
+ } elseif (isExtensionActive('bonus')) {
+ $content['send_bonus_mails'] = sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED'), '0.1.8');
} else {
- define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_404);
+ $content['send_bonus_mails'] = getMessage('ADMIN_EXT_BONUS_404');
}
- if (EXT_IS_ACTIVE("autopurge")) {
+ if (isExtensionActive('autopurge')) {
// Start finding them...
- $since = (time() - $_CONFIG['ap_in_since']);
- $EXCLUDE_LIST = " AND d.userid != c.def_refid";
+ $since = getConfig('ap_inactive_since');
+ $EXCLUDE_LIST = '';
+ if (getConfig('def_refid') > 0) {
+ $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid')."";
+ } // END - if
// Check for more extensions
- if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != c.beg_uid";
- if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid";
- if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid";
-
- // Check for new holiday system
- if (GET_EXT_VERSION("holiday") >= "0.1.3") {
- $EXCLUDE_LIST .= " AND d.holiday_active = 'N'";
- }
+ // @TODO These can be rewritten to filter
+ if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid')."";
+ if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid')."";
+ if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid')."";
+ if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3')) {
+ // Recent ext-holiday found
+ $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
+ } // END - if
// Check for all accounts
- $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online
-FROM "._MYSQL_PREFIX."_user_data AS d, "._MYSQL_PREFIX."_config AS c
-WHERE d.status='CONFIRMED' AND d.joined < ".$since." AND d.last_online < ".$since." AND d.ap_notified < ".$since."
+ addSql("SELECT
+ d.userid, d.email, d.last_online
+FROM
+ `{?_MYSQL_PREFIX?}_user_data` AS d
+WHERE
+ d.`status`='CONFIRMED' AND
+ d.joined < (UNIX_TIMESTAMP() - ".$since.") AND
+ d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND
+ d.ap_notified < (UNIX_TIMESTAMP() - ".$since.")
".$EXCLUDE_LIST."
-ORDER BY d.userid";
- $WHATs[] = "list_autopurge";
- $DESCRs[] = TASK_ADMIN_INACTIVE_AUTOPURGE;
- $TITLEs[] = TASK_ADMIN_INACTIVE_AUTOPURGE_TITLE;
+ORDER BY
+ d.userid ASC");
+ $WHATs[] = 'list_autopurge';
+ $DESCRs[] = getMessage('ADMIN_TASK_INACTIVE_AUTOPURGE');
+ $TITLEs[] = getMessage('ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE');
}
- if (GET_EXT_VERSION("sql_patches") >= "0.3.4") {
- // Check for accounts without referral
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE refid='0' ORDER BY userid";
- $DESCRs[] = TAKS_ADMIN_LIST_ACCOUNT_NOREF;
- $TITLEs[] = TAKS_ADMIN_LIST_ACCOUNT_NOREF_TITLE;
- $WHATs[] = "list_norefs";
+ if (getExtensionVersion('sql_patches') >= '0.3.4') {
+ // Check for accounts without referal
+ addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 ORDER BY `userid` ASC");
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_ACCOUNT_NOREF');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_ACCOUNT_NOREF_TITLE');
+ $WHATs[] = 'list_user&mode=norefs';
}
- if (EXT_IS_ACTIVE("payout")) {
+ if (isExtensionActive('payout')) {
// List new payout requests
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_payouts WHERE status='NEW' ORDER BY userid";
- $WHATs[] = "list_payouts";
- $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING;
- $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE;
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_payouts ORDER BY userid";
- $WHATs[] = "list_payouts";
- $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_ALL_TITLE;
+ addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY `userid` ASC");
+ $WHATs[] = 'list_payouts';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_WAITING');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_WAITING_TITLE');
+ addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC");
+ $WHATs[] = 'list_payouts';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE');
}
- if (EXT_IS_ACTIVE("wernis")) {
+ if (isExtensionActive('wernis')) {
// List new wernis requests
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_wernis ORDER BY userid";
- $WHATs[] = "list_wernis";
- $DESCRs[] = TASK_ADMIN_LIST_WERNIS_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_WERNIS_ALL_TITLE;
+ addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC");
+ $WHATs[] = 'list_wernis';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_WERNIS_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_WERNIS_ALL_TITLE');
+ }
+
+ if (isExtensionActive('primera')) {
+ // List new primera requests
+ addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC");
+ $WHATs[] = 'list_primera';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_PRIMERA_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_PRIMERA_ALL_TITLE');
}
- if (EXT_IS_ACTIVE("holiday")) {
+ if (isExtensionActive('holiday')) {
// List holiday requests
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_holidays ORDER BY userid";
- $WHATs[] = "list_holiday";
- $DESCRs[] = TASK_ADMIN_LIST_HOLIDAYS;
- $TITLEs[] = TASK_ADMIN_LIST_HOLIDAYS_TITLE;
+ addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC");
+ $WHATs[] = 'list_holiday';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_HOLIDAYS');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_HOLIDAYS_TITLE');
}
- if (GET_EXT_VERSION("bonus") >= "0.2.3") {
+ 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[] = getMessage('ADMIN_TASK_LIST_NOTIFICATIONS');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_NOTIFICATIONS_TITLE');
+ } // END - if
+
+ if (isExtensionInstalledAndNewer('bonus', '0.2.3')) {
// Active rallye
- if (GET_EXT_VERSION("bonus") >= "0.6.9") {
+ if (getExtensionVersion('bonus') >= '0.6.9') {
// Add more bonus points here
- $USE = "(0";
- if ($_CONFIG['bonus_click_yn'] == 'Y') $USE .= " + turbo_bonus";
- if ($_CONFIG['bonus_login_yn'] == 'Y') $USE .= " + login_bonus";
- if ($_CONFIG['bonus_order_yn'] == 'Y') $USE .= " + bonus_order";
- if ($_CONFIG['bonus_stats_yn'] == 'Y') $USE .= " + bonus_stats";
- if ($_CONFIG['bonus_ref_yn'] == 'Y') $USE .= " + bonus_ref";
- $USE .= ")";
+ $USE = '(0';
+ if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`';
+ if (getConfig('bonus_login_yn') == 'Y') $USE .= ' + `login_bonus`';
+ if (getConfig('bonus_order_yn') == 'Y') $USE .= ' + `bonus_order`';
+ if (getConfig('bonus_stats_yn') == 'Y') $USE .= ' + `bonus_stats`';
+ if (getConfig('bonus_ref_yn') == 'Y') $USE .= ' + `bonus_ref`';
+ $USE .= ')';
} else {
// Old version ???
- $USE = "turbo_bonus";
+ $USE = 'turbo_bonus';
}
// Autopurge installed?
- $LAST = ""; $ONLINE = "";
- if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['ap_inactive'] == 'Y') && ($_CONFIG['ap_in_since'] > 0)) {
+ $lastOnline = '';
+ if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
// Use last online timestamp to keep inactive members away from here
- $LAST = " AND last_online >= ";
- $ONLINE = bigintval(time() - $_CONFIG['ap_in_since']);
- }
-
- $SQLs[] = "SELECT ".$USE." AS active_bonus FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."".$ONLINE."
-ORDER BY active_bonus DESC, userid";
- $WHATs[] = "list_bonus";
- $DESCRs[] = TASK_ADMIN_LIST_BONUS;
- $TITLEs[] = TASK_ADMIN_LIST_BONUS_TITLE;
+ $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
+ } // END - if
+
+ addSql("SELECT
+ ".$USE." AS points
+FROM
+ `{?_MYSQL_PREFIX?}_user_data`
+WHERE
+ `status`='CONFIRMED' AND ".$USE." > 0".$lastOnline."
+ORDER BY
+ `points` DESC,
+ `userid` ASC");
+ $WHATs[] = 'list_bonus';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_BONUS');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_BONUS_TITLE');
}
- if (GET_EXT_VERSION("beg") >= "0.1.2") {
+ if ((isExtensionActive('beg')) && (getExtensionVersion('beg') >= '0.1.2')) {
// Begging rallye
// Autopurge installed?
- $LAST = ""; $ONLINE = "";
- if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['ap_inactive'] == 'Y') && ($_CONFIG['ap_in_since'] > 0)) {
+ $lastOnline = '';
+ if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
// Use last online timestamp to keep inactive members away from here
- $LAST = " AND last_online >= ";
- $ONLINE = bigintval(time() - $_CONFIG['ap_in_since']);
- }
-
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND beg_points>0".$LAST."".$ONLINE."
-ORDER BY beg_points DESC, userid";
- $WHATs[] = "list_beg";
- $DESCRs[] = TASK_ADMIN_LIST_BEG;
- $TITLEs[] = TASK_ADMIN_LIST_BEG_TITLE;
+ $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?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[] = getMessage('ADMIN_TASK_LIST_BEG');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_BEG_TITLE');
}
- if (EXT_IS_ACTIVE("doubler")) {
+ if (isExtensionActive('doubler')) {
// List waiting payouts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' ORDER BY id";
- $WHATs[] = "list_doubler&mode=waiting&select=all";
- $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_WAITING;
- $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_WAITING_TITLE;
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_doubler ORDER BY id";
- $WHATs[] = "list_doubler";
- $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_ALL_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` WHERE `completed`='N' ORDER BY `id` ASC");
+ $WHATs[] = 'list_doubler&mode=waiting&select=all';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE');
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC");
+ $WHATs[] = 'list_doubler';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_ALL_TITLE');
}
//
- // All referral banner
+ // All referal banner
//
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner ORDER BY id";
- $WHATs[] = "refbanner";
- $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ALL_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC");
+ $WHATs[] = 'refbanner';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ALL_TITLE');
//
- // All activated referral banner
+ // All activated referal banner
//
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner WHERE visible='Y' ORDER BY id";
- $WHATs[] = "refbanner";
- $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE;
- $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y' ORDER BY `id` ASC");
+ $WHATs[] = 'refbanner';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ACTIVE');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ACTIVE_TITLE');
//
// All extensions
//
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_extensions ORDER BY id";
- $WHATs[] = "extensions";
- $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC");
+ $WHATs[] = 'extensions';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ALL_TITLE');
//
// All activated extensions
//
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_active='Y' ORDER BY id";
- $WHATs[] = "extensions&active=Y";
- $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE;
- $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_active`='Y' ORDER BY `id` ASC");
+ $WHATs[] = 'extensions&active=Y';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ACTIVE');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ACTIVE_TITLE');
- if (EXT_IS_ACTIVE("engine")) {
+ if (isExtensionActive('engine')) {
// List all export accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts ORDER BY id";
- $WHATs[] = "list_engine";
- $DESCRs[] = TASK_ADMIN_LIST_ENGINE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` ORDER BY `id` ASC");
+ $WHATs[] = 'list_engine';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_ENGINE');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_ENGINE_TITLE');
// List all pending accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts WHERE status='UNCONFIRMED' ORDER BY id";
- $WHATs[] = "unlock_engine";
- $DESCRs[] = TASK_ADMIN_UNLOCK_ENGINE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` WHERE `status`='UNCONFIRMED' ORDER BY `id` ASC");
+ $WHATs[] = 'unlock_engine';
+ $DESCRs[] = getMessage('ADMIN_TASK_UNLOCK_ENGINE');
+ $TITLEs[] = getMessage('ADMIN_TASK_UNLOCK_ENGINE_TITLE');
// List all safes
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_safe ORDER BY id";
- $WHATs[] = "list_engine&mode=safe";
- $DESCRs[] = TASK_ADMIN_LIST_ENGINE_SAFES;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_safe` ORDER BY `id` ASC");
+ $WHATs[] = 'list_engine&mode=safe';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_ENGINE_SAFES');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_ENGINE_SAFES_TITLE');
// List all export URLs
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_urls ORDER BY id";
- $WHATs[] = "engine_urls";
- $DESCRs[] = TASK_ADMIN_LIST_ENGINE_URLS;
- }
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_urls` ORDER BY `id` ASC");
+ $WHATs[] = 'engine_urls';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_ENGINE_URLS');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_ENGINE_URLS_TITLE');
+ } // END - if
- if (EXT_IS_ACTIVE("sponsor")) {
+ if (isExtensionActive('sponsor')) {
// List all sponsors
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data ORDER BY id";
- $WHATs[] = "list_sponsor";
- $DESCRs[] = TASK_ADMIN_LIST_SPONSOR;
- $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC");
+ $WHATs[] = 'list_sponsor';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_TITLE');
// List confirmed sponsor accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='CONFIRMED' ORDER BY id";
- $WHATs[] = "list_sponsor";
- $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED;
- $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='CONFIRMED' ORDER BY `id` ASC");
+ $WHATs[] = 'list_sponsor';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_CONFIRMED');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_CONFIRMED_TITLE');
// List unconfirmed sponsor accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='UNCONFIRMED' ORDER BY id";
- $WHATs[] = "list_sponsor";
- $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED;
- $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='UNCONFIRMED' ORDER BY `id` ASC");
+ $WHATs[] = 'list_sponsor';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED_TITLE');
// List locked sponsor accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='LOCKED' ORDER BY id";
- $WHATs[] = "list_sponsor";
- $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED;
- $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='LOCKED' ORDER BY `id` ASC");
+ $WHATs[] = 'list_sponsor';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_LOCKED');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_LOCKED_TITLE');
// List waiting sponsor accounts to be approved
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='PENDING' ORDER BY id";
- $WHATs[] = "unlock_sponsor";
- $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_PENDING;
- $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='PENDING' ORDER BY `id` ASC");
+ $WHATs[] = 'unlock_sponsor';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_PENDING');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_PENDING_TITLE');
// Waiting payments
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_orders WHERE pay_status='PENDING' ORDER BY id";
- $WHATs[] = "list_sponsor_pays";
- $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS;
- $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE;
- }
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `pay_status`='PENDING' ORDER BY `id` ASC");
+ $WHATs[] = 'list_sponsor_pays';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_ORDERS');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_ORDERS_TITLE');
+ } // END - if
- if (EXT_IS_ACTIVE("country")) {
+ if (isExtensionActive('country')) {
// List country codes
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_countries ORDER BY id";
- $WHATs[] = "list_country";
- $DESCRs[] = TASK_ADMIN_LIST_COUNTRY;
- $TITLEs[] = TASK_ADMIN_LIST_COUNTRY_TITLE;
- }
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC");
+ $WHATs[] = 'list_country';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_COUNTRY');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_COUNTRY_TITLE');
+ } // END - if
- if (EXT_IS_ACTIVE("theme")) {
+ if (isExtensionActive('theme')) {
// List all themes
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_themes ORDER BY id";
- $WHATs[] = "theme_edit";
- $DESCRs[] = TASK_ADMIN_LIST_THEME_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_THEME_ALL_TITLE;
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC");
+ $WHATs[] = 'theme_edit';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_THEME_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_THEME_ALL_TITLE');
// List active themes
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_active='Y' ORDER BY id";
- $WHATs[] = "theme_edit";
- $DESCRs[] = TASK_ADMIN_LIST_THEME_ACTIVE;
- $TITLEs[] = TASK_ADMIN_LIST_THEME_ACTIVE_TITLE;
- }
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` WHERE `theme_active`='Y' ORDER BY `id` ASC");
+ $WHATs[] = 'theme_edit';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_THEME_ACTIVE');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_THEME_ACTIVE_TITLE');
+ } // END - if
- if (EXT_IS_ACTIVE("admins")) {
+ if (isExtensionActive('admins')) {
// List all administrator logins
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_admins ORDER BY id";
- $WHATs[] = "admins_edit";
- $DESCRs[] = TASK_ADMIN_LIST_ADMINS_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_ADMINS_ALL_TITLE;
- }
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC");
+ $WHATs[] = 'admins_edit';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_ADMINS_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_ADMINS_ALL_TITLE');
+ } // END - if
+
+ if (isExtensionActive('surfbar')) {
+ // List all URLs in surfbar
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `id` ASC");
+ $WHATs[] = 'list_surfbar_urls';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE');
+
+ // List all pending URLs in surfbar
+ addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` WHERE `status`='PENDING' ORDER BY `id` ASC");
+ $WHATs[] = 'unlock_surfbar_urls';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE');
+ } // END - if
// Generate extra overview rows
- $EXTRAS .= TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs);
+ $EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs);
// If empty just keep a forced-space left for CSS issues
- if (empty($EXTRAS)) $EXTRAS = " ";
+ if (empty($EXTRAS)) $EXTRAS = ' ';
// Add compiled string to constant for final template
- define('__OVERVIEW_EXTRA_TABLE', $EXTRAS);
+ $content['extra_table'] = $EXTRAS;
// Simply load the template... :-)
- LOAD_TEMPLATE("admin_overview_task");
+ loadTemplate('admin_overview_task', false, $content);
}
//
-function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){
- // Init
- $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__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
-
- $content = array(
- 'row_descr' => $DESCRs[$key],
- 'row_sw' => $SW,
- 'bottom' => "",
- );
-
- if ($key < $MAX) $content['bottom'] = "bottom2";
- if (($value > 0) && (!empty($WHATs[$key]))) {
- if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
- $content['row_link'] = "<A href=\"".URL."/modules.php?module=admin&what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</A>";
- } else {
- $content['row_link'] = "0";
- }
+function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
+ // Init variables
+ $OUT = ''; $SW = 2;
+
+ // 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 = SQL_QUERY($sql, __FUNCTION__, __LINE__);
+
+ // Get rows
+ $value = SQL_NUMROWS($result);
- // Switch color
- $SW = 3 - $SW;
+ // Free result
+ SQL_FREERESULT($result);
- // And insert the final string into extras template
- $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content);
- }
+ // Prepare array for output
+ $content = array(
+ 'row_descr' => $DESCRs[$key],
+ 'row_sw' => $SW,
+ 'bottom' => '',
+ );
+
+ // Rewrite CSS class if not last entry is reached
+ if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom2';
+
+ if (($value > 0) && (!empty($WHATs[$key]))) {
+ if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('ADMIN_TASK_UNKNOWN_LIST_TITLE');
+ $content['row_link'] = "<a href=\"{?URL?}/modules.php?module=admin&what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</a>";
+ } else {
+ $content['row_link'] = 0;
+ }
+
+ // And insert the final string into extras template
+ $OUT .= loadTemplate('admin_overview_task_rows', true, $content);
- // Return output
- return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);
+ // Switch color
+ $SW = 3 - $SW;
+ } // END- foreach
+ } // END - foreach
+
+ // Return output in the template
+ return loadTemplate('admin_overview_task_extras', true, $OUT);
}
+
//
?>