diff -rupN xstatistics/README.txt xstatisticsnew/README.txt --- xstatistics/README.txt 2005-08-02 12:44:21.000000000 -0700 +++ xstatisticsnew/README.txt 2006-01-08 20:08:39.000000000 -0800 @@ -3,7 +3,11 @@ Description: Xstatistics is a module meant for extendability. It offers basic stqtics summaries at the momement, but any features are welcome for review. Think about SVG diagrams, grapics, Search-engine referrer analysing (what were they looking for), path-reports and other interesting reports. + +NOTE: You must enable the core "statistics" module and enable the "Count Content Views" to get the full value out of this package. + + http://www.webschuur.com/modules/xtatistics This module was carpendered in the Webschuur.com -more details from ber @ webschuur com \ No newline at end of file +more details from ber @ webschuur com diff -rupN xstatistics/xstatistics.module xstatisticsnew/xstatistics.module --- xstatistics/xstatistics.module 2005-10-30 05:05:54.000000000 -0800 +++ xstatisticsnew/xstatistics.module 2006-01-08 20:15:35.000000000 -0800 @@ -27,15 +27,23 @@ function xstatistics_help($section = "ad } function xstatistics_summary() { - //prepare amount of node_views - //todo rewrite to use count() and sum() - $res = db_query("SELECT totalcount, daycount FROM {node_counter}"); - while($count = db_fetch_object($res)) { + if (variable_get('statistics_count_content_views', 0)) { + //prepare amount of node_views + //todo rewrite to use count() and sum() + $res = db_query("SELECT totalcount, daycount FROM {node_counter}"); + while($count = db_fetch_object($res)) { $count_nodes_view_tot = $count_nodes_view_tot + $count->totalcount; $count_nodes_view_day = $count_nodes_view_day + $count->daycount; + } } - - $count_referrer_ext_day = db_fetch_array(db_query("SELECT COUNT(DISTINCT(url)) AS referrers FROM {accesslog} WHERE url <> '' AND url NOT LIKE '%%%s%%' AND timestamp >= %d", $_SERVER['HTTP_HOST'], (time()-86400))); + else { + //If counter is disabled then show disabled link + $disabled_link = l(t('enable Count Content Views to see values'),'admin/settings/statistics'); + $count_nodes_view_tot = $disabled_link; + $count_nodes_view_day = $disabled_link; + } + +$count_referrer_ext_day = db_fetch_array(db_query("SELECT COUNT(DISTINCT(url)) AS referrers FROM {accesslog} WHERE url <> '' AND url NOT LIKE '%%%s%%' AND timestamp >= %d", $_SERVER['HTTP_HOST'], (time()-86400))); $count_referrer_int_day = db_fetch_array(db_query("SELECT COUNT(DISTINCT(url)) AS referrers FROM {accesslog} WHERE url <> '' AND url LIKE '%%%s%%' AND timestamp >= %d", $_SERVER['HTTP_HOST'], (time()-86400))); $count_hits_day = db_fetch_array(db_query("SELECT COUNT(aid) AS hits FROM {accesslog} WHERE timestamp >= %d", (time()-86400))); $count_pageviews_day = db_fetch_array(db_query("SELECT COUNT(path) AS hits FROM {accesslog} WHERE timestamp >= %d", (time()-86400))); @@ -79,4 +87,4 @@ function xstatistics_usage() { $output = theme('table', $header, $rows); print theme('page', $output); } -?> \ No newline at end of file +