diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-29 13:03:49 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-29 13:03:49 +0100 |
| commit | 144b7ea64606dd1875b10ce87693250f84bea3f7 (patch) | |
| tree | dc05003a3f39d5c8641fcd9a9de3569c6eaeff1a /rankings.php | |
| parent | 7fefadbccfeb0e9effe1342adb7a5d52755d401c (diff) | |
| download | wiki-144b7ea64606dd1875b10ce87693250f84bea3f7.tar.gz wiki-144b7ea64606dd1875b10ce87693250f84bea3f7.tar.bz2 wiki-144b7ea64606dd1875b10ce87693250f84bea3f7.zip | |
General code updated to PHP8.4 and namespace
Diffstat (limited to 'rankings.php')
| -rwxr-xr-x[-rw-r--r--] | rankings.php | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/rankings.php b/rankings.php index 217b917..da651bb 100644..100755 --- a/rankings.php +++ b/rankings.php @@ -13,49 +13,51 @@ /** * required setup */ -require_once( '../kernel/includes/setup_inc.php' ); +require_once '../kernel/includes/setup_inc.php'; +use Bitweaver\KernelTools; +use Bitweaver\Liberty\LibertyContent; $gBitSystem->verifyPackage( 'wiki' ); $gBitSystem->verifyFeature( 'wiki_rankings' ); $gBitSystem->verifyPermission( 'p_wiki_list_pages' ); -$rankingOptions = array( - array( - 'output' => tra( 'Most Often Viewed' ), +$rankingOptions = [ + [ + 'output' => KernelTools::tra( 'Most Often Viewed' ), 'value' => 'hits_desc' - ), - array( - 'output' => tra( 'Most Recently Modified' ), + ], + [ + 'output' => KernelTools::tra( 'Most Recently Modified' ), 'value' => 'last_modified_desc' - ), - array( - 'output' => tra( 'Most Active Authors' ), + ], + [ + 'output' => KernelTools::tra( 'Most Active Authors' ), 'value' => 'top_authors' - ), -); + ], +]; $gBitSmarty->assign( 'rankingOptions', $rankingOptions ); if( !empty( $_REQUEST['sort_mode'] ) ) { switch( $_REQUEST['sort_mode'] ) { case 'last_modified_desc': $gBitSmarty->assign( 'attribute', 'last_modified' ); - $_REQUEST['attribute'] = tra( 'Date of last modification' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Date of last modification' ); break; case 'top_authors': $gBitSmarty->assign( 'attribute', 'ag_hits' ); - $_REQUEST['attribute'] = tra( 'Hits to items by this Author' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Hits to items by this Author' ); break; default: $gBitSmarty->assign( 'attribute', 'hits' ); - $_REQUEST['attribute'] = tra( 'Hits' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Hits' ); break; } } else { $gBitSmarty->assign( 'attribute', 'hits' ); - $_REQUEST['attribute'] = tra( 'Hits' ); + $_REQUEST['attribute'] = KernelTools::tra( 'Hits' ); } -$_REQUEST['title'] = tra( 'Wiki Rankings' ); +$_REQUEST['title'] = KernelTools::tra( 'Wiki Rankings' ); $_REQUEST['content_type_guid'] = BITPAGE_CONTENT_TYPE_GUID; $_REQUEST['max_records'] = !empty( $_REQUEST['max_records'] ) ? $_REQUEST['max_records'] : 10; @@ -65,5 +67,4 @@ if( empty( $gContent ) ) { $rankList = $gContent->getContentRanking( $_REQUEST ); $gBitSmarty->assign( 'rankList', $rankList ); -$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', tra( "Wiki Rankings" ) , array( 'display_mode' => 'display' )); -?> +$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', KernelTools::tra( "Wiki Rankings" ) , array( 'display_mode' => 'display' )); |
