]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-surfbar_stats.php
Some more wrappers added, code cleanups:
[mailer.git] / inc / modules / admin / what-surfbar_stats.php
index 271754365d0b49f6238e94b3eb889103e41ffa54..55f8e0fe6be876e7a8e67bab6e197a754f1ac548 100644 (file)
@@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addMenuDescription('admin', __FILE__);
 
 // Is the 'url_id' set?
-if (isGetRequestParameterSet(('url_id'))) {
+if (isGetRequestParameterSet('url_id')) {
        // Generate general statistics
        $result = SQL_QUERY_ESC("SELECT
        `stats_userid`,
@@ -61,20 +61,19 @@ ORDER BY
                array(bigintval(getRequestParameter('url_id'))), __FILE__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Get all rows
-               $OUT = ''; $SW = 2; $cnt = '0'; $visits = '0';
+               $OUT = ''; $cnt = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Count totals
                        $visits += $content['total_visits'];
 
                        // "Translate" some data
                        $content['last_surfed']  = generateDateTime($content['last_surfed'], 2);
-                       $content['sw']           = $SW;
 
                        // Load row template
                        $OUT .= loadTemplate('admin_surfbar_url_stats_row', true, $content);
-                       $cnt++; $SW = 3 - $SW;
+                       $cnt++;;
                } // END - while
 
                // Prepare content
@@ -89,7 +88,7 @@ ORDER BY
                loadTemplate('admin_surfbar_url_stats', false, $content);
        } else {
                // No statistics so far
-               loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_URL_STATS'));
+               loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_URL_STATS--}');
        }
 } else {
        // Generate general statistics
@@ -105,20 +104,16 @@ ORDER BY
        `stats_userid` ASC", __FILE__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Get all rows
-               $OUT = ''; $SW = 2; $urlArray = '0'; $visits = '0';
+               $OUT = ''; $urlArray = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Count totals
                        $urlArray += $content['visited_urls'];
                        $visits   += $content['total_visits'];
 
-                       // Add color switch
-                       $content['sw']           = $SW;
-
                        // Load row template
                        $OUT .= loadTemplate('admin_surfbar_stats_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Prepare content
@@ -133,7 +128,7 @@ ORDER BY
                loadTemplate('admin_surfbar_stats', false, $content);
        } else {
                // No statistics so far
-               loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_STATS'));
+               loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_STATS--}');
        }
 }