summaryrefslogtreecommitdiff
path: root/rankings.php
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 06:12:45 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 06:12:45 +0000
commit850713ed26ff34d8fe37feed30bb94de4adc957c (patch)
tree7ceb5eaad8a84eb8796fd2d53ed62f17052acc35 /rankings.php
downloadwiki-850713ed26ff34d8fe37feed30bb94de4adc957c.tar.gz
wiki-850713ed26ff34d8fe37feed30bb94de4adc957c.tar.bz2
wiki-850713ed26ff34d8fe37feed30bb94de4adc957c.zip
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'rankings.php')
-rw-r--r--rankings.php67
1 files changed, 67 insertions, 0 deletions
diff --git a/rankings.php b/rankings.php
new file mode 100644
index 0000000..4766703
--- /dev/null
+++ b/rankings.php
@@ -0,0 +1,67 @@
+<?php
+// $Header: /cvsroot/bitweaver/_bit_wiki/rankings.php,v 1.1 2005/06/19 06:12:45 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( 'wiki' );
+if ($feature_wiki_rankings != 'y') {
+ $smarty->assign('msg', tra("This feature is disabled").": feature_wiki_rankings");
+ $gBitSystem->display( 'error.tpl' );
+ die;
+}
+if (!$gBitUser->hasPermission( 'bit_p_view' )) {
+ $smarty->assign('msg', tra("Permission denied you cannot view this section"));
+ $gBitSystem->display( 'error.tpl' );
+ die;
+}
+// Get the page from the request var or default it to HomePage
+if (!isset($_REQUEST["limit"])) {
+ $limit = 10;
+} else {
+ $limit = $_REQUEST["limit"];
+}
+$allrankings = array(
+ array(
+ 'name' => tra('Top pages'),
+ 'value' => 'wiki_ranking_top_pages'
+),
+ array(
+ 'name' => tra('Last pages'),
+ 'value' => 'wiki_ranking_last_pages'
+),
+ array(
+ 'name' => tra('Most relevant pages'),
+ 'value' => 'wiki_ranking_top_pagerank'
+),
+ array(
+ 'name' => tra('Top authors'),
+ 'value' => 'wiki_ranking_top_authors'
+)
+);
+$smarty->assign('allrankings', $allrankings);
+if (!isset($_REQUEST["which"])) {
+ $which = 'wiki_ranking_top_pages';
+} else {
+ $which = $_REQUEST["which"];
+}
+$smarty->assign('which', $which);
+$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', WIKI_PKG_URL.'rankings.php');
+// Display the template
+$gBitSystem->display( 'bitpackage:kernel/ranking.tpl');
+?>