Topic: Sidebar / whos online block
I installed a sidebar and also a welcome page in my forum. When I am logged in and at the welcome page, the whos online block on my sidebar doesn't show me as online.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Sidebar / whos online block
I installed a sidebar and also a welcome page in my forum. When I am logged in and at the welcome page, the whos online block on my sidebar doesn't show me as online.
you tryed hitting refresh?
sometimes does it for me.
Right now it seems to work. Maybe that was just because it was the first time or something
This isn't a bug with PunBB, moved.
this is the message punbb comes up with:
Warning: preg_replace(): Compilation failed: unmatched parentheses at offset 5 in /home/content/d/e/b/debsue/html/biblestudy/forum/include/parser.php on line 383
Warning: preg_replace(): No ending delimiter '#' found in /home/content/d/e/b/debsue/html/biblestudy/forum/include/parser.php on line 383
Warning: preg_replace(): Compilation failed: unmatched parentheses at offset 6 in /home/content/d/e/b/debsue/html/biblestudy/forum/include/parser.php on line 383
Warning: preg_replace(): No ending delimiter '#' found in /home/content/d/e/b/debsue/html/biblestudy/forum/include/parser.php on line 383
does anybody have an idea what that means?
in include/parser.php line 383ish there's probably a missing ";" <-- end of line of code char. I can only guess though, post a copy of your parser.php, but only like 2 or so lines above and below 383.
The first part (starting at line 348) is the actual change from the easybbcode mod (I don't know why I posted that here- I was obviously a little confused yesterday). The rest - including line 383 (I marked it) - was already in the file.
Well, here you go:
$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<ul>$1</ul>',
'<ol>$1</ol>',
'<li>? $1</li>',
'<li>$1</li>',
'<span style="color: $1">$2</span>',
'<span style="font-family: $1">$2</span>',
'<span style="font-family: $1">',
'</span>',
'<p align="$1">$2</p>',
'<span style="$1">$2</span>',
'<hr />',
'<hr />',
'<table>$1</table>',
'<div align="center">$1</div>',
'<tr>$1</tr>',
'<td>$1</td>',
'<del>$1</del>',
'<pre>$1</pre>',
'<pre>',
'</pre>',
'<sup>$1</sup>',
'<sub>$1</sub>',
'<span style="font-size: $1pt;">$2</span>',
'<span style="font-size: $1pt;">$2',
'</span>',
'<span style="background-color: #FFFF00; color: #000000">$1</span>');
// This thing takes a while! :)
$text = preg_replace($pattern, $replace, $text); //THIS IS LINE 383
return $text;
Does that help?
By the way, I just noticed that only happens when I use bold, italic, etc. - not the smilies... - in all my forums.
Second problem (actually that from the top of this page):
If I log in, my user name does not show up on the sidebar under "who is online" before I click on some other link.
Here is the questionable code from include/functions.php:
else
{
require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
$stats['total_users'] = $db->result($result);
$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
$stats['last_user'] = $db->fetch_assoc($result);
$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
if ($pun_config['o_users_online'] == '1')
{
// Fetch users online info and generate strings for output
$num_guests = 0;
$users = array();
$online = array();
$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
while ($pun_user_online = $db->fetch_assoc($result))
{
if ($pun_user_online['user_id'] > 1)
$users[] = "\n\t\t\t\t".'<a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a><br />';
else
++$num_guests;
}
$num_users = count($users);
$online[] = "\t\t\t\t".$lang_index['Users online'].': <strong>'.$num_users.'</strong><br />'."\n\t\t\t\t".$lang_index['Guests online'].': <strong>'.$num_guests.'</strong>'."\n\t\t\t"."\n";
if ($num_users > 0 && $num_users < 10)
$online[] = "\t\t\t"."\n\t\t\t\t".'<br /><strong>'.$lang_index['Online'].': </strong>'."\t\t\t\t".implode($users)."\n";
else
$online[] = "\t\t\t".'<div class="clearer"></div>'."\n";
}
return 'Welcome <strong>'.$pun_user['username'].'</strong><br />
<a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a><br /><br />
'.implode($online,'').'<br />
Users: <strong>'. $stats['total_users'].'</strong><br />
Topics: <strong>'.$stats['total_topics'].'</strong><br />
Posts: <strong>'.$stats['total_posts'].'</strong><br />';
}
}
I think it has to do with my new index page. My main page is now a welcome page - and it does not show up with the "who is online" footer...
Might that be the problem?
I am really not good in PHP. So, does anybody see in the above code why the user online list doesn't update when logging in?
I would really highly aprecciate help.
I have this problem as well using the miniportal hack and I can't find a way around it.
Bingiman
My solution to this problem is simple. I commented out this line in index.php
//define('PUN_QUIET_VISIT', 1);
dude.. go to punres.org go to wiki look at the mini-portal sections....
u need to add some lines to the header.php
and other useful stuff....
like creating a include/user folder for php inside the main.tpl
http://modelcrowd.com
punportal maxed out. with a few of my own mods...
Q
Hi Quaker,
Where did you get the mod (punfrontapage) to add blocks to both sides of your site?
Thanks
Bingiman
I figured it out. Now there is just one part left.
How can I use the echo-command in the function generate_whosonline()? I need it at the end inside the return-command (I guess, I have to throw that away, but it still does not really work because it says
unexpected T_STRING
or something like that.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Sidebar / whos online block
Powered by PunBB, supported by Informer Technologies, Inc.