diff options
| author | spiderr <spider@viovio.com> | 2013-04-11 13:06:35 -0400 |
|---|---|---|
| committer | spiderr <spider@viovio.com> | 2013-04-11 13:06:35 -0400 |
| commit | f54c43b010ece19456a49571c869ba6be5a84020 (patch) | |
| tree | bd32b6369c19b72dd19912e5ce8311deb39bd711 | |
| parent | 1a1060cd28f81a48940fed822e12f43b3359aa4d (diff) | |
| download | blogs-f54c43b010ece19456a49571c869ba6be5a84020.tar.gz blogs-f54c43b010ece19456a49571c869ba6be5a84020.tar.bz2 blogs-f54c43b010ece19456a49571c869ba6be5a84020.zip | |
update modules for smarty 3 template centric variables, and assign modules to the _template
| -rw-r--r-- | modules/mod_last_blog_posts.php | 2 | ||||
| -rw-r--r-- | modules/mod_last_created_blogs.php | 5 | ||||
| -rw-r--r-- | modules/mod_last_created_blogs.tpl | 10 | ||||
| -rw-r--r-- | modules/mod_last_modified_blogs.php | 2 | ||||
| -rw-r--r-- | modules/mod_top_active_blogs.php | 2 | ||||
| -rw-r--r-- | modules/mod_top_visited_blogs.php | 4 |
6 files changed, 10 insertions, 15 deletions
diff --git a/modules/mod_last_blog_posts.php b/modules/mod_last_blog_posts.php index 5d9a7ef..fd93c31 100644 --- a/modules/mod_last_blog_posts.php +++ b/modules/mod_last_blog_posts.php @@ -65,4 +65,4 @@ $descriptionLength = ( !empty( $module_params['max_preview_length'] ) ? $module_ $_template->tpl_vars['blogPostsFormat'] = new Smarty_variable( (empty($module_params['format']); $_template->tpl_vars['descriptionLength'] = new Smarty_variable( $descriptionLength ); -$gBitSmarty->assign_by_ref( 'modLastBlogPosts', $blogPosts["data"] ); +$_template->tpl_vars['modLastBlogPosts'] = new Smarty_variable( $blogPosts["data"] ); diff --git a/modules/mod_last_created_blogs.php b/modules/mod_last_created_blogs.php index d7eb948..58dd06c 100644 --- a/modules/mod_last_created_blogs.php +++ b/modules/mod_last_created_blogs.php @@ -18,8 +18,5 @@ $listHash['sort_mode'] = 'created_desc'; BitUser::userCollection( $module_params, $listHash ); $blog = new BitBlog(); -$ranking = $blog->getList( $listHash ); -if( !empty( $ranking['data'] ) ) { - $gBitSmarty->assign('modLastCreatedBlogs', $ranking["data"]); -} +$_template->tpl_vars['modLastCreatedBlogs'] = new Smarty_variable( $blog->getList( $listHash ) ); ?> diff --git a/modules/mod_last_created_blogs.tpl b/modules/mod_last_created_blogs.tpl index a9c0a9d..a584efe 100644 --- a/modules/mod_last_created_blogs.tpl +++ b/modules/mod_last_created_blogs.tpl @@ -1,6 +1,6 @@ {* $Header$ *} {strip} -{if $gBitSystem->isPackageActive( 'blogs' )} +{if $gBitSystem->isPackageActive( 'blogs' ) && $modLastCreatedBlogs} {if $nonums eq 'y'} {eval var="{tr}Last `$module_rows` Created blogs{/tr}" assign="tpl_module_title"} {else} @@ -8,11 +8,9 @@ {/if} {bitmodule title="$moduleTitle" name="last_created_blogs"} <ol class="blogs"> - {section name=ix loop=$modLastCreatedBlogs} - <li><a href="{$modLastCreatedBlogs[ix].blog_url}">{$modLastCreatedBlogs[ix].title|escape|default:"Blog `$modLastCreatedBlogs[ix].blog_id`"}</a></li> - {sectionelse} - <li></li> - {/section} + {foreach from=$modLastCreatedBlogs item=blogHash} + <li><a href="{$blogHash.blog_url}">{$blogHash.title|escape|default:"Blog `$blogHash.blog_id`"}</a></li> + {/foreach} </ol> {/bitmodule} {/if} diff --git a/modules/mod_last_modified_blogs.php b/modules/mod_last_modified_blogs.php index 535adec..4c953df 100644 --- a/modules/mod_last_modified_blogs.php +++ b/modules/mod_last_modified_blogs.php @@ -21,5 +21,5 @@ BitUser::userCollection( $moduleParams, $listHash ); $blog = new BitBlog(); $ranking = $blog->getList( $listHash ); -$gBitSmarty->assign('modLastModifiedBlogs', $ranking); +$_template->tpl_vars['modLastModifiedBlogs'] = new Smarty_variable( $ranking); ?> diff --git a/modules/mod_top_active_blogs.php b/modules/mod_top_active_blogs.php index 9ddc059..6a03f77 100644 --- a/modules/mod_top_active_blogs.php +++ b/modules/mod_top_active_blogs.php @@ -21,6 +21,6 @@ $listHash['is_active'] = TRUE; $blog = new BitBlog(); $ranking = $blog->getList( $listHash ); if( !empty( $ranking['data'] ) ) { - $gBitSmarty->assign('modTopActiveBlogs', $ranking["data"]); + $_template->tpl_vars['modTopActiveBlogs'] = new Smarty_variable( $ranking["data"]); } ?> diff --git a/modules/mod_top_visited_blogs.php b/modules/mod_top_visited_blogs.php index 459f551..c1eef23 100644 --- a/modules/mod_top_visited_blogs.php +++ b/modules/mod_top_visited_blogs.php @@ -27,6 +27,6 @@ BitUser::userCollection( $_REQUEST, $listHash ); $blog = new BitBlog(); $ranking = $blog->getList( $listHash ); -$gBitSmarty->assign('modTopVisitedBlogs', $ranking); -$gBitSmarty->assign('bulletSrc', isset($params["bullet"]) ? $params['bullet'] : NULL); +$_template->tpl_vars['modTopVisitedBlogs'] = new Smarty_variable( $ranking); +$_template->tpl_vars['bulletSrc'] = new Smarty_variable( isset($params["bullet"]) ? $params['bullet'] : NULL); ?> |
