diff options
| author | Christian Fowler <spider@viovio.com> | 2009-11-11 17:38:46 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-11-11 17:38:46 +0000 |
| commit | 7a2c4a34a10753ee115e1e8337d9f4b3fc5e2dce (patch) | |
| tree | 24fc9095c7c7c0c11db6d8fc1591d4e4702c5f48 | |
| parent | d0f94e0f111d7ca8f5502ec9b1b7ffa450b9f6a8 (diff) | |
| download | stats-7a2c4a34a10753ee115e1e8337d9f4b3fc5e2dce.tar.gz stats-7a2c4a34a10753ee115e1e8337d9f4b3fc5e2dce.tar.bz2 stats-7a2c4a34a10753ee115e1e8337d9f4b3fc5e2dce.zip | |
link period dates to list of users registered during a given periodpre_deprecate_bit_setup_incR270PRE_BIT_SETUP_CHANGE
| -rw-r--r-- | Statistics.php | 27 | ||||
| -rw-r--r-- | templates/user_stats.tpl | 4 | ||||
| -rw-r--r-- | users.php | 31 |
3 files changed, 34 insertions, 28 deletions
diff --git a/Statistics.php b/Statistics.php index c3dc49c..d2bcb78 100644 --- a/Statistics.php +++ b/Statistics.php @@ -1,8 +1,8 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_stats/Statistics.php,v 1.6 2009/09/08 22:14:50 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_stats/Statistics.php,v 1.7 2009/11/11 17:38:46 spiderr Exp $ * - * $Id: Statistics.php,v 1.6 2009/09/08 22:14:50 spiderr Exp $ + * $Id: Statistics.php,v 1.7 2009/11/11 17:38:46 spiderr Exp $ * @package stats */ @@ -122,29 +122,10 @@ class Statistics extends BitBase { * @access public * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure */ - function registrationStats( $pPeriod ) { + function registrationStats( $pPeriodFormat ) { global $gBitDbType; - switch( $pPeriod ) { - case 'year': - $format = 'Y'; - break; - case 'quarter': - $format = 'Y-\QQ'; - break; - case 'day': - $format = 'Y-m-d'; - break; - case 'week': - $format = 'Y \Week W'; - break; - case 'month': - default: - $format = 'Y-m'; - break; - } - - $sqlPeriod = $this->mDb->SQLDate( $format, $this->mDb->SQLIntToTimestamp( 'registration_date' )); + $sqlPeriod = $this->mDb->SQLDate( $pPeriodFormat, $this->mDb->SQLIntToTimestamp( 'registration_date' )); $query = " SELECT $sqlPeriod AS period, COUNT(`user_id`) FROM `".BIT_DB_PREFIX."users_users` diff --git a/templates/user_stats.tpl b/templates/user_stats.tpl index 9b5fb89..7da3fbf 100644 --- a/templates/user_stats.tpl +++ b/templates/user_stats.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_stats/templates/user_stats.tpl,v 1.11 2006/03/22 10:24:20 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_stats/templates/user_stats.tpl,v 1.12 2009/11/11 17:38:46 spiderr Exp $ *} <div class="display statistics"> <div class="header"> <h1>{tr}Site Registrations{/tr}</h1> @@ -23,7 +23,7 @@ </tr> {foreach item=reg key=period from=$userStats.per_period} <tr class="{cycle values="even,odd"}"> - <td>{$period}</td> + <td><a href="{$smarty.const.STATS_PKG_URL}users.php?period={$smarty.request.period}&itemize={$period|urlencode}">{$period}</td> <td><div style="width:{math equation="round( ( r / m ) * 100 )" r=$reg m=$userStats.max}%; background:#f80;padding:0 0 0 5px;">{$reg}</div></td> </tr> {foreachelse} @@ -1,12 +1,12 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_stats/users.php,v 1.11 2009/10/01 14:17:05 wjames5 Exp $ + * $Header: /cvsroot/bitweaver/_bit_stats/users.php,v 1.12 2009/11/11 17:38:46 spiderr Exp $ * * Copyright (c) 2005 bitweaver.org * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details * - * $Id: users.php,v 1.11 2009/10/01 14:17:05 wjames5 Exp $ + * $Id: users.php,v 1.12 2009/11/11 17:38:46 spiderr Exp $ * @package stats * @subpackage functions */ @@ -25,7 +25,32 @@ if( !isset( $_REQUEST["period"] )) { $_REQUEST["period"] = 'month'; } -$gBitSmarty->assign( 'userStats', $stats->registrationStats( $_REQUEST["period"] )); +switch( $_REQUEST["period"] ) { + case 'year': + $format = 'Y'; + break; + case 'quarter': + $format = 'Y-\QQ'; + break; + case 'day': + $format = 'Y-m-d'; + break; + case 'week': + $format = 'Y \Week W'; + break; + case 'month': + default: + $format = 'Y-m'; + break; +} + +if( !empty( $_REQUEST['itemize'] ) ) { + $listHash['registration_period'] = $_REQUEST['itemize']; + $listHash['registration_period_format'] = $format; + bit_redirect( USERS_PKG_URL.'admin/index.php?registration_period='.urlencode( $_REQUEST['itemize'] ).'®istration_period_format='.urlencode( $listHash['registration_period_format'] ) ); +} + +$gBitSmarty->assign( 'userStats', $stats->registrationStats( $format )); $gBitSmarty->assign( 'period', $_REQUEST["period"] ); // Display the template |
