diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-12-18 22:34:08 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-12-18 22:34:08 +0000 |
| commit | c83a84ec21dc963c89e4d8c1e09935297acb04b8 (patch) | |
| tree | 488e9224c4870563d99141ef56f07b5286bb5863 /rankings.php | |
| parent | a5be1cbea23dac9d58ddf3389fcc0057b87345c1 (diff) | |
| download | articles-c83a84ec21dc963c89e4d8c1e09935297acb04b8.tar.gz articles-c83a84ec21dc963c89e4d8c1e09935297acb04b8.tar.bz2 articles-c83a84ec21dc963c89e4d8c1e09935297acb04b8.zip | |
merge recent changes into HEAD
Diffstat (limited to 'rankings.php')
| -rw-r--r-- | rankings.php | 64 |
1 files changed, 23 insertions, 41 deletions
diff --git a/rankings.php b/rankings.php index 4f32b7e..985ff7a 100644 --- a/rankings.php +++ b/rankings.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_articles/rankings.php,v 1.3 2005/10/30 19:48:40 lsces Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_articles/rankings.php,v 1.5 2006/01/10 21:11:08 squareing Exp $ * @package article * @subpackage functions */ @@ -11,57 +11,39 @@ require_once( '../bit_setup_inc.php' ); include_once( KERNEL_PKG_PATH . 'rank_lib.php' ); - +include_once( ARTICLES_PKG_PATH . 'BitArticle.php' ); $gBitSystem->isPackageActive( 'articles' ); - $gBitSystem->isFeatureActive( 'feature_cms_rankings' ); - $gBitSystem->verifyPermission( 'bit_p_read_article' ); $allrankings = array( - array( 'name' => tra( 'Top articles' ), - 'value' => 'cms_ranking_top_articles' - ), - array( 'name' => tra( 'Top authors' ), - 'value' => 'cms_ranking_top_authors' - ) - ); - + array( + 'name' => tra( 'Top articles' ), + 'value' => 'contentRanking' + ), +// array( +// 'name' => tra( 'Top authors' ), +// 'value' => 'cms_ranking_top_authors' +// ) +); $gBitSmarty->assign( 'allrankings', $allrankings ); if ( !isset( $_REQUEST["which"] ) ) { - $which = 'cms_ranking_top_articles'; -} else { - $which = $_REQUEST["which"]; -} - -$gBitSmarty->assign( 'which', $which ); -// Get the page from the request var or default it to HomePage -if ( !isset( $_REQUEST["limit"] ) ) { - $limit = 10; + $func = 'contentRanking'; } else { - $limit = $_REQUEST["limit"]; -} - -$gBitSmarty->assign_by_ref( 'limit', $limit ); -// Rankings: -// Top Pages -// Last pages -// Top Authors -$rankings = array(); - -$rk = $ranklib->$which( $limit ); -$rank["data"] = $rk["data"]; -$rank["title"] = $rk["title"]; -$rank["y"] = $rk["y"]; -$rankings[] = $rank; - -$gBitSmarty->assign_by_ref( 'rankings', $rankings ); -$gBitSmarty->assign( 'rpage', ARTICLES_PKG_URL . 'rankings.php' ); + $func = $_REQUEST["which"]; +} +$gBitSmarty->assign( 'which', $func ); +$listHash = array( + 'title' => tra( 'Article Rankings' ), + 'content_type_guid' => BITARTICLE_CONTENT_TYPE_GUID, + 'limit' => ( !empty( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : 10 ), +); +$rankings[] = $ranklib->$func( $listHash ); +$gBitSmarty->assign( 'rankings', $rankings ); // Display the template -$gBitSystem->display( 'bitpackage:kernel/ranking.tpl', tra("articles") ); - +$gBitSystem->display( 'bitpackage:kernel/ranking.tpl', tra( "Articles" ) ); ?> |
