MyBB Community Forums

Full Version: Few Questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey,

Open global.php

Find
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] == "yes")
{
	eval("\$bbclosedwarning = \"".$templates->get("global_boardclosed_warning")."\";");
}
Below put
$whosonline = '';
if($mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")
{
	$lang->load("index");
	// 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);
	eval("\$whosonline = \"".$templates->get("index_whosonline")."\";");
}
This is the same code as the one on index.php, so remove it from index.php and just keep this new one in global.php


Now in the footer template put
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="tcat"><strong>{$lang->whos_online}</strong> [<a href="online.php">{$lang->complete_list}</a>]</td>
</tr>
<tr>
<td class="trow1"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
</tr>
</table>
<br />

Or you can put this code in Side Boxes additional boxes.

Editing the login box of side boxes which is the same as the portal, will affect both.

regards
I have an error with my loginbox, please could someone, either send me their loginbox code and the template name I need to put it into.
I get this error when I lopen threads at wiiroom:

error Wrote:
Warning: Cannot modify header information - headers already sent by (output started at /home/wiiroom/public_html/forum/inc/languages/english/portal.lang.php:1) in /home/wiiroom/public_html/forum/inc/functions.php on line 1121

wii room - reviews, discussion, wii second hand goods, cheats.


this also happens when I try and open threads around the forum.

Alex
ok thanks I have sorted this now,
I want to make a new loginbox style on the sidebox login boxes, I am editing the following template:
Portal Temaplates >> welcomeblock_guest
Though it has no effect =/

Alex
Please make sure there is no gap or space before <?php in portal.lang.php
The template is portal_welcome_guesttext
yes I have sorted that now, thanks alot zaher and tikitiki.
I am now having problems with my users avatars and WiiBux Plugins, for example have a look here: http://www.wiiroom.net/forum/showthread....118&page=1

My current postbit code is:
		{$header}
						<div class="postleft">
							<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
							<a href="member.php?action=profile&uid={$post['uid']}" class="postbituser">{$post['username']}</a>
							<h2>{$post['usertitle']}</h2>
						<img class="avatar" src="{$post['useravatar']}" />
							<ul class="userinfo">
								<li>Posts: {$post['postnum']}</li>
								<li>Join Date: {$post['userregdate']}</li>
                                                                <li>WiiBux: {$bux}</li>
							</ul>
							<ul class="userlinks">
								<li>{$post['onlinestatus']}</li>
                                                                   <li>Report</li><br/>
								
                                                                 
							</ul>

						</div>
						<div class="postright">
							<h4>{$post['subject']}</h4>
							<hr />
							<div class="padding" id="pid_{$post['pid']}">
								{$post['message']}
							</div>
							<hr />
							{$post['attachments']}
							{$post['signature']}
							<ul class="postlinks">
								<li>AIM</li>
								<li>YIM</li>
								<li>MSN</li>
								<li>ICQ</li>
							</ul>
						</div>
						<h6><span class="hide"></span></h6>
						<div class="separator"></div>
		{$footer}
		

Thanks alot,
Alex
Can you attach your current./inc/functions_post.php after being modified by the plugin here.

Plus the way the avatar is displayed now in the template will show an image place holder regardless if the user has an avatar or not.
have sent it via PM, it is massive.
can you suggest a better way to show an avatar then?
Alex
can anyone help me with this avatars?
What code do I need to put to display them?
I have previously asked you in one of your PMs to provide me with some templates, please check the PMs again and submit the templates here.
Pages: 1 2