04.09.2008, 20:22
(Dieser Beitrag wurde zuletzt bearbeitet: 04.09.2008, 20:23 von DaStaFlexX.)
Heyo ![Smile Smile](https://www.mybb.de/forum/images/smilies/smile.gif)
So habe gemerkt das diese coole Sache bei MyBB 1.41 nicht mehr funktioniert!
Folgende Codes sind noch noch nicht auf MyBB 1.41 aktualisiert.
Das hab ich im "index" Template stehen:
Inhalt von "index_whosonline"
Inhalt von "wio.php"
Ich komm da nicht klar damit, habe in der "index.php mal nach dem Code geschaut und auch versucht zu übernehmen,
Nur geht das bei mir irgendwie nicht !
Kann mir jemand helfen beim anpassen?
greetz DaStaFlexX
*Edit*
Im AdminCP -> Themes -> global.css -> .codeblock
max-width: 400px; einfügen.
Dann wird dein Design nicht so gesprengt!
![Smile Smile](https://www.mybb.de/forum/images/smilies/smile.gif)
So habe gemerkt das diese coole Sache bei MyBB 1.41 nicht mehr funktioniert!
Folgende Codes sind noch noch nicht auf MyBB 1.41 aktualisiert.
Das hab ich im "index" Template stehen:
Code:
<script type="text/javascript">
<!--
function wio_load()
{
new ajax('wio.php', {method: 'get', update: 'wio'});
}
wio_load();
setInterval("wio_load()", 30000);
//-->
</script>
Inhalt von "index_whosonline"
Code:
<tr>
<td class="tcat" colspan="4"><span class="smalltext"><strong>{$lang->whos_online}</strong> [<a href="online.php">{$lang->complete_list}</a>]</span></td>
</tr>
<tr>
<td class="trow1" width="4%" align="center" valign="center"><img src="images/online2.gif" alt="" /></td>
<td class="trow1" colspan="3"><span class="smalltext"><div id="wio">{$lang->online_note}<br />{$onlinemembers}</div></span></td>
</tr>
Inhalt von "wio.php"
PHP-Code:
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require "./global.php";
$lang->load("index");
$whosonline = '';
if($mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")
{
// Get the online users.
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$comma = '';
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, 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
");
$membercount = 0;
$onlinemembers = '';
$guestcount = 0;
$anoncount = 0;
$doneusers = array();
// Loop through all users.
while($user = $db->fetch_array($query))
{
// Create a key to test if this user is a search bot.
$botkey = 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'] == "yes")
{
++$anoncount;
}
++$membercount;
if($user['invisible'] != "yes" || $mybb->usergroup['canviewwolinvis'] == "yes" || $user['uid'] == $mybb->user['uid'])
{
// If this usergroup can see anonymously logged-in users, mark them.
if($user['invisible'] == "yes")
{
$invisiblemark = "*";
}
else
{
$invisiblemark = '';
}
// Properly format the username and assign the template.
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = ", ";
}
// This user has been handled.
$doneusers[$user['uid']] = $user['time'];
}
}
elseif(strstr($user['sid'], "bot=") !== false && $session->bots[$botkey])
{
// The user is a search bot.
$onlinemembers .= $comma.format_name($session->bots[$botkey], $session->botgroup);
$comma = ", ";
++$botcount;
}
else
{
// The user is a guest.
++$guestcount;
}
}
// 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 = 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;
}
?>
Ich komm da nicht klar damit, habe in der "index.php mal nach dem Code geschaut und auch versucht zu übernehmen,
Nur geht das bei mir irgendwie nicht !
Kann mir jemand helfen beim anpassen?
greetz DaStaFlexX
*Edit*
Im AdminCP -> Themes -> global.css -> .codeblock
max-width: 400px; einfügen.
Dann wird dein Design nicht so gesprengt!
![Wink Wink](https://www.mybb.de/forum/images/smilies/wink.gif)