11
i also tried this using the profile module in XOOPS 2.3...can someone correct this code?..i am always displayed as offline
1. open modules/profile/userinfo.php
find
//User info
$xoopsTpl->assign('uname', $thisUser->getVar('uname'));
$xoopsTpl->assign('email', $email);
$xoopsTpl->assign('avatar', $avatar);
$xoopsTpl->assign('recent_activity', _PROFILE_MA_RECENTACTIVITY);
$xoBreadcrumbs[] = array('title' => _PROFILE_MA_USERINFO);
include 'footer.php';
?>
add this before the code above
$user_online = new XoopsUser($thisUser->getVar('uid'));
if ($user_online->isOnline())
{
$xoopsTpl->assign('user_online', true);
}
Save and close
2. open modules/profiles/templates/profile_userinfo.html
find
<{foreach item=category from=$categories}>
<{if isset($category.fields)}>
<div class="profile-list-category" id="profile-category-<{$category.cat_id}>">
<table class="outer" cellpadding="4" cellspacing="1">
<tr>
<th colspan="2" align="center"><{$category.cat_title}>th>
tr>
<{foreach item=field from=$category.fields}>
<tr>
<td class="head"><{$field.title}>td>
<td class="even"><{$field.value}>td>
tr>
<{/foreach}>
table>
div>
<{/if}>
<{/foreach}>
add this code before the code above
<br /><b> Online Status:b> <{if $user_online == true}>
<span style='color:#ee0000;'>Onlinespan><br />
<{else}>
<span style='color:#000000;'>Offlinespan><br />
<{/if}>
save & close.
clear cache (eg:xoops_data\caches\smarty_compile) (except for index.html)