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.

FluxBB - v1.4.8

2

Re: Sidebar / whos online block

you tryed hitting refresh?
sometimes does it for me.

Re: Sidebar / whos online block

Right now it seems to work. Maybe that was just because it was the first time or something wink

FluxBB - v1.4.8

Re: Sidebar / whos online block

This isn't a bug with PunBB, moved.

Re: Sidebar / whos online block

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?

FluxBB - v1.4.8

Re: Sidebar / whos online block

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.

echo "deadram"; echo; fortune;

Re: Sidebar / whos online block

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?

FluxBB - v1.4.8

8 (edited by lie2815 2007-02-21 00:38)

Re: Sidebar / whos online block

By the way, I just noticed that only happens when I use bold, italic, etc. - not the smilies... - in all my forums.

FluxBB - v1.4.8

9 (edited by lie2815 2007-02-20 21:56)

Re: Sidebar / whos online block

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?

FluxBB - v1.4.8

Re: Sidebar / whos online block

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.

FluxBB - v1.4.8

Re: Sidebar / whos online block

I have this problem as well using the miniportal hack and I can't find a way around it.

Bingiman

Re: Sidebar / whos online block

My solution to this problem is simple. I commented out this line in index.php

//define('PUN_QUIET_VISIT', 1);

13 (edited by quaker 2007-02-25 22:49)

Re: Sidebar / whos online block

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

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Sidebar / whos online block

Hi Quaker,

Where did you get the mod (punfrontapage) to add blocks to both sides of your site?

Thanks
Bingiman

Re: Sidebar / whos online block

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.

FluxBB - v1.4.8