diff options
| author | spiderr <spider@viovio.com> | 2012-09-26 14:35:23 -0400 |
|---|---|---|
| committer | spiderr <spider@viovio.com> | 2012-09-26 14:35:23 -0400 |
| commit | 94bc3390e7c87b629973faf91e60c9e1acf1f5c0 (patch) | |
| tree | b200d4f7b1772e0fe4d02449086d74fd0e66216a | |
| parent | c63f2ad5f8dada0227f24476f33d77d3b9aed323 (diff) | |
| download | stats-94bc3390e7c87b629973faf91e60c9e1acf1f5c0.tar.gz stats-94bc3390e7c87b629973faf91e60c9e1acf1f5c0.tar.bz2 stats-94bc3390e7c87b629973faf91e60c9e1acf1f5c0.zip | |
add totalregistrations and code support for timeframe
| -rw-r--r-- | Statistics.php | 6 | ||||
| -rw-r--r-- | 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 @@ <div class="display statistics"> <div class="header"> - <h1>{tr}User Registration Statistics{/tr}</h1> - {minifind} + <h1>{tr}User Registration Statistics{/tr} {$smarty.request.timeframe|escape}</h1> + {minifind period_format="`$smarty.request.period_format`" timeframe="`$smarty.request.timeframe`"} </div> <div class="body"> <table class="data"> <caption>{tr}User Registration Statistics{/tr}</caption> - + {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} <tr> <th style="width:5%;">{$reg|@count}</th> @@ -27,6 +29,10 @@ {foreachelse} <tr class="norecords"><td colspan="3">{tr}No records found{/tr}</td></tr> {/foreach} + <tr> + <th style="width:5%;">{$totalReg}</th> + <th>{tr}Total Registrations{/tr}</th> + </tr> </table> </div> <!-- end .body --> |
