From 94bc3390e7c87b629973faf91e60c9e1acf1f5c0 Mon Sep 17 00:00:00 2001 From: spiderr Date: Wed, 26 Sep 2012 14:35:23 -0400 Subject: add totalregistrations and code support for timeframe --- Statistics.php | 6 +++++- templates/referer_stats.tpl | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Statistics.php b/Statistics.php index bbc69a0..2b86116 100644 --- a/Statistics.php +++ b/Statistics.php @@ -71,7 +71,7 @@ class Statistics extends BitBase { $whereSql .= empty( $whereSql ) ? ' WHERE ' : ' AND '; $whereSql .= " UPPER( `referer_url` ) LIKE ?"; $bindVars[] = '%'.strtoupper( $pListHash['find'] ).'%'; - if( !empty( $pListHash['period_format'] ) ) { + if( empty( $pListHash['timeframe'] ) && !empty( $pListHash['period_format'] ) ) { $hashSql = $this->mDb->SQLDate( $pListHash['period_format'], $this->mDb->SQLIntToTimestamp( 'registration_date' )).' AS `hash_key`,'; $hashKey = 'period'; } @@ -90,6 +90,10 @@ class Statistics extends BitBase { $key = 'none'; if( !empty( $row['referer_url'] ) ) { $parseUrl = parse_url( $row['referer_url'] ); + parse_str( $parseUrl['query'], $params ); + if( !empty( $params['adurl'] ) ) { + parse_str( $params['adurl'], $params ); + } $key = $parseUrl['host']; } } diff --git a/templates/referer_stats.tpl b/templates/referer_stats.tpl index 2fb7cd2..2a9089b 100644 --- a/templates/referer_stats.tpl +++ b/templates/referer_stats.tpl @@ -2,15 +2,17 @@
-

{tr}User Registration Statistics{/tr}

- {minifind} +

{tr}User Registration Statistics{/tr} {$smarty.request.timeframe|escape}

+ {minifind period_format="`$smarty.request.period_format`" timeframe="`$smarty.request.timeframe`"}
- + {assign var=refCount value=0} {foreach from=$referers key=host item=reg} + {assign var=regCount value=$reg|@count} + {assign var=totalReg value=$totalReg+$regCount} {assign var=hostHash value=$host|md5} @@ -27,6 +29,10 @@ {foreachelse} {/foreach} + + + +
{tr}User Registration Statistics{/tr}
{$reg|@count}
{tr}No records found{/tr}
{$totalReg}{tr}Total Registrations{/tr}
-- cgit v1.3