diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2007-06-22 12:35:26 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2007-06-22 12:35:26 +0000 |
| commit | 643c5ff5b94066529aa1dd1e6ddf41ab86b731d1 (patch) | |
| tree | f8ee1333afb89794527ad87260131cc1e12a443a /index.php | |
| parent | 7b3c4d681d6a88e4e4de5a7a28524f63da468ca5 (diff) | |
| download | stats-643c5ff5b94066529aa1dd1e6ddf41ab86b731d1.tar.gz stats-643c5ff5b94066529aa1dd1e6ddf41ab86b731d1.tar.bz2 stats-643c5ff5b94066529aa1dd1e6ddf41ab86b731d1.zip | |
massive stats overhaul. remove all non-stats code and allow packages to insert their own stats using a ::getStats method. view BitPage::getStats for an example on how it works. not sure if this is the best way to do it, but this way we'll have a unified look.
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 63 |
1 files changed, 7 insertions, 56 deletions
@@ -1,14 +1,8 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_stats/index.php,v 1.6 2006/04/11 13:09:28 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_stats/index.php,v 1.7 2007/06/22 12:35:26 squareing Exp $ * - * Copyright (c) 2004 bitweaver.org - * Copyright (c) 2003 tikwiki.org - * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. - * All Rights Reserved. See copyright.txt for details and a complete list of authors. - * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details - * - * $Id: index.php,v 1.6 2006/04/11 13:09:28 squareing Exp $ + * $Id: index.php,v 1.7 2007/06/22 12:35:26 squareing Exp $ * @package stats * @subpackage functions */ @@ -17,59 +11,16 @@ * required setup */ require_once( '../bit_setup_inc.php' ); - -include_once( STATS_PKG_PATH.'stats_lib.php' ); -global $statslib, $gBitSystem; +include_once( STATS_PKG_PATH.'Statistics.php' ); $gBitSystem->verifyPackage( 'stats' ); - $gBitSystem->verifyPermission( 'p_stats_view' ); -if (!isset($_REQUEST["days"])) { - $_REQUEST["days"] = 7; -} - -$gBitSmarty->assign('pv_chart', 'n'); - -if (isset($_REQUEST["pv_chart"])) { - $gBitSmarty->assign('pv_chart', 'y'); -} - -$gBitSmarty->assign('days', $_REQUEST["days"]); - -$gBitSmarty->assign('usage_chart', 'n'); - -if (isset($_REQUEST["chart"])) { - $gBitSmarty->assign($_REQUEST["chart"] . "_chart", 'y'); -} - -if ($gBitSystem->isPackageActive( 'wiki' ) ) { - $wiki_stats = $statslib->wiki_stats(); -} else { - $wiki_stats = false; -} -$gBitSmarty->assign_by_ref('wiki_stats', $wiki_stats); - -if ($gBitSystem->isPackageActive( 'articles' ) ) { - $cms_stats = $statslib->cms_stats(); -} else { - $cms_stats = false; -} -$gBitSmarty->assign_by_ref('cms_stats', $cms_stats); - -if ($gBitSystem->isPackageActive( 'blogs' ) ) { - $blog_stats = $statslib->blog_stats(); -} else { - $blog_stats = false; -} -$gBitSmarty->assign_by_ref('blog_stats', $blog_stats); - -$user_stats = $statslib->user_stats(); -$gBitSmarty->assign_by_ref('user_stats', $user_stats); +$gStats = new Statistics(); -$site_stats = $statslib->site_stats(); -$gBitSmarty->assign_by_ref('site_stats', $site_stats); +$gBitSmarty->assign( 'siteStats', $gStats->getSiteStats() ); +$gBitSmarty->assign( 'contentOverview', $gStats->getContentOverview( $_REQUEST )); +$gBitSmarty->assign( 'contentStats', $gStats->getContentStats() ); -// Display the template $gBitSystem->display( 'bitpackage:stats/stats.tpl', tra( "Statistics" ) ); ?> |
