summaryrefslogtreecommitdiff
path: root/rankings.php
blob: 985ff7a42260a7d5e233e7a3ca59776c0efb3183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php 
/**
 * @version $Header: /cvsroot/bitweaver/_bit_articles/rankings.php,v 1.5 2006/01/10 21:11:08 squareing Exp $
 * @package article
 * @subpackage functions
 */

/**
 * Initialization
 */
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' => 'contentRanking' 
	),
//	array(
//		'name' => tra( 'Top authors' ),
//		'value' => 'cms_ranking_top_authors' 
//	) 
);
$gBitSmarty->assign( 'allrankings', $allrankings );

if ( !isset( $_REQUEST["which"] ) ) {
	$func = 'contentRanking';
} else {
	$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" ) );
?>