2 /************************************************************************
3 * Mailer v0.2.1-FINAL 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 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * Copyright (c) 2009, 2010 by Mailer Developer Team *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
46 // The advanced overview shows detailed informations to your exchange script:
47 // - Unconfirmed / locked accounts
48 // - Mails waiting to be approved
53 // @TODO Move all extension-dependent queries into filters
54 function outputAdvancedOverview (&$result_main) {
55 // Init variables/arrays
62 // Chheck for new extensions and updates
63 $jobsDone = outputStandardOverview($result_main);
72 'confirmed_members','unconfirmed_members','locked_members',
74 'update_tasks','new_tasks','closed_tasks','your_tasks','deleted_tasks','solved_tasks',
76 'pending_mails','canceled_mails','send_emails',
80 'purged_mails','purged_bonus_mails'
83 $content[$entry] = '0';
86 // Extension updates found
87 $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
90 $content['update_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=updates%}">' . $value . '</a>';
94 // First check for all account status seperately
97 $value = getTotalConfirmedUser();
100 $content['confirmed_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=confirmed%}">' . $value . '</a>';
103 // Unconfirmed accounts
104 $value = getTotalUnconfirmedUser();
107 $content['unconfirmed_members'] = '<a href="{%url=modules.php?module=admin&what=chk_regs%}">' . $value . '</a>';
111 // And locked accounts
112 $value = getTotalLockedUser();
114 $content['locked_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=locked%}">' . $value . '</a>';
120 $value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
123 $content['new_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=unassigned%}">' . $value . '</a>';
129 $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', true);
132 $content['closed_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=closed%}">' . $value . '</a>';
138 $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', true);
141 $content['deleted_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=deleted%}">' . $value . '</a>';
147 $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
150 $content['solved_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=solved%}">' . $value . '</a>';
156 $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
159 $content['your_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task%}">' . $value . '</a>';
163 // Mails waiting to be approved
165 $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', true);
168 $content['pending_mails'] = '<a href="{%url=modules.php?module=admin&what=unlock_emails%}">' . $value . '</a>';
172 // Unfinished mail orders
174 $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', true);
177 $content['canceled_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
183 $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', true);
186 $content['send_emails'] = '<a href="{%url=modules.php?module=admin&what=email_archiv%}">' . $value . '</a>';
192 if (isExtensionActive('autopurge')) {
193 // Get auto-purged mails
194 $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', true);
197 $content['purged_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
201 // Autopurged bonus mails
203 if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
204 // Get auto-purged bonus mails
205 $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', true);
208 $content['purged_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
210 } elseif (isExtensionActive('bonus')) {
211 $content['purged_bonus_mails'] = getMaskedMessage('ADMIN_EXTENSION_BONUS_OUTDATED', '0.1.8');
213 $content['purged_bonus_mails'] = '<span class="admin_note">{--ADMIN_EXTENSION_BONUS_404--}</span>';
216 $content['purged_bonus_mails'] = '<span class="admin_note">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
217 $content['purged_mails'] = '<span class="admin_note">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
223 if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
224 // Get sent bonus mails (but not notifications)
225 $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'");
228 $content['send_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
230 } elseif (isExtensionActive('bonus')) {
231 $content['send_bonus_mails'] = getMaskedMessage('ADMIN_EXTENSION_BONUS_OUTDATED', '0.1.8');
233 $content['send_bonus_mails'] = '{--ADMIN_EXTENSION_BONUS_404--}';
236 if (isExtensionActive('autopurge')) {
237 // Start finding them...
240 // Check for more extensions
241 // @TODO These can be rewritten to filter
242 if (getConfig('def_refid') > 0) $EXCLUDE_LIST .= ' AND d.userid != {?def_refid?}';
243 if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
244 if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
245 if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
246 if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
247 // Recent ext-holiday found
248 $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
251 // Check for all accounts
253 d.userid, d.email, d.last_online
255 `{?_MYSQL_PREFIX?}_user_data` AS d
257 d.`status`='CONFIRMED' AND
258 d.joined < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
259 d.last_online < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
260 d.ap_notified < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
264 $WHATs[] = 'list_autopurge';
265 $DESCRs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE--}';
266 $TITLEs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE--}';
269 if (isExtensionInstalledAndNewer('sql_patches', '0.3.4')) {
270 // Check for accounts without referal
271 addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 ORDER BY `userid` ASC");
272 $DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREF--}';
273 $TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NOREFERAL_TITLE--}';
274 $WHATs[] = 'list_user&mode=norefs';
277 if (isExtensionActive('payout')) {
278 // List new payout requests
279 addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY `userid` ASC");
280 $WHATs[] = 'list_payouts';
281 $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING--}';
282 $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING_TITLE--}';
283 addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC");
284 $WHATs[] = 'list_payouts';
285 $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL--}';
286 $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE--}';
289 if (isExtensionActive('wernis')) {
290 // List new wernis requests
291 addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC");
292 $WHATs[] = 'list_wernis';
293 $DESCRs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL--}';
294 $TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}';
297 if (isExtensionActive('primera')) {
298 // List new primera requests
299 addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC");
300 $WHATs[] = 'list_primera';
301 $DESCRs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL--}';
302 $TITLEs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL_TITLE--}';
305 if (isExtensionActive('holiday')) {
306 // List holiday requests
307 addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC");
308 $WHATs[] = 'list_holiday';
309 $DESCRs[] = '{--ADMIN_TASK_LIST_HOLIDAYS--}';
310 $TITLEs[] = '{--ADMIN_TASK_LIST_HOLIDAYS_TITLE--}';
313 if (isExtensionInstalledAndNewer('bonus', '0.8.7')) {
314 // List all notifications
315 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `is_notify`='Y' ORDER BY `timestamp` DESC");
316 $WHATs[] = 'list_notifications';
317 $DESCRs[] = '{--ADMIN_TASK_LIST_NOTIFICATIONS--}';
318 $TITLEs[] = '{--ADMIN_TASK_LIST_NOTIFICATIONS_TITLE--}';
321 if (isExtensionInstalledAndNewer('bonus', '0.2.3')) {
323 if (isExtensionInstalledAndNewer('bonus', '0.6.9')) {
324 // Add more bonus points here
326 if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`';
327 if (getConfig('bonus_login_yn') == 'Y') $USE .= ' + `login_bonus`';
328 if (getConfig('bonus_order_yn') == 'Y') $USE .= ' + `bonus_order`';
329 if (getConfig('bonus_stats_yn') == 'Y') $USE .= ' + `bonus_stats`';
330 if (getConfig('bonus_ref_yn') == 'Y') $USE .= ' + `bonus_ref`';
334 $USE = 'turbo_bonus';
337 // Autopurge installed?
339 if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
340 // Use last online timestamp to keep inactive members away from here
341 $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
347 `{?_MYSQL_PREFIX?}_user_data`
349 `status`='CONFIRMED' AND ".$USE." > 0".$lastOnline."
353 $WHATs[] = 'list_bonus';
354 $DESCRs[] = '{--ADMIN_TASK_LIST_BONUS--}';
355 $TITLEs[] = '{--ADMIN_TASK_LIST_BONUS_TITLE--}';
358 if (isExtensionInstalledAndNewer('beg', '0.1.2')) {
361 // Autopurge installed?
363 if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
364 // Use last online timestamp to keep inactive members away from here
365 $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
371 `{?_MYSQL_PREFIX?}_user_data`
373 `status`='CONFIRMED' AND
379 $WHATs[] = 'list_beg';
380 $DESCRs[] = '{--ADMIN_TASK_LIST_BEG--}';
381 $TITLEs[] = '{--ADMIN_TASK_LIST_BEG_TITLE--}';
384 if (isExtensionActive('doubler')) {
385 // List waiting payouts
386 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` WHERE `completed`='N' ORDER BY `id` ASC");
387 $WHATs[] = 'list_doubler&mode=waiting&select=all';
388 $DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING--}';
389 $TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE--}';
390 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC");
391 $WHATs[] = 'list_doubler';
392 $DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL--}';
393 $TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL_TITLE--}';
397 // All referal banner
399 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC");
400 $WHATs[] = 'refbanner';
401 $DESCRs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL--}';
402 $TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL_TITLE--}';
405 // All activated referal banner
407 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y' ORDER BY `id` ASC");
408 $WHATs[] = 'refbanner';
409 $DESCRs[] = '{--ADMIN_TASK_LIST_REFBANNER_ACTIVE--}';
410 $TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ACTIVE_TITLE--}';
415 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC");
416 $WHATs[] = 'extensions';
417 $DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL--}';
418 $TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL_TITLE--}';
421 // All activated extensions
423 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_active`='Y' ORDER BY `id` ASC");
424 $WHATs[] = 'extensions&active=Y';
425 $DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ACTIVE--}';
426 $TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ACTIVE_TITLE--}';
428 if (isExtensionActive('engine')) {
429 // List all export accounts
430 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` ORDER BY `id` ASC");
431 $WHATs[] = 'list_engine';
432 $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE--}';
433 $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_TITLE--}';
435 // List all pending accounts
436 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` WHERE `status`='UNCONFIRMED' ORDER BY `id` ASC");
437 $WHATs[] = 'unlock_engine';
438 $DESCRs[] = '{--ADMIN_TASK_UNLOCK_ENGINE--}';
439 $TITLEs[] = '{--ADMIN_TASK_UNLOCK_ENGINE_TITLE--}';
442 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_safe` ORDER BY `id` ASC");
443 $WHATs[] = 'list_engine&mode=safe';
444 $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE_SAFES--}';
445 $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_SAFES_TITLE--}';
447 // List all export URLs
448 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_urls` ORDER BY `id` ASC");
449 $WHATs[] = 'engine_urls';
450 $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE_URLS--}';
451 $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_URLS_TITLE--}';
454 if (isExtensionActive('sponsor')) {
456 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC");
457 $WHATs[] = 'list_sponsor';
458 $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR--}';
459 $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_TITLE--}';
461 // List confirmed sponsor accounts
462 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='CONFIRMED' ORDER BY `id` ASC");
463 $WHATs[] = 'list_sponsor';
464 $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_CONFIRMED--}';
465 $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_CONFIRMED_TITLE--}';
467 // List unconfirmed sponsor accounts
468 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='UNCONFIRMED' ORDER BY `id` ASC");
469 $WHATs[] = 'list_sponsor';
470 $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED--}';
471 $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED_TITLE--}';
473 // List locked sponsor accounts
474 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='LOCKED' ORDER BY `id` ASC");
475 $WHATs[] = 'list_sponsor';
476 $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_LOCKED--}';
477 $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_LOCKED_TITLE--}';
479 // List waiting sponsor accounts to be approved
480 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `status`='PENDING' ORDER BY `id` ASC");
481 $WHATs[] = 'unlock_sponsor';
482 $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_PENDING--}';
483 $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_PENDING_TITLE--}';
486 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_orders` WHERE `pay_status`='PENDING' ORDER BY `id` ASC");
487 $WHATs[] = 'list_sponsor_pays';
488 $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR_ORDERS--}';
489 $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_ORDERS_TITLE--}';
492 if (isExtensionActive('country')) {
493 // List country codes
494 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC");
495 $WHATs[] = 'list_country';
496 $DESCRs[] = '{--ADMIN_TASK_LIST_COUNTRY--}';
497 $TITLEs[] = '{--ADMIN_TASK_LIST_COUNTRY_TITLE--}';
500 if (isExtensionActive('theme')) {
502 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC");
503 $WHATs[] = 'theme_edit';
504 $DESCRs[] = '{--ADMIN_TASK_LIST_THEME_ALL--}';
505 $TITLEs[] = '{--ADMIN_TASK_LIST_THEME_ALL_TITLE--}';
507 // List active themes
508 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` WHERE `theme_active`='Y' ORDER BY `id` ASC");
509 $WHATs[] = 'theme_edit';
510 $DESCRs[] = '{--ADMIN_TASK_LIST_THEME_ACTIVE--}';
511 $TITLEs[] = '{--ADMIN_TASK_LIST_THEME_ACTIVE_TITLE--}';
514 if (isExtensionActive('admins')) {
515 // List all administrator logins
516 addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC");
517 $WHATs[] = 'admins_edit';
518 $DESCRs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL--}';
519 $TITLEs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL_TITLE--}';
522 if (isExtensionActive('surfbar')) {
523 // List all URLs in surfbar
524 addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC");
525 $WHATs[] = 'list_surfbar_urls';
526 $DESCRs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL--}';
527 $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE--}';
529 // List all pending URLs in surfbar
530 addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` WHERE `url_status`='PENDING' ORDER BY `url_id` ASC");
531 $WHATs[] = 'unlock_surfbar_urls';
532 $DESCRs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING--}';
533 $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE--}';
536 // Generate extra overview rows
537 $EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs);
539 // If empty just keep a forced-space left for CSS issues
540 if (empty($EXTRAS)) $EXTRAS = ' ';
542 // Add compiled string to constant for final template
543 $content['extra_table'] = $EXTRAS;
545 // Simply load the template... :-)
546 loadTemplate('admin_overview_task', false, $content);
550 function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
554 // Sadly this cannot be rewritten to a filter... :(
555 foreach (getSqls() as $sqls) {
557 foreach ($sqls as $key => $sql) {
558 // Run SQL command, get line numbers and free memory
559 $result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
562 $value = SQL_NUMROWS($result);
565 SQL_FREERESULT($result);
567 // Prepare array for output
569 'row_descr' => $DESCRs[$key],
573 // Rewrite CSS class if not last entry is reached
574 if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom';
576 if (($value > 0) && (!empty($WHATs[$key]))) {
577 if (empty($TITLEs[$key])) $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
578 $content['row_link'] = '<a href="{%url=modules.php?module=admin&what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . $value . '</a>';
580 $content['row_link'] = '0';
583 // And insert the final string into extras template
584 $OUT .= loadTemplate('admin_overview_task_rows', true, $content);
588 // Return output in the template
589 return loadTemplate('admin_overview_task_extras', true, $OUT);