2 /************************************************************************
3 * MXChange v0.2.1 Start: 08/03/2004 *
4 * ================ Last change: 11/19/2005 *
6 * -------------------------------------------------------------------- *
7 * File : task_functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Special task functions *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Spezielle task-Funktionen *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
41 // The advanced overview shows detailed informations to your exchange script:
42 // - Unconfirmed / locked accounts
43 // - Mails waiting to be approved
48 function OUTPUT_ADVANCED_OVERVIEW (&$result_main)
52 // Init variables/arrays
60 // Chheck for new extensions and updates
61 $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_main);
64 // New extensions or updates found
65 $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND status='NEW' AND task_type='EXTENSION_UPDATE'");
68 define('__TASK_UPDATE_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=updates\">".$value."</A>");
70 define('__TASK_UPDATE_VALUE', "0");
73 define('__TASK_UPDATE_VALUE', "0");
77 // First check for all account status seperately
80 $value = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
83 define('__CONFIRMED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_user&status=confirmed\">".$value."</A>");
85 define('__CONFIRMED_VALUE', "0");
88 // Unconfirmed accounts
89 $value = GET_TOTAL_DATA("UNCONFIRMED", "user_data", "userid", "status", true);
92 define('__UNCONFIRMED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=chk_regs\">".$value."</A>");
94 define('__UNCONFIRMED_VALUE', "0");
97 // And locked accounts
98 $value = GET_TOTAL_DATA("LOCKED", "user_data", "userid", "status", true);
101 define('__LOCKED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_user&status=locked\">".$value."</A>");
103 define('__LOCKED_VALUE', "0");
109 $value = GET_TOTAL_DATA("0", "task_system", "id", "assigned_admin", true, " AND `status` != 'DELETED'");
112 define('__TASK_NEW_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=unassigned\">".$value."</A>");
114 define('__TASK_NEW_VALUE', "0");
120 $value = GET_TOTAL_DATA("CLOSED", "task_system", "id", "status", true);
123 define('__TASK_CLOSED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=closed\">".$value."</A>");
125 define('__TASK_CLOSED_VALUE', "0");
131 $value = GET_TOTAL_DATA("DELETED", "task_system", "id", "status", true);
134 define('__TASK_DELETED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=deleted\">".$value."</A>");
136 define('__TASK_DELETED_VALUE', "0");
142 $value = GET_TOTAL_DATA("SOLVED", "task_system", "id", "status", true, sprintf(" AND assigned_admin=%s", GET_CURRENT_ADMIN_ID()));
145 define('__TASK_SOLVED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task&type=solved\">".$value."</A>");
147 define('__TASK_SOLVED_VALUE', "0");
153 $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND status = 'NEW' AND task_type != 'EXTENSION_UPDATE'");
156 define('__TASK_YOUR_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=list_task\">".$value."</A>");
158 define('__TASK_YOUR_VALUE', "0");
162 // Mails waiting to be approved
164 $value = GET_TOTAL_DATA("ADMIN", "pool", "id", "data_type", true);
167 define('__MAIL_ADMIN_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=unlock_emails\">".$value."</A>");
169 define('__MAIL_ADMIN_VALUE', "0");
173 // Unfinished mail orders
175 $value = GET_TOTAL_DATA("TEMP", "pool", "id", "data_type", true);
178 define('__MAIL_TEMP_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
180 define('__MAIL_TEMP_VALUE', "0");
186 $value = GET_TOTAL_DATA("SEND", "pool", "id", "data_type", true);
189 define('__MAIL_SEND_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_archiv\">".$value."</A>");
191 define('__MAIL_SEND_VALUE', "0");
197 if (EXT_IS_ACTIVE("autopurge")) {
198 // Get auto-purged mails
199 $value = GET_TOTAL_DATA("DELETED", "pool", "id", "data_type", true);
202 define('__MAIL_DELETED_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
204 define('__MAIL_DELETED_VALUE', "0");
208 // Autopurged bonus mails
210 if (GET_EXT_VERSION("bonus") >= "0.1.8") {
211 // Get auto-purged bonus mails
212 $value = GET_TOTAL_DATA("DELETED", "bonus", "id", "data_type", true);
215 define('__MAIL_BONUS_AP_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
217 define('__MAIL_BONUS_AP_VALUE', "0");
219 } elseif (EXT_IS_ACTIVE("bonus")) {
220 define('__MAIL_BONUS_AP_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
222 define('__MAIL_BONUS_AP_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_BONUS_404."</FONT>");
225 define('__MAIL_BONUS_AP_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</FONT>");
226 define('__MAIL_DELETED_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</FONT>");
232 if (GET_EXT_VERSION("bonus") >= "0.1.8") {
233 // Get sent bonus mails (but not notifications)
234 $value = GET_TOTAL_DATA("SEND", "bonus", "id", "data_type", true, " AND is_notify='N'");
237 define('__MAIL_BONUS_SEND_VALUE', "<A href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</A>");
239 define('__MAIL_BONUS_SEND_VALUE', "0");
241 } elseif (EXT_IS_ACTIVE("bonus")) {
242 define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
244 define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_404);
247 if (EXT_IS_ACTIVE("autopurge")) {
248 // Start finding them...
249 $since = getConfig('ap_inactive_since');
251 if (getConfig('def_refid') > 0) {
252 $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid')."";
255 // Check for more extensions
256 if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
257 if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
258 if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
259 if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'";
261 // Check for all accounts
262 $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online
263 FROM `"._MYSQL_PREFIX."_user_data` AS d
264 WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND d.ap_notified < (UNIX_TIMESTAMP() - ".$since.")
267 $WHATs[] = "list_autopurge";
268 $DESCRs[] = TASK_ADMIN_INACTIVE_AUTOPURGE;
269 $TITLEs[] = TASK_ADMIN_INACTIVE_AUTOPURGE_TITLE;
272 if (GET_EXT_VERSION("sql_patches") >= "0.3.4") {
273 // Check for accounts without referal
274 $SQLs[] = "SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE refid='0' ORDER BY userid";
275 $DESCRs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF;
276 $TITLEs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE;
277 $WHATs[] = "list_user&mode=norefs";
280 if (EXT_IS_ACTIVE("payout")) {
281 // List new payout requests
282 $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_payouts WHERE status='NEW' ORDER BY userid";
283 $WHATs[] = "list_payouts";
284 $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING;
285 $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE;
286 $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_payouts ORDER BY userid";
287 $WHATs[] = "list_payouts";
288 $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_ALL;
289 $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_ALL_TITLE;
292 if (EXT_IS_ACTIVE("wernis")) {
293 // List new wernis requests
294 $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_wernis ORDER BY userid";
295 $WHATs[] = "list_wernis";
296 $DESCRs[] = TASK_ADMIN_LIST_WERNIS_ALL;
297 $TITLEs[] = TASK_ADMIN_LIST_WERNIS_ALL_TITLE;
300 if (EXT_IS_ACTIVE("primera")) {
301 // List new primera requests
302 $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_primera ORDER BY userid";
303 $WHATs[] = "list_primera";
304 $DESCRs[] = TASK_ADMIN_LIST_PRIMERA_ALL;
305 $TITLEs[] = TASK_ADMIN_LIST_PRIMERA_ALL_TITLE;
308 if (EXT_IS_ACTIVE("holiday")) {
309 // List holiday requests
310 $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_holidays ORDER BY userid";
311 $WHATs[] = "list_holiday";
312 $DESCRs[] = TASK_ADMIN_LIST_HOLIDAYS;
313 $TITLEs[] = TASK_ADMIN_LIST_HOLIDAYS_TITLE;
316 if (GET_EXT_VERSION("bonus") >= "0.8.7") {
317 // List all notifications
318 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE is_notify='Y' ORDER BY timestamp DESC";
319 $WHATs[] = "list_notifications";
320 $DESCRs[] = TASK_ADMIN_LIST_NOTIFICATIONS;
321 $TITLEs[] = TASK_ADMIN_LIST_NOTIFICATIONS_TITLE;
324 if (GET_EXT_VERSION("bonus") >= "0.2.3") {
326 if (GET_EXT_VERSION("bonus") >= "0.6.9") {
327 // Add more bonus points here
329 if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus";
330 if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus";
331 if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order";
332 if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats";
333 if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref";
337 $USE = "turbo_bonus";
340 // Autopurge installed?
342 if ((EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) {
343 // Use last online timestamp to keep inactive members away from here
344 $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
347 $SQLs[] = "SELECT ".$USE." AS points
348 FROM "._MYSQL_PREFIX."_user_data
349 WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."
350 ORDER BY points DESC, userid";
351 $WHATs[] = "list_bonus";
352 $DESCRs[] = TASK_ADMIN_LIST_BONUS;
353 $TITLEs[] = TASK_ADMIN_LIST_BONUS_TITLE;
356 if (GET_EXT_VERSION("beg") >= "0.1.2") {
359 // Autopurge installed?
361 if ((EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) {
362 // Use last online timestamp to keep inactive members away from here
363 $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
366 $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data
367 WHERE status='CONFIRMED' AND beg_points>0".$LAST."
368 ORDER BY beg_points DESC, userid";
369 $WHATs[] = "list_beg";
370 $DESCRs[] = TASK_ADMIN_LIST_BEG;
371 $TITLEs[] = TASK_ADMIN_LIST_BEG_TITLE;
374 if (EXT_IS_ACTIVE("doubler")) {
375 // List waiting payouts
376 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' ORDER BY id";
377 $WHATs[] = "list_doubler&mode=waiting&select=all";
378 $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_WAITING;
379 $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_WAITING_TITLE;
380 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_doubler ORDER BY id";
381 $WHATs[] = "list_doubler";
382 $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_ALL;
383 $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_ALL_TITLE;
387 // All referal banner
389 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner ORDER BY id";
390 $WHATs[] = "refbanner";
391 $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ALL;
392 $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ALL_TITLE;
395 // All activated referal banner
397 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner WHERE visible='Y' ORDER BY id";
398 $WHATs[] = "refbanner";
399 $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE;
400 $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE_TITLE;
405 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_extensions ORDER BY id";
406 $WHATs[] = "extensions";
407 $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL;
408 $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL_TITLE;
411 // All activated extensions
413 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_active='Y' ORDER BY id";
414 $WHATs[] = "extensions&active=Y";
415 $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE;
416 $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE_TITLE;
418 if (EXT_IS_ACTIVE("engine")) {
419 // List all export accounts
420 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts ORDER BY id";
421 $WHATs[] = "list_engine";
422 $DESCRs[] = TASK_ADMIN_LIST_ENGINE;
424 // List all pending accounts
425 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts WHERE status='UNCONFIRMED' ORDER BY id";
426 $WHATs[] = "unlock_engine";
427 $DESCRs[] = TASK_ADMIN_UNLOCK_ENGINE;
430 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_safe ORDER BY id";
431 $WHATs[] = "list_engine&mode=safe";
432 $DESCRs[] = TASK_ADMIN_LIST_ENGINE_SAFES;
434 // List all export URLs
435 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_urls ORDER BY id";
436 $WHATs[] = "engine_urls";
437 $DESCRs[] = TASK_ADMIN_LIST_ENGINE_URLS;
440 if (EXT_IS_ACTIVE("sponsor")) {
442 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data ORDER BY id";
443 $WHATs[] = "list_sponsor";
444 $DESCRs[] = TASK_ADMIN_LIST_SPONSOR;
445 $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_TITLE;
447 // List confirmed sponsor accounts
448 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='CONFIRMED' ORDER BY id";
449 $WHATs[] = "list_sponsor";
450 $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED;
451 $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE;
453 // List unconfirmed sponsor accounts
454 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='UNCONFIRMED' ORDER BY id";
455 $WHATs[] = "list_sponsor";
456 $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED;
457 $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE;
459 // List locked sponsor accounts
460 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='LOCKED' ORDER BY id";
461 $WHATs[] = "list_sponsor";
462 $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED;
463 $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE;
465 // List waiting sponsor accounts to be approved
466 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='PENDING' ORDER BY id";
467 $WHATs[] = "unlock_sponsor";
468 $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_PENDING;
469 $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE;
472 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_orders WHERE pay_status='PENDING' ORDER BY id";
473 $WHATs[] = "list_sponsor_pays";
474 $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS;
475 $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE;
478 if (EXT_IS_ACTIVE("country")) {
479 // List country codes
480 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_countries ORDER BY id";
481 $WHATs[] = "list_country";
482 $DESCRs[] = TASK_ADMIN_LIST_COUNTRY;
483 $TITLEs[] = TASK_ADMIN_LIST_COUNTRY_TITLE;
486 if (EXT_IS_ACTIVE("theme")) {
488 $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_themes` ORDER BY id";
489 $WHATs[] = "theme_edit";
490 $DESCRs[] = TASK_ADMIN_LIST_THEME_ALL;
491 $TITLEs[] = TASK_ADMIN_LIST_THEME_ALL_TITLE;
493 // List active themes
494 $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_themes` WHERE theme_active='Y' ORDER BY id";
495 $WHATs[] = "theme_edit";
496 $DESCRs[] = TASK_ADMIN_LIST_THEME_ACTIVE;
497 $TITLEs[] = TASK_ADMIN_LIST_THEME_ACTIVE_TITLE;
500 if (EXT_IS_ACTIVE("admins")) {
501 // List all administrator logins
502 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_admins ORDER BY id";
503 $WHATs[] = "admins_edit";
504 $DESCRs[] = TASK_ADMIN_LIST_ADMINS_ALL;
505 $TITLEs[] = TASK_ADMIN_LIST_ADMINS_ALL_TITLE;
508 if (EXT_IS_ACTIVE("surfbar")) {
509 // List all URLs in surfbar
510 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_surfbar_urls ORDER BY id";
511 $WHATs[] = "list_surfbar_urls";
512 $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL;
513 $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL_TITLE;
515 // List all pending URLs in surfbar
516 $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_surfbar_urls WHERE status='PENDING' ORDER BY id";
517 $WHATs[] = "unlock_surfbar_urls";
518 $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING;
519 $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE;
522 // Generate extra overview rows
523 $EXTRAS .= TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs);
525 // If empty just keep a forced-space left for CSS issues
526 if (empty($EXTRAS)) $EXTRAS = " ";
528 // Add compiled string to constant for final template
529 define('__OVERVIEW_EXTRA_TABLE', $EXTRAS);
531 // Simply load the template... :-)
532 LOAD_TEMPLATE("admin_overview_task");
536 function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){
538 $OUT = ""; $SW = 2; $MAX = sizeof($SQLs) - 1;
539 foreach ($SQLs as $key => $sql) {
540 // Run SQL command, get line numbers and free memory
541 $result = SQL_QUERY($sql, __FILE__, __LINE__);
544 $value = SQL_NUMROWS($result);
547 SQL_FREERESULT($result);
550 'row_descr' => $DESCRs[$key],
555 if ($key < $MAX) $content['bottom'] = "bottom2";
556 if (($value > 0) && (!empty($WHATs[$key]))) {
557 if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
558 $content['row_link'] = "<A href=\"".URL."/modules.php?module=admin&what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</A>";
560 $content['row_link'] = 0;
566 // And insert the final string into extras template
567 $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content);
571 return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);