X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Flibs%2Ftask_functions.php;h=78c842db866f7652e2e66b17c2614bce80a862bf;hb=0fa7740aae24eacd2b7215fb43e8717a1bb281d7;hp=426309f2218c912cc890be037842be19cae3dac8;hpb=dbe56bb043ba16ca1ec1e9efa9effdc1f0612261;p=mailer.git
diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php
index 426309f221..78c842db86 100644
--- a/inc/libs/task_functions.php
+++ b/inc/libs/task_functions.php
@@ -10,7 +10,12 @@
* -------------------------------------------------------------------- *
* 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 *
* For more information visit: http://www.mxchange.org *
@@ -33,7 +38,7 @@
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
}
@@ -45,514 +50,507 @@ if (!defined('__SECURITY')) {
// - Your own tasks
// - ...
//
-function OUTPUT_ADVANCED_OVERVIEW (&$result_main)
-{
- global $_CONFIG;
-
+// @TODO Move all extension-dependent queries into filters
+function OUTPUT_ADVANCED_OVERVIEW (&$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);
+ $jobsDone = 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(get_session('admin_login'))), __FILE__, __LINE__);
+ // Init SQLs
+ INIT_SQLS();
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ if (!$jobsDone) {
+ // New extensions or updates found
+ $value = GET_TOTAL_DATA(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
if ($value > 0) {
- define('__TASK_UPDATE_VALUE', "".$value."");
+ define('__TASK_UPDATE_VALUE', "".$value."");
} else {
- define('__TASK_UPDATE_VALUE', "0");
+ define('__TASK_UPDATE_VALUE', '0');
}
} else {
- define('__TASK_UPDATE_VALUE', "0");
+ define('__TASK_UPDATE_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- define('__CONFIRMED_VALUE', "".$value."");
+ define('__CONFIRMED_VALUE', "".$value."");
} else {
- define('__CONFIRMED_VALUE', "0");
+ define('__CONFIRMED_VALUE', '0');
}
// 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 = GET_TOTAL_DATA('UNCONFIRMED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- define('__UNCONFIRMED_VALUE', "".$value."");
+ define('__UNCONFIRMED_VALUE', "".$value."");
} else {
- define('__UNCONFIRMED_VALUE', "0");
+ define('__UNCONFIRMED_VALUE', '0');
}
// 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);
+ $value = GET_TOTAL_DATA('LOCKED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- define('__LOCKED_VALUE', "".$value."");
+ define('__LOCKED_VALUE', "".$value."");
} else {
- define('__LOCKED_VALUE', "0");
+ define('__LOCKED_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('0', 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
if ($value > 0) {
- define('__TASK_NEW_VALUE', "".$value."");
+ define('__TASK_NEW_VALUE', "".$value."");
} else {
- define('__TASK_NEW_VALUE', "0");
+ define('__TASK_NEW_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('CLOSED', 'task_system', 'id', 'status', true);
if ($value > 0) {
- define('__TASK_CLOSED_VALUE', "".$value."");
+ define('__TASK_CLOSED_VALUE', "".$value."");
} else {
- define('__TASK_CLOSED_VALUE', "0");
+ define('__TASK_CLOSED_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('DELETED', 'task_system', 'id', 'status', true);
if ($value > 0) {
- define('__TASK_DELETED_VALUE', "".$value."");
+ define('__TASK_DELETED_VALUE', "".$value."");
} else {
- define('__TASK_DELETED_VALUE', "0");
+ define('__TASK_DELETED_VALUE', '0');
}
//
// Solved tasks
//
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'SOLVED' AND assigned_admin='%s'",
- array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = GET_TOTAL_DATA('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
if ($value > 0) {
- define('__TASK_SOLVED_VALUE', "".$value."");
+ define('__TASK_SOLVED_VALUE', "".$value."");
} else {
- define('__TASK_SOLVED_VALUE', "0");
+ define('__TASK_SOLVED_VALUE', '0');
}
//
// 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(get_session('admin_login'))), __FILE__, __LINE__);
- $value = SQL_NUMROWS($result);
- SQL_FREERESULT($result);
+ $value = GET_TOTAL_DATA(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
if ($value > 0) {
- define('__TASK_YOUR_VALUE', "".$value."");
+ define('__TASK_YOUR_VALUE', "".$value."");
} else {
- define('__TASK_YOUR_VALUE', "0");
+ define('__TASK_YOUR_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('ADMIN', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_ADMIN_VALUE', "".$value."");
+ define('__MAIL_ADMIN_VALUE', "".$value."");
} else {
- define('__MAIL_ADMIN_VALUE', "0");
+ define('__MAIL_ADMIN_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('TEMP', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_TEMP_VALUE', "".$value."");
+ define('__MAIL_TEMP_VALUE', "".$value."");
} else {
- define('__MAIL_TEMP_VALUE', "0");
+ define('__MAIL_TEMP_VALUE', '0');
}
//
// 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 = GET_TOTAL_DATA('SEND', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_SEND_VALUE', "".$value."");
+ define('__MAIL_SEND_VALUE', "".$value."");
} else {
- define('__MAIL_SEND_VALUE', "0");
+ define('__MAIL_SEND_VALUE', '0');
}
//
// 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 (EXT_IS_ACTIVE('autopurge')) {
+ // Get auto-purged mails
+ $value = GET_TOTAL_DATA('DELETED', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_DELETED_VALUE', "".$value."");
+ define('__MAIL_DELETED_VALUE', "".$value."");
} else {
- define('__MAIL_DELETED_VALUE', "0");
+ define('__MAIL_DELETED_VALUE', '0');
}
//
// 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 (GET_EXT_VERSION('bonus') >= '0.1.8') {
+ // Get auto-purged bonus mails
+ $value = GET_TOTAL_DATA('DELETED', 'bonus', 'id', 'data_type', true);
if ($value > 0) {
- define('__MAIL_BONUS_AP_VALUE', "".$value."");
+ define('__MAIL_BONUS_AP_VALUE', "".$value."");
} else {
- define('__MAIL_BONUS_AP_VALUE', "0");
+ 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);
+ } elseif (EXT_IS_ACTIVE('bonus')) {
+ define('__MAIL_BONUS_AP_VALUE', sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED', '0.1.8')));
} else {
- define('__MAIL_BONUS_AP_VALUE', "".ADMIN_EXT_BONUS_404."");
+ define('__MAIL_BONUS_AP_VALUE', "{--ADMIN_EXT_BONUS_404--}");
}
} else {
- define('__MAIL_BONUS_AP_VALUE', "".ADMIN_EXT_AUTOPURGE_404."");
- define('__MAIL_DELETED_VALUE', "".ADMIN_EXT_AUTOPURGE_404."");
+ define('__MAIL_BONUS_AP_VALUE', "{--ADMIN_EXT_AUTOPURGE_404--}");
+ define('__MAIL_DELETED_VALUE', "{--ADMIN_EXT_AUTOPURGE_404--}");
}
//
// 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 (GET_EXT_VERSION('bonus') >= '0.1.8') {
+ // Get sent bonus mails (but not notifications)
+ $value = GET_TOTAL_DATA('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'");
if ($value > 0) {
- define('__MAIL_BONUS_SEND_VALUE', "".$value."");
+ define('__MAIL_BONUS_SEND_VALUE', "".$value."");
} else {
- define('__MAIL_BONUS_SEND_VALUE', "0");
+ 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);
+ } elseif (EXT_IS_ACTIVE('bonus')) {
+ define('__MAIL_BONUS_SEND_VALUE', sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED', '0.1.8')));
} else {
- define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_404);
+ define('__MAIL_BONUS_SEND_VALUE', getMessage('ADMIN_EXT_BONUS_404'));
}
- if (EXT_IS_ACTIVE("autopurge")) {
+ if (EXT_IS_ACTIVE('autopurge')) {
// Start finding them...
- $since = $_CONFIG['ap_inactive_since'];
- $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['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 != ".$_CONFIG['beg_uid']."";
- if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid']."";
- if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid']."";
- if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+ // @TODO These can be rewritten to filter
+ if (EXT_IS_ACTIVE('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
+ if (EXT_IS_ACTIVE('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
+ if (EXT_IS_ACTIVE('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
+ if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
// Check for all accounts
- $SQLs[] = "SELECT DISTINCT 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 < ".$since." AND d.ap_notified < ".$since."
+ ADD_SQL("SELECT DISTINCT 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");
+ $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[] = TASK_ADMIN_LIST_ACCOUNT_NOREF;
- $TITLEs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE;
- $WHATs[] = "list_norefs";
+ if (GET_EXT_VERSION('sql_patches') >= '0.3.4') {
+ // Check for accounts without referal
+ ADD_SQL("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 (EXT_IS_ACTIVE('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;
+ ADD_SQL("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');
+ ADD_SQL("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 (EXT_IS_ACTIVE('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;
+ ADD_SQL("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 (EXT_IS_ACTIVE("primera")) {
+ if (EXT_IS_ACTIVE('primera')) {
// List new primera requests
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_primera ORDER BY userid";
- $WHATs[] = "list_primera";
- $DESCRs[] = TASK_ADMIN_LIST_PRIMERA_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_PRIMERA_ALL_TITLE;
+ ADD_SQL("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 (EXT_IS_ACTIVE('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;
+ ADD_SQL("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 (GET_EXT_VERSION('bonus') >= '0.8.7') {
+ // List all notifications
+ ADD_SQL("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 (GET_EXT_VERSION('bonus') >= '0.2.3') {
// Active rallye
- if (GET_EXT_VERSION("bonus") >= "0.6.9") {
+ if (GET_EXT_VERSION('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 = "";
- if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+ $lastOnline = '';
+ if ((EXT_IS_ACTIVE('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
// Use last online timestamp to keep inactive members away from here
- $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+ $lastOnline = sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
}
- $SQLs[] = "SELECT ".$USE." AS active_bonus FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."
-ORDER BY active_bonus DESC, userid";
- $WHATs[] = "list_bonus";
- $DESCRs[] = TASK_ADMIN_LIST_BONUS;
- $TITLEs[] = TASK_ADMIN_LIST_BONUS_TITLE;
+ ADD_SQL("SELECT ".$USE." AS points
+FROM `{!_MYSQL_PREFIX!}_user_data`
+WHERE `status`='CONFIRMED' AND ".$USE.">0".$lastOnline."
+ORDER BY points DESC, userid");
+ $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 (GET_EXT_VERSION('beg') >= '0.1.2') {
// Begging rallye
// Autopurge installed?
- $LAST = "";
- if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+ $lastOnline = '';
+ if ((EXT_IS_ACTIVE('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
// Use last online timestamp to keep inactive members away from here
- $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+ $lastOnline = sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
}
- $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND beg_points>0".$LAST."
-ORDER BY beg_points DESC, userid";
- $WHATs[] = "list_beg";
- $DESCRs[] = TASK_ADMIN_LIST_BEG;
- $TITLEs[] = TASK_ADMIN_LIST_BEG_TITLE;
+ ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data`
+WHERE `status`='CONFIRMED' AND beg_points>0".$lastOnline."
+ORDER BY beg_points DESC, userid");
+ $WHATs[] = 'list_beg';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_BEG');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_BEG_TITLE');
}
- if (EXT_IS_ACTIVE("doubler")) {
+ if (EXT_IS_ACTIVE('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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' ORDER BY `id`");
+ $WHATs[] = 'list_doubler&mode=waiting&select=all';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE');
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_doubler` ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refbanner` ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `visible`='Y' ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_extensions` ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_active`='Y' ORDER BY `id`");
+ $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 (EXT_IS_ACTIVE('engine')) {
// List all export accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts ORDER BY id";
- $WHATs[] = "list_engine";
- $DESCRs[] = TASK_ADMIN_LIST_ENGINE;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_accounts` ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_accounts` WHERE `status`='UNCONFIRMED' ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_safe` ORDER BY `id`");
+ $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;
- }
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_urls` ORDER BY `id`");
+ $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 (EXT_IS_ACTIVE('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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='CONFIRMED' ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='UNCONFIRMED' ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='LOCKED' ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='PENDING' ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE `pay_status`='PENDING' ORDER BY `id`");
+ $WHATs[] = 'list_sponsor_pays';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_ORDERS');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_ORDERS_TITLE');
}
- if (EXT_IS_ACTIVE("country")) {
+ if (EXT_IS_ACTIVE('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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY `id`");
+ $WHATs[] = 'list_country';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_COUNTRY');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_COUNTRY_TITLE');
}
- if (EXT_IS_ACTIVE("theme")) {
+ if (EXT_IS_ACTIVE('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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY `id`");
+ $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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_active='Y' ORDER BY `id`");
+ $WHATs[] = 'theme_edit';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_THEME_ACTIVE');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_THEME_ACTIVE_TITLE');
}
- if (EXT_IS_ACTIVE("admins")) {
+ if (EXT_IS_ACTIVE('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;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`");
+ $WHATs[] = 'admins_edit';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_ADMINS_ALL');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_ADMINS_ALL_TITLE');
}
- if (EXT_IS_ACTIVE("surfbar")) {
+ if (EXT_IS_ACTIVE('surfbar')) {
// List all URLs in surfbar
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_surfbar_urls ORDER BY id";
- $WHATs[] = "list_surfbar_urls";
- $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL;
- $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL_TITLE;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_surfbar_urls` ORDER BY `id`");
+ $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
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_surfbar_urls WHERE status='PENDING' ORDER BY id";
- $WHATs[] = "unlock_surfbar_urls";
- $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING;
- $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE;
+ ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE `status`='PENDING' ORDER BY `id`");
+ $WHATs[] = 'unlock_surfbar_urls';
+ $DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING');
+ $TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE');
}
// Generate extra overview rows
- $EXTRAS .= TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs);
+ $EXTRAS .= TASK_CREATE_EXTRA_ROWS($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);
// Simply load the template... :-)
- LOAD_TEMPLATE("admin_overview_task");
+ LOAD_TEMPLATE('admin_overview_task');
}
//
-function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){
- // Init
- $OUT = ""; $SW = 2; $MAX = sizeof($SQLs) - 1;
- foreach ($SQLs as $key => $sql) {
+function TASK_CREATE_EXTRA_ROWS ($WHATs, $DESCRs, $TITLEs) {
+ // Init variables
+ $OUT = ''; $SW = 2;
+
+ // Sadly this cannot be rewritten to a filter... :(
+ foreach (GET_SQLS() as $key => $sql) {
// Run SQL command, get line numbers and free memory
- $result = SQL_QUERY($sql, __FILE__, __LINE__);
+ $result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
// Get rows
$value = SQL_NUMROWS($result);
@@ -560,29 +558,33 @@ function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){
// Free result
SQL_FREERESULT($result);
+ // Prepare array for output
$content = array(
'row_descr' => $DESCRs[$key],
'row_sw' => $SW,
- 'bottom' => "",
+ 'bottom' => '',
);
- if ($key < $MAX) $content['bottom'] = "bottom2";
+ // 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] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
- $content['row_link'] = "".$value."";
+ if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('ADMIN_TASK_UNKNOWN_LIST_TITLE');
+ $content['row_link'] = "".$value."";
} else {
$content['row_link'] = 0;
}
+ // And insert the final string into extras template
+ $OUT .= LOAD_TEMPLATE('admin_overview_task_rows', true, $content);
+
// Switch color
$SW = 3 - $SW;
-
- // And insert the final string into extras template
- $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content);
} // END - if
- // Return output
- return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);
+ // Return output in the template
+ return LOAD_TEMPLATE('admin_overview_task_extras', true, $OUT);
}
+
//
?>