MyBB Community Forums

Full Version: Who's Online Data not pulling up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

As shown in the pictures below, the data requested seems to be bringing back the code rather than the translation, if that makes sense.

[Image: Who_Online_Issue.jpg]

[Image: Who_Online_Issue2.jpg]

If you know how to resolve this issue please reply, if you need more information, please reply here or email me at [email protected].





(For users experiencing this issue I'm providing a text format so their Search will yield results below)
Board Statistics
Who's Online [Complete List]
{1} {2} active ({4} {5}, {6} of whom {7} invisible, and {8} {9}).
--
Generated in 0. seconds with 0 queries. Memory Usage: {3}
where are you putting that code ?
or is that the display ?
(2012-02-15, 08:51 PM)JimR Wrote: [ -> ]where are you putting that code ?
or is that the display ?

The code at the bottom of my post is for users using the search feature here on this website, I'll edit it so it's less confusing.

The way it's seen in the images is how it's showing up on my forum at this moment.
(2012-02-15, 09:00 PM)Captivate Wrote: [ -> ]
(2012-02-15, 08:51 PM)JimR Wrote: [ -> ]where are you putting that code ?
or is that the display ?

The code at the bottom of my post is for users using the search feature here on this website, I'll edit it so it's less confusing.

The way it's seen in the images is how it's showing up on my forum at this moment.

so what is the code to produce that ? and where have you put it ?
JimR Wrote:so what is the code to produce that ? and where have you put it ?

./inc/languages/english/index.lang.php is where Board Statistics seems to be pulling from, when I open the .php file this is the line:

$l['online_note'] = "{1} {2} active  ({4} {5}, {6} of whom {7} invisible, and {8} {9})."; 

Here is the complete file:

<?php
/**
 * MyBB 1.6 English Language Pack
 * Copyright 2010 MyBB Group, All Rights Reserved
 * 
 * $Id: index.lang.php 5297 2010-12-28 22:01:14Z Tomm $
 */

$l['boardstats'] = "Board Statistics";
$l['new_posts'] = "Forum Contains New Posts";
$l['no_new_posts'] = "Forum Contains No New Posts";
$l['forum_locked'] = "Forum is Locked";
$l['forum_unapproved_posts_count'] = "There are currently {1} unapproved posts in this forum.";
$l['forum_unapproved_post_count'] = "There is currently 1 unapproved post in this forum.";
$l['forum_unapproved_threads_count'] = "There is currently {1} unapproved threads in this forum.";
$l['forum_unapproved_thread_count'] = "There is currently 1 unapproved thread in this forum.";
$l['markread'] = "Mark All Forums Read";
$l['forumteam'] = "Forum Team";
$l['forumstats'] = "Forum Statistics";
$l['todays_birthdays'] = "Today's Birthdays";
$l['birthdayhidden'] = "Hidden";
$l['quick_login'] = "Quick Login:";
$l['index_logout'] = "Log Out";
$l['private_messages'] = "Private Messages";
$l['pms_new'] = "You have {1} new messages since your last visit.";
$l['pms_unread_total'] = "(You have {1} unread messages and {2} total messages in all of your folders.)";
$l['stats_posts_threads'] = "Our members have made a total of {1} posts in {2} threads.";
$l['stats_numusers'] = "We currently have {1} members registered.";
$l['stats_newestuser'] = "Please welcome our newest member, <b>{1}</b>";
$l['stats_mostonline'] = "The most users online at one time was {1} on {2} at {3}";
$l['whos_online'] = "Who's Online";
$l['complete_list'] = "Complete List";
$l['online_online_plural'] = "users";
$l['online_online_singular'] = "user";
$l['online_member_plural'] = "members";
$l['online_member_singular'] = "member";
$l['online_anon_plural'] = "are";
$l['online_anon_singular'] = "is";
$l['online_guest_plural'] = "guests";
$l['online_guest_singular'] = "guest";
$l['online_note'] = "{1} {2} active  ({4} {5}, {6} of whom {7} invisible, and {8} {9})."; 
$l['subforums'] = "<strong>Sub Forums:</strong>";
?>

(2012-02-15, 09:10 PM)Captivate Wrote: [ -> ]
JimR Wrote:so what is the code to produce that ? and where have you put it ?

./inc/languages/english/index.lang.php is where Board Statistics seems to be pulling from, when I open the .php file this is the line:

$l['online_note'] = "{1} {2} active  ({4} {5}, {6} of whom {7} invisible, and {8} {9})."; 

Here is the complete file:

<?php
/**
 * MyBB 1.6 English Language Pack
 * Copyright 2010 MyBB Group, All Rights Reserved
 * 
 * $Id: index.lang.php 5297 2010-12-28 22:01:14Z Tomm $
 */

$l['boardstats'] = "Board Statistics";
$l['new_posts'] = "Forum Contains New Posts";
$l['no_new_posts'] = "Forum Contains No New Posts";
$l['forum_locked'] = "Forum is Locked";
$l['forum_unapproved_posts_count'] = "There are currently {1} unapproved posts in this forum.";
$l['forum_unapproved_post_count'] = "There is currently 1 unapproved post in this forum.";
$l['forum_unapproved_threads_count'] = "There is currently {1} unapproved threads in this forum.";
$l['forum_unapproved_thread_count'] = "There is currently 1 unapproved thread in this forum.";
$l['markread'] = "Mark All Forums Read";
$l['forumteam'] = "Forum Team";
$l['forumstats'] = "Forum Statistics";
$l['todays_birthdays'] = "Today's Birthdays";
$l['birthdayhidden'] = "Hidden";
$l['quick_login'] = "Quick Login:";
$l['index_logout'] = "Log Out";
$l['private_messages'] = "Private Messages";
$l['pms_new'] = "You have {1} new messages since your last visit.";
$l['pms_unread_total'] = "(You have {1} unread messages and {2} total messages in all of your folders.)";
$l['stats_posts_threads'] = "Our members have made a total of {1} posts in {2} threads.";
$l['stats_numusers'] = "We currently have {1} members registered.";
$l['stats_newestuser'] = "Please welcome our newest member, <b>{1}</b>";
$l['stats_mostonline'] = "The most users online at one time was {1} on {2} at {3}";
$l['whos_online'] = "Who's Online";
$l['complete_list'] = "Complete List";
$l['online_online_plural'] = "users";
$l['online_online_singular'] = "user";
$l['online_member_plural'] = "members";
$l['online_member_singular'] = "member";
$l['online_anon_plural'] = "are";
$l['online_anon_singular'] = "is";
$l['online_guest_plural'] = "guests";
$l['online_guest_singular'] = "guest";
$l['online_note'] = "{1} {2} active  ({4} {5}, {6} of whom {7} invisible, and {8} {9})."; 
$l['subforums'] = "<strong>Sub Forums:</strong>";
?>

does the same code work in other language packs ?
(2012-02-15, 09:24 PM)JimR Wrote: [ -> ]does the same code work in other language packs ?

It should, this is the default from the template actually.

The things I've edited which might by some chance have altered it is:
(I'll add more if I can think of something that might have effected it.)
  • Added GoogleSEO plugin...

I'm not sure where the information {1},{2},{3} etc... is stored, in otherwords I don't know where index.lang.php is going to get the data that it needs, I suspect the problem would be in there.
(2012-02-15, 09:30 PM)Captivate Wrote: [ -> ]
(2012-02-15, 09:24 PM)JimR Wrote: [ -> ]does the same code work in other language packs ?

It should, this is the default from the template actually.

The things I've edited which might by some chance have altered it is:
(I'll add more if I can think of something that might have effected it.)
  • Added GoogleSEO plugin...

I'm not sure where the information {1},{2},{3} etc... is stored, in otherwords I don't know where index.lang.php is going to get the data that it needs, I suspect the problem would be in there.

I guess you have problem with templates if you have added the lang variable without calling the function it could fail do you have {$boardstats} anywhere in your index template ?
(2012-02-15, 09:50 PM)JimR Wrote: [ -> ]I guess you have problem with templates if you have added the lang variable without calling the function it could fail do you have {$boardstats} anywhere in your index template ?

It does come up in the index template.

Here's the template:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
	<dt><img src="{$theme['imgdir']}/on.gif" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/off.gif" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->no_new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/offlock.gif" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
	<dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html>


I fixed this issue, what I did was...

Revert to original template: index_boardstats.

Not sure how it was altered but there you go, such a simple fix.

Thank you for the help, Jim.

Here's the old template...
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead" colspan="2">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" title="[-]" /></div>
<div><div class="thead_text"><strong>{$lang->boardstats}</strong></div></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
<tr>
<td class="tcat"><span class="smalltext"><strong>{$lang->whos_online}</strong> [<a href="online.php">{$lang->complete_list}</a>]</span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->boardstats}</strong></span></td>
</tr>
<tr>
<td class="trow1"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
<td class="trow2"><span class="smalltext">
{$lang->stats_posts_threads}<br />
{$lang->stats_numusers}<br />
{$lang->stats_newestuser}<br />
{$lang->stats_mostonline}
</span>
</td>
</tr>

<tr>
	<td class="tfoot" style="text-align: right" colspan="2">
		<span class="smalltext">
			{$logoutlink}
			<a href="misc.php?action=markread{$post_code_string}">{$lang->markread}</a> &nbsp;
			<a href="showteam.php">{$lang->forumteam}</a> &nbsp;
			<a href="stats.php">{$lang->forumstats}</a>
		</span>
	</td>
</tr>
</tbody>
</table>

<br />

And here's the original template:
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>{$lang->boardstats}</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
{$whosonline}
{$birthdays}
{$forumstats}
<tr>
	<td class="tfoot" style="text-align: right">
		<span class="smalltext">
			{$logoutlink}
			<a href="misc.php?action=markread{$post_code_string}">{$lang->markread}</a> |
			<a href="showteam.php">{$lang->forumteam}</a> |
			<a href="stats.php">{$lang->forumstats}</a>
		</span>
	</td>
</tr>
</tbody>
</table>
<br />