X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-surfbar_stats.php;h=497c15eeaae9e59bc0e84e174614029fd0968816;hp=0ed0f4dbd32a5386c845255e42d4ffdcef7b6cba;hb=2379934be6a196a54f4155bb8e24c49b20736969;hpb=963e55ca1ea79e255f235e359cde9f7862191dc5 diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php index 0ed0f4dbd3..497c15eeaa 100644 --- a/inc/modules/admin/what-surfbar_stats.php +++ b/inc/modules/admin/what-surfbar_stats.php @@ -1,7 +1,7 @@ $OUT, + 'userids' => $count, + 'visits' => $visits + ); + + + // Load main template + loadTemplate('admin_surfbar_url_stats', false, $content); + } else { + // No statistics so far + displayMessage('{--ADMIN_SURFBAR_NO_URL_STATS--}'); + } +} else { + // Generate general statistics + $result = SQL_QUERY("SELECT + `stats_userid`, + COUNT(`stats_url_id`) AS `visited_urls`, + SUM(`stats_count`) AS `total_visits` +FROM + `{?_MYSQL_PREFIX?}_surfbar_stats` +GROUP BY + `stats_userid` +ORDER BY + `stats_userid` ASC", __FILE__, __LINE__); + + // Entries found? + if (!SQL_HASZERONUMS($result)) { + // Get all rows + $OUT = ''; $urlArray = '0'; $visits = '0'; + while ($content = SQL_FETCHARRAY($result)) { + // Count totals + $urlArray += $content['visited_urls']; + $visits += $content['total_visits']; + + // Load row template + $OUT .= loadTemplate('admin_surfbar_stats_row', true, $content); + } // END - while + + // Prepare content + $content = array( + 'rows' => $OUT, + 'urls' => $urlArray, + 'visits' => $visits + ); + + + // Load main template + loadTemplate('admin_surfbar_stats', false, $content); + } else { + // No statistics so far + displayMessage('{--ADMIN_SURFBAR_NO_STATS--}'); + } +} + +// Free result +SQL_FREERESULT($result); -// +// [EOF] ?>