Naming convention applied, ext-network menu resorted:
[mailer.git] / inc / libs / task_functions.php
index 5250de06cedf368c054cb66cbf7cb09180dc1028..06f0f2b3fdef33c38bd0d14a9986162b679f4c55 100644 (file)
@@ -560,12 +560,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 +569,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_NUMROWS($result) > 0) && (!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