X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-surfbar_stats.php;h=aca6624c8a7d1579528489c64a05077d1c38f690;hp=0ed0f4dbd32a5386c845255e42d4ffdcef7b6cba;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=7f104f6fe558bb56b4205241435a2357c2feece1 diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php index 0ed0f4dbd3..aca6624c8a 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 = sqlQuery("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 (!ifSqlHasZeroNumRows($result)) { + // Get all rows + $OUT = ''; $urlArray = '0'; $visits = '0'; + while ($content = sqlFetchArray($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 +sqlFreeResult($result); -// +// [EOF] ?>