diff options
| -rwxr-xr-x[-rw-r--r--] | modules/mod_comm_received_objects.php | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_random_pages.php | 13 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_recent_page_changes.php | 17 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_recent_page_changes.tpl | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_top_pages.php | 7 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_wiki_last_comments.php | 12 |
6 files changed, 28 insertions, 25 deletions
diff --git a/modules/mod_comm_received_objects.php b/modules/mod_comm_received_objects.php index 667a588..f4bed20 100644..100755 --- a/modules/mod_comm_received_objects.php +++ b/modules/mod_comm_received_objects.php @@ -16,5 +16,5 @@ require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' ); $wikilib = new WikiLib(); $ranking = $wikilib->list_received_pages(0, -1, $sort_mode = 'title_asc', ''); -$_template->tpl_vars['modReceivedPages'] = new Smarty_variable( $ranking["cant"]); +$gBitSmarty->assign( 'modReceivedPages', $ranking["cant"]); ?> diff --git a/modules/mod_random_pages.php b/modules/mod_random_pages.php index a6674bc..60d2daf 100644..100755 --- a/modules/mod_random_pages.php +++ b/modules/mod_random_pages.php @@ -1,4 +1,6 @@ <?php +use Bitweaver\Wiki\BitPage; + /** * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -13,15 +15,14 @@ /** * Required files */ -require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' ); + global $moduleParams; $wp = new BitPage(); if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { - $listHash = array( - 'sort_mode' => 'random', + $listHash = [ + 'sort_mode' => 'random', 'max_records' => $moduleParams['module_rows'], - ); + ]; $pages = $wp->getList( $listHash ); - $_template->tpl_vars['modRandomPages'] = new Smarty_variable( $pages ); + $gBitSmarty->assign( 'modRandomPages', $pages ); } -?> diff --git a/modules/mod_recent_page_changes.php b/modules/mod_recent_page_changes.php index 5299b5b..b142719 100644..100755 --- a/modules/mod_recent_page_changes.php +++ b/modules/mod_recent_page_changes.php @@ -1,4 +1,6 @@ <?php +use Bitweaver\Wiki\BitPage; + /** * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -16,20 +18,19 @@ global $gQueryUserId, $moduleParams; */ if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { - require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' ); $wp = new BitPage(); - $listHash = array( + $listHash = [ 'sort_mode' => 'last_modified_desc', - 'user_id' => $gQueryUserId, - ); - if( !empty( $moduleParams['module_rows'] ) ) { + 'user_id' => $gQueryUserId, + ]; + if( is_array( $moduleParams ) && !empty( $moduleParams['module_rows'] ) ) { $listHash['max_records'] = $moduleParams['module_rows']; } $modLastModif = $wp->getList( $listHash ); - $_template->tpl_vars['modLastModif'] = new Smarty_variable( $modLastModif ); - if( !empty( $moduleParams['module_params']["maxlen"] ) ) { - $_template->tpl_vars['maxlen'] = new Smarty_variable( isset( $moduleParams['module_params']["maxlen"] ) ); + $gBitSmarty->assign( 'modLastModif', $modLastModif ); + if( is_array( $moduleParams ) && !empty( $moduleParams['module_params']["maxlen"] ) ) { + $gBitSmarty->assign( 'maxlen', isset( $moduleParams['module_params']["maxlen"] ) ); } } diff --git a/modules/mod_recent_page_changes.tpl b/modules/mod_recent_page_changes.tpl index 9a4b45c..27fa56c 100644..100755 --- a/modules/mod_recent_page_changes.tpl +++ b/modules/mod_recent_page_changes.tpl @@ -5,7 +5,7 @@ {section name=ix loop=$modLastModif} <li> <a href="{$modLastModif[ix].display_url}" title="{$modLastModif[ix].title|escape} - {displayname user=$modLastModif[ix].modifier_user real_name=$modLastModif[ix].modifier_real_name nolink=1}, {$modLastModif[ix].last_modified|bit_short_date}"> - {if !empty($maxlen)} + {if $maxlen gt 0} {$modLastModif[ix].title|escape|truncate:$maxlen:"...":true} {else} {$modLastModif[ix].title|escape} diff --git a/modules/mod_top_pages.php b/modules/mod_top_pages.php index 0062542..c913072 100644..100755 --- a/modules/mod_top_pages.php +++ b/modules/mod_top_pages.php @@ -1,4 +1,6 @@ <?php +use Bitweaver\Wiki\BitPage; + /** * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -13,7 +15,6 @@ /** * required setup */ -require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' ); global $gQueryUser, $module_rows, $module_params; extract( $moduleParams ); @@ -23,9 +24,9 @@ if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { $listHash = array( 'max_records' => $module_rows, 'sort_mode' => 'hits_desc', - 'user_id' => !empty( $module_params['user_pages'] ) ? $gQueryUser->mUserId : NULL, + 'user_id' => !empty( $module_params['user_pages'] ) ? $gQueryUser->mUserId : null, ); $modRank = $modWiki->getList( $listHash ); - $_template->tpl_vars['modTopPages'] = new Smarty_variable( $modRank ); + $gBitSmarty->assign( 'modTopPages', $modRank ); } ?> diff --git a/modules/mod_wiki_last_comments.php b/modules/mod_wiki_last_comments.php index b3d8fae..0be35fc 100644..100755 --- a/modules/mod_wiki_last_comments.php +++ b/modules/mod_wiki_last_comments.php @@ -13,16 +13,16 @@ /** * Show last comments on wiki pages */ +use Bitweaver\Liberty\LibertyComment; + global $gQueryUserId, $moduleParams; /** * required setup */ if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { - require_once( LIBERTY_PKG_CLASS_PATH.'LibertyComment.php' ); $cmt = new LibertyComment(); - $listHash = array( 'max_records' => $moduleParams['module_rows'], 'user_id' => $gQueryUserId, 'content_type_guid' => BITPAGE_CONTENT_TYPE_GUID ); + $listHash = [ 'max_records' => $moduleParams['module_rows'], 'user_id' => $gQueryUserId, 'content_type_guid' => BITPAGE_CONTENT_TYPE_GUID ]; $lastComments = $cmt->getList( $listHash ); - $_template->tpl_vars['lastComments'] = new Smarty_variable( $lastComments); - $_template->tpl_vars['moretooltips'] = new Smarty_variable( isset($module_params["moretooltips"]) ? $module_params["moretooltips"] : 'n'); -} -?> + $gBitSmarty->assign( 'lastComments', $lastComments); + $gBitSmarty->assign( 'moretooltips', isset($module_params["moretooltips"]) ? $module_params["moretooltips"] : 'n'); +}
\ No newline at end of file |
