X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-surfbar_stats.php;h=950c472304639954a20bbfeaf811afb2a278fc94;hp=c758fdb18fc857f28467125e65406754d782aab3;hb=e8ca54fe91872ab95a6ffdc4f1268bf18889021d;hpb=357b2ca133fc1f89db74097955c366cb4bee6996 diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php index c758fdb18f..950c472304 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 + loadTemplate('admin_settings_saved', false, '{--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 + loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_STATS--}'); + } +} + +// Free result +SQL_FREERESULT($result); -// +// [EOF] ?>