diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 03:57:42 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 03:57:42 +0000 |
| commit | 48f33945f41e0b30628d8d7941fe8d62e88ac97b (patch) | |
| tree | 5d624eda3cf1bd0cdc9e788fbbba5c70a3ddb0e4 /rankings.php | |
| download | blogs-48f33945f41e0b30628d8d7941fe8d62e88ac97b.tar.gz blogs-48f33945f41e0b30628d8d7941fe8d62e88ac97b.tar.bz2 blogs-48f33945f41e0b30628d8d7941fe8d62e88ac97b.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'rankings.php')
| -rw-r--r-- | rankings.php | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/rankings.php b/rankings.php new file mode 100644 index 0000000..c2e686c --- /dev/null +++ b/rankings.php @@ -0,0 +1,78 @@ +<?php + +// $Header: /cvsroot/bitweaver/_bit_blogs/rankings.php,v 1.1 2005/06/19 03:57:42 bitweaver Exp $ + +// 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. + +// Initialization +require_once( '../bit_setup_inc.php' ); + +include_once( KERNEL_PKG_PATH.'rank_lib.php' ); + +$gBitSystem->verifyPackage( 'blogs' ); + +if ($feature_blog_rankings != 'y') { + $smarty->assign('msg', tra("This feature is disabled").": feature_blog_rankings"); + + $gBitSystem->display( 'error.tpl' ); + die; +} + +$gBitSystem->verifyPermission( 'bit_p_read_blog' ); + +$allrankings = array( + array( + 'name' => tra('Top visited blogs'), + 'value' => 'blog_ranking_top_blogs' +), + array( + 'name' => tra('Last posts'), + 'value' => 'blog_ranking_last_posts' +), + array( + 'name' => tra('Top active blogs'), + 'value' => 'blog_ranking_top_active_blogs' +) +); + +$smarty->assign('allrankings', $allrankings); + +if (!isset($_REQUEST["which"])) { + $which = 'blog_ranking_top_blogs'; +} else { + $which = $_REQUEST["which"]; +} + +$smarty->assign('which', $which); + +// Get the page from the request var or default it to HomePage +if (!isset($_REQUEST["limit"])) { + $limit = 10; +} else { + $limit = $_REQUEST["limit"]; +} + +$smarty->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; + +$smarty->assign_by_ref('rankings', $rankings); +$smarty->assign('rpage', 'rankings.php'); + + +// Display the template +$gBitSystem->display( 'bitpackage:kernel/ranking.tpl'); + +?> |
