Commit 6e38889c authored by chealer's avatar chealer

[ENH] change top_articles module to new module style (modules-doc).

[FIX] HTML special chars encoding
parent e9703c5c
......@@ -2824,6 +2824,7 @@ modules/mod-func-switch_lang.php -text
modules/mod-func-switch_theme.php -text
modules/mod-func-terminology.php -text
modules/mod-func-top_active_blogs.php -text
modules/mod-func-top_articles.php -text
modules/mod-func-top_file_galleries.php -text
modules/mod-func-top_files.php -text
modules/mod-func-top_forum_posters.php -text
......@@ -2850,7 +2851,6 @@ modules/mod-months_links.php -text
modules/mod-shoutbox.php -text
modules/mod-since_last_visit.php -text
modules/mod-since_last_visit_new.php -text
modules/mod-top_articles.php -text
modules/mod-translation.php -text
modules/mod-upcoming_events.php -text
modules/mod-user_bookmarks.php -text
......
<?php
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function module_top_articles_info() {
return array(
'name' => tra('Top articles'),
'description' => tra('Lists the specified number of articles with links to them, from the most visited one to the least.'),
'prefs' => array( 'feature_articles' ),
'params' => array(),
'common_params' => array('nonums', 'rows')
);
}
function module_top_articles( $mod_reference, $module_params ) {
global $tikilib, $smarty, $user;
$ranking = $tikilib->list_articles(0, $mod_reference['rows'], 'nbreads_desc', '', '', '', $user);
$smarty->assign('modTopArticles', $ranking["data"]);
}
<?php
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
global $tikilib, $smarty;
$ranking = $tikilib->list_articles(0, $module_rows, 'nbreads_desc', '', '', '', $user);
$smarty->assign('modTopArticles', $ranking["data"]);
$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'n');
{* $Id$ *}
{if $prefs.feature_articles eq 'y'}
{if !isset($tpl_module_title)}
{if $nonums eq 'y'}
{eval var="{tr}Top `$module_rows` articles{/tr}" assign="tpl_module_title"}
{else}
{eval var="{tr}Top articles{/tr}" assign="tpl_module_title"}
{/if}
{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="top_articles" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
{if $nonums != 'y'}<ol>{else}<ul>{/if}
{section name=ix loop=$modTopArticles}
<li><a class="linkmodule" href="{$modTopArticles[ix].articleId|sefurl:article}">{$modTopArticles[ix].title}</a></li>
<li><a class="linkmodule" href="{$modTopArticles[ix].articleId|sefurl:article}">{$modTopArticles[ix].title|escape}</a></li>
{/section}
{if $nonums != 'y'}</ol>{else}</ul>{/if}
{/tikimodule}
{/if}
{/tikimodule}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment