]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/task_functions.php
Renamed function so it might be more understandable
[mailer.git] / inc / libs / task_functions.php
index 5250de06cedf368c054cb66cbf7cb09180dc1028..6894f398ef0e499e328119bc75ab04c6cf5e1148 100644 (file)
@@ -14,8 +14,6 @@
  * $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 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -65,7 +63,7 @@ function outputAdvancedOverview (&$result_main) {
        // Init SQLs
        initSqls();
 
-       // Init contentn
+       // Init content
        foreach (
                array(
                        // Member accounts
@@ -210,11 +208,11 @@ function outputAdvancedOverview (&$result_main) {
                } elseif (isExtensionActive('bonus')) {
                        $content['purged_bonus_mails'] = getMaskedMessage('ADMIN_EXTENSION_BONUS_OUTDATED', '0.1.8');
                } else {
-                       $content['purged_bonus_mails'] = '<span class="admin_note">{--ADMIN_EXTENSION_BONUS_404--}</span>';
+                       $content['purged_bonus_mails'] = '<span class="notice">{--ADMIN_EXTENSION_BONUS_404--}</span>';
                }
        } else {
-               $content['purged_bonus_mails'] = '<span class="admin_note">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
-               $content['purged_mails'] = '<span class="admin_note">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
+               $content['purged_bonus_mails'] = '<span class="notice">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
+               $content['purged_mails'] = '<span class="notice">{--ADMIN_EXTENSION_AUTOPURGE_404--}</span>';
        }
 
        //
@@ -239,7 +237,7 @@ function outputAdvancedOverview (&$result_main) {
 
                // Check for more extensions
                // @TODO These can be rewritten to filter
-               if (getConfig('def_refid') > 0)                $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}';
+               if (isValidUserId(getDefRefid()))              $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}';
                if (isExtensionActive('beg'))                  $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
                if (isExtensionActive('bonus'))                $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
                if (isExtensionActive('doubler'))              $EXCLUDE_LIST .= ' AND d.`userid` != {?doubler_userid?}';
@@ -560,12 +558,6 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
                        // Run SQL command, get line numbers and free memory
                        $result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
-                       // Get rows
-                       $value = SQL_NUMROWS($result);
-
-                       // Free result
-                       SQL_FREERESULT($result);
-
                        // Prepare array for output
                        $content = array(
                                'row_descr' => $DESCRs[$key],
@@ -575,13 +567,18 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
                        // Rewrite CSS class if not last entry is reached
                        if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom';
 
-                       if (($value > 0) && (!empty($WHATs[$key]))) {
-                               if (empty($TITLEs[$key])) $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
-                               $content['row_link'] = '<a href="{%url=modules.php?module=admin&amp;what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . $value . '</a>';
+                       if ((!SQL_HASZERONUMS($result)) && (!empty($WHATs[$key]))) {
+                               if (empty($TITLEs[$key])) {
+                                       $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
+                               } // END - if
+                               $content['row_link'] = '<a href="{%url=modules.php?module=admin&amp;what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . SQL_NUMROWS($result) . '</a>';
                        } else {
                                $content['row_link'] = '0';
                        }
 
+                       // Free result
+                       SQL_FREERESULT($result);
+
                        // And insert the final string into extras template
                        $OUT .= loadTemplate('admin_overview_task_rows', true, $content);
                } // END- foreach