2007-02-10, 08:56 PM
2007-02-10, 09:35 PM
hey
open ./memberlist.php
find
Above it add
in Admin CP > Templates > Modify /Delete > Member list templates > memberlist_row template
find
Now in Admin CP > Templates > Modify /Delete > Member list templates > memberlist Template
find
2 times and replace it with
regards
open ./memberlist.php
find
eval("\$member .= \"".$templates->get("memberlist_row")."\";");
Above it add
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$online = '';
$session_query = $db->query("SELECT * FROM ".TABLE_PREFIX."sessions WHERE time>'$timesearch' AND uid='".$users['uid']."' LIMIT 0,1");
if($db->num_rows($session_query) > 0)
{
$online = "ONLINE";
}
else
{
$online = "OFFLINE";
}
You might need to custimize the output abit instead of text to images, it depend on what you want.in Admin CP > Templates > Modify /Delete > Member list templates > memberlist_row template
find
<td class="trow2">{$users['postnum']}</td>
below it add<td class="trow2">{$online}</td>
Now in Admin CP > Templates > Modify /Delete > Member list templates > memberlist Template
find
<td class="tcat"><span class="smalltext"><strong>{$lang->posts}</strong></span></td>
below it add <td class="tcat"><span class="smalltext"><strong>Status</strong></span></td>
also find colspan="6"
2 times and replace it with
colspan="7"
regards
2007-02-10, 09:41 PM
if(mysql_num_rows($session_query) > 0)
Should be:if($db->num_rows($session_query) > 0)
2007-02-10, 10:09 PM
LOL it still works.. i have only used the raw function not the one of mybb.. well it works tho
2007-02-10, 10:12 PM
You should use the mybb functions because you do not have the added capability to use mysqli if you don't.
2007-02-10, 10:15 PM
Oh well i usually do but i was too lazy this time to remember how the function looks like after all this time away .. fixing my code.
2007-02-10, 10:28 PM
Thank you very much.
But this doesn't show AWAY.
How can we show if any user is AWAY?
But this doesn't show AWAY.
How can we show if any user is AWAY?
2007-02-10, 10:54 PM
LOL alright away..
so instead of
use
so instead of
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$online = '';
$session_query = $db->query("SELECT * FROM ".TABLE_PREFIX."sessions WHERE time>'$timesearch' AND uid='".$users['uid']."' LIMIT 0,1");
if($db->num_rows($session_query) > 0)
{
$online = "ONLINE";
}
else
{
$online = "OFFLINE";
}
use
if($users['away'] == "yes")
{
$online = "AWAY";
}
else
{
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$online = '';
$session_query = $db->query("SELECT * FROM ".TABLE_PREFIX."sessions WHERE time>'$timesearch' AND uid='".$users['uid']."' LIMIT 0,1");
if($db->num_rows($session_query) > 0)
{
$online = "ONLINE";
}
else
{
$online = "OFFLINE";
}
}
2007-02-10, 11:10 PM
You could just add, above the eval line.
if($users['away'] == "yes")
{
$online = "AWAY";
}
else if($users['lastactive'] > time() - $mybb->settings['wolcutoff'])
{
$online = "ONLINE";
}
else
{
$online = "OFFLINE";
}
Then you don't have to run another query.2007-02-10, 11:21 PM
Great work.
Thank you so much.
Thank you so much.