hallo,
im index_template nach {$boardstats}:
wio.php im rootverzeichnis:
index_whosonline:
ist dies aktuell alles oder sind Änderungen zu tätigen, da dies ja für mybb 1.4 galt.
im index_template nach {$boardstats}:
PHP-Code:
<script type="text/javascript">
<!--
function wio_load()
{
new Ajax.Request('wio.php', {method: 'get', onComplete: function(request) { $('wio').innerHTML = request.responseText; }});
}
wio_load();
setInterval("wio_load()", 30000);
//-->
</script>
wio.php im rootverzeichnis:
PHP-Code:
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require_once "./global.php";
// Load global language phrases
$lang->load("index");
$whosonline = '';
if($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)
{
// Get the online users.
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$comma = '';
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY u.username ASC, s.time DESC
");
$forum_viewers = array();
$membercount = 0;
$onlinemembers = '';
$guestcount = 0;
$anoncount = 0;
$doneusers = array();
// Fetch spiders
$spiders = $cache->read("spiders");
// Loop through all users.
while($user = $db->fetch_array($query))
{
// Create a key to test if this user is a search bot.
$botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
// Decide what type of user we are dealing with.
if($user['uid'] > 0)
{
// The user is registered.
if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
{
// If the user is logged in anonymously, update the count for that.
if($user['invisible'] == 1)
{
++$anoncount;
}
++$membercount;
if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{
// If this usergroup can see anonymously logged-in users, mark them.
if($user['invisible'] == 1)
{
$invisiblemark = "*";
}
else
{
$invisiblemark = '';
}
// Properly format the username and assign the template.
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = ", ";
}
// This user has been handled.
$doneusers[$user['uid']] = $user['time'];
}
}
elseif(my_strpos($user['sid'], "bot=") !== false && $spiders[$botkey])
{
// The user is a search bot.
$onlinemembers .= $comma.format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']);
$comma = ", ";
++$botcount;
}
else
{
// The user is a guest.
++$guestcount;
}
if($user['location1'])
{
$forum_viewers[$user['location1']]++;
}
}
// Build the who's online bit on the index page.
$onlinecount = $membercount + $guestcount;
if($onlinecount != 1)
{
$onlinebit = $lang->online_online_plural;
}
else
{
$onlinebit = $lang->online_online_singular;
}
if($membercount != 1)
{
$memberbit = $lang->online_member_plural;
}
else
{
$memberbit = $lang->online_member_singular;
}
if($anoncount != 1)
{
$anonbit = $lang->online_anon_plural;
}
else
{
$anonbit = $lang->online_anon_singular;
}
if($guestcount != 1)
{
$guestbit = $lang->online_guest_plural;
}
else
{
$guestbit = $lang->online_guest_singular;
}
$lang->online_note = $lang->sprintf($lang->online_note, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins'], my_number_format($membercount), $memberbit, my_number_format($anoncount), $anonbit, my_number_format($guestcount), $guestbit);
echo $lang->online_note."<br />".$onlinemembers;
}
?>
index_whosonline:
PHP-Code:
<tr>
<td class="tcat"><span class="smalltext"><strong>{$lang->whos_online}</strong>{$dvz_lp_list_link}</span></td>
</tr>
<tr>
<td class="trow1"><span class="smalltext"><div id="wio">{$lang->online_note}<br />{$onlinemembers}</div></span></td>
</tr>
ist dies aktuell alles oder sind Änderungen zu tätigen, da dies ja für mybb 1.4 galt.
Mit freundlichen Grüßen
Für etwaige Tipps, Vorschläge oder Anleitungen von mir gebe ich keine Gewähr. Die Durchführung erfolgt auf eigene Gefahr!
Für etwaige Tipps, Vorschläge oder Anleitungen von mir gebe ich keine Gewähr. Die Durchführung erfolgt auf eigene Gefahr!