X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-surfbar_stats.php;h=55f8e0fe6be876e7a8e67bab6e197a754f1ac548;hb=98b92ea5ba992a63304091fa1b57f477befffc22;hp=62a5ca2c7351ab76fccdcf423746a8feaef1da99;hpb=0715fa7aa8e5e70bcf1d957fb09ae655c3896c4e;p=mailer.git diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php index 62a5ca2c73..55f8e0fe6b 100644 --- a/inc/modules/admin/what-surfbar_stats.php +++ b/inc/modules/admin/what-surfbar_stats.php @@ -40,13 +40,13 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAdmin())) { die(); -} +} // END - if // Add description as navigation point 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,22 +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['stats_userid'] = generateUserProfileLink($content['stats_userid']); - $content['total_visits'] = translateComma($content['total_visits']); $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 @@ -91,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 @@ -107,24 +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']; - - // "Translate" some data - // @TODO Can't all these translation blocks moved into templates? This code looks ugly. - $content['stats_userid'] = generateUserProfileLink($content['stats_userid']); - $content['visited_urls'] = translateComma($content['visited_urls']); - $content['total_visits'] = translateComma($content['total_visits']); - $content['sw'] = $SW; + $urlArray += $content['visited_urls']; + $visits += $content['total_visits']; // Load row template $OUT .= loadTemplate('admin_surfbar_stats_row', true, $content); - $SW = 3 - $SW; } // END - while // Prepare content @@ -139,12 +128,12 @@ 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--}'); } } // Free result SQL_FREERESULT($result); -// +// [EOF] ?>