// 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],
// 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&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&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