Commit fda338b0 authored by chealer's avatar chealer

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

[FIX] grammar
parent 755c1b97
......@@ -2838,6 +2838,7 @@ modules/mod-func-change_category.php -text
modules/mod-func-featured_links.php -text
modules/mod-func-file_galleries.php -text
modules/mod-func-google.php -text
modules/mod-func-logged_users.php -text
modules/mod-func-switch_lang.php -text
modules/mod-groups_emulation.php -text
modules/mod-last_actions.php -text
......@@ -2861,7 +2862,6 @@ modules/mod-last_tracker_comments.php -text
modules/mod-last_tracker_items.php -text
modules/mod-last_visitors.php -text
modules/mod-live_support.php -text
modules/mod-logged_users.php -text
modules/mod-menupage.php -text
modules/mod-messages_unread_messages.php -text
modules/mod-minichat.php -text
......
......@@ -5,9 +5,19 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
global $tikilib, $smarty;
$logged_users = $tikilib->count_sessions();
$smarty->assign('logged_users', $logged_users);
function module_logged_users_info() {
return array(
'name' => tra('Online users'),
'description' => tra('Displays the number of users logged in.'),
'prefs' => array(),
'params' => array(),
);
}
function module_logged_users( $mod_reference, $module_params ) {
global $tikilib, $smarty;
$logged_users = $tikilib->count_sessions();
$smarty->assign('logged_users', $logged_users);
}
\ No newline at end of file
{* $Id$ *}
{if !isset($tpl_module_title)}{assign var=tpl_module_title value="{tr}Online users{/tr}"}{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="logged_users" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
<span class="user-box-text">{tr}We have{/tr} {$logged_users} {tr}online users{/tr}</span>
<span class="user-box-text">{tr}We have{/tr} {$logged_users}
{if $logged_users > 1}
{tr}online users.{/tr}
{else}
{tr}online user.{/tr}
{/if}</span>
{/tikimodule}
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