This illustrates that BBCode smilies can only be used in decending order from the first (left-most) smiley chosen.






Unless you use your spacebar:

tongue:/;) cool smile


(32 replies, posted in Feature requests)

sonofsinner wrote:

No bigdeal about my Ques. , so take it how you want it.

Right.  I meant my answer to say, no person could see the User Avatar list if no person is logged in. smile


(32 replies, posted in Feature requests)

sonofsinner wrote:

Cool. But what will happend if no one is online?

That is the same as asking, "When a tree falls in an empty forest, does it make a sound?"  Clearly, no human will ever know.


(32 replies, posted in Feature requests)

Garciat wrote:

@whatrevolution: It worked perfectly for me.

Mine did not, unfortunately.  Switching to curly brackets on 'if {}' solved it.  I added an outer container so I could id="" and control it in CSS.  I placed an image to the left, and right of that container.


.brd #brd-user_avatars_left {
      top left no-repeat
    height: 133px;
    width: 89px;
    float: left;

.brd #brd-user_avatars_right {
      top left no-repeat
    height: 133px;
    width: 89px;
    float: right;

.brd #brd-user_avatars {
    margin-left: 100px;
    margin-right: 100px;


<div id="brd-main">
    <!-- forum_main_title -->
    <!-- forum_crumbs_top -->
    <!-- forum_main_menu -->
    <!-- forum_main_pagepost_top -->
    <!-- forum_main -->
    <!-- forum_main_pagepost_end -->
    <!-- forum_crumbs_end -->
  <div id="brd-user_avatars_left">&nbsp;</div>
  <div id="brd-user_avatars_right">&nbsp;</div>
  <!-- forum_include "user_avatars.php" -->


PHP Version     5.2.0-8+etch13
System     Linux 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64
Build Date     Sep 30 2008 18:29:09
Server API     Apache 2.0 Handler 


(32 replies, posted in Feature requests)

Parse error: syntax error, unexpected T_ENDIF in <snip>/forum/include/user/user_avatars.php on line 43

//Change this to how many avatars you want to be displayed
$limit = 5;

//If you want a clean look, change this to true
$clean = true;

if (substr(FORUM_PAGE, 0, 7) !== 'profile') {

if ($forum_config['o_users_online'] == '1')
    $array = array(
        'SELECT'    => ', o.username',
        'FROM'        => 'users AS o',
        'JOINS'        => array(
                'LEFT JOIN'        => 'online AS e',
                'ON'            => '('
        'WHERE'        => 'e.idle=0 AND!=1',
        'ORDER BY'    => 'e.logged DESC',
        'LIMIT'        => $limit
    $process = $forum_db->query_build($array) or error(__FILE__, __LINE__);
    while($cur_user = $forum_db->fetch_assoc($process))
        $pic_url = preg_replace("/\<img src=\"([^\"]+)\"(.*)\/\>/i", "$1", generate_avatar_markup($cur_user['id']));
        $avatars[] = '<a href="'.forum_link($forum_url['user'], $cur_user['id']).'" style="float:left;margin:10px;text-align:center;"><span style="display:block;width:'.$forum_config['o_avatars_width'].'px;height:'.$forum_config['o_avatars_height'].'px;background:transparent url(\''.$pic_url.'\') center center no-repeat;"></span>'.$cur_user['username'].'</a>';

require FORUM_ROOT.'lang/'.$forum_user['language'].'/index.php';

?><div id="brd-user_avatars"><?php
if (!$clean) { ?>
<div class="main-head"<?php echo (FORUM_PAGE == 'index') ? '' : ' style="margin-top:1em"' ?>>
    <h2 class="hn"><span>Online Users</span></h2>
<?php } ?>
<div class="gen-content" style="<?php echo (FORUM_PAGE == 'index') ? 'margin-bottom:1em;' : ''; echo ($clean) ? 'background:transparent;border:0;margin-top:1em;' : '' ?>padding:0">
    <?php echo ($forum_db->num_rows($process)>0) ? implode("\n\t", $avatars) : '<p style="padding: 5px 10px;">- No online users -</p>' ?>
<?php } ?>
function yes($a = null) {
  if (!empty($a)) if ($a != 'off') return TRUE;
$base_url = (yes($_SERVER['HTTPS']) ? 'https' : 'http').'://';

"Note that when using ISAPI with IIS, the value will be "off" if the request was not made through the HTTPS protocol. " … server.php

Sorry, Garciat, I can't see you smiling at me, it's 404.


Oh, that's embarassing.


They're soft errors, Notices, in my own code. smile

This is true, the protocol should not be part of the configured base URL.  It should instead use the request protocol for the reply.


(6 replies, posted in Feature requests)

I agree with the tone that Matt has set forth, and would add that Michael has already brought Trac into the discussion; and that is where my mind immediately went.  Informer, Flux, and myself use Trac, so for this community I would look toward an extension which is able to pull changeset data from a Trac project, bind a forum to a Trac project, and bind a thread to a file or ticket.

There is no need for this in the core, we can do this ourselves via extensions on the PunBB side, and via Plugins on the Trac side.


A little something I picked up from CakePHP (I'm not using CakePHP in this application, btw):

 * Short directory separator.

 * Short path separator.

[Edit: scroll down to further posts for a good laugh smile ]

I have a (currently) file-based CMS which really does not like PunBB's common.php and I'm stumped at the result.  Without posting the entire source, here are some errors and the relevant lines:

I bring PunBB in during system setup, either in or  In either case, the require_once() occurs while other similar work is being done, no output has generated, and no header has been sent to client.  It looks like this:

 * PunBB.
define('FORUM_ROOT', HONEST_APP.'..'.DS.'..'.DS.'subdomain_html'.DS.'forum'.DS);

Then without fail, and consistently regardless of where I bring PunBB in, I get plenty of errors in an otherwise working system:

[Tue Dec 16 22:26:26 2008] [error] [client <snip>] PHP Notice:  Undefined variable: require in <snip>/toolbox/honest/ on line 52

That is $require inside a function, erroneously returning undefined in:

function requireOther($name) {
  $available = array(
    'smarty' => 'smarty'.DS.'libs'.DS.'Smarty.class.php',
  if (!empty($available[$name])) $require = TOOLBOX_PHP.$available[$name];
  if (!is_file($require)) $require = TOOLBOX_PHP.$name.'.inc.php';
  if (!is_file($require)) $require = TOOLBOX_PHP.$name.'.php';
  if (is_file($require)) return require_once($require);

Off-hand I see an improvement to make in that function, but ignoring that, it now gets worse; look at this:

[Tue Dec 16 22:26:26 2008] [error] [client <snip>] PHP Notice:  Use of undefined constant breadcrumbs - assumed 'breadcrumbs' in <snip>/toolbox/honest/ on line 507

That is a case name inside a switch() being parsed as a constant!

  if (is_array($core->getConf('document','print_order'))) {
    foreach ($core->getConf('document','print_order') as $i => $v) {
      switch ($i) {
        case breadcrumbs:
        case account:
        case motd:
        case page:
        case index:

I have to assume that somewhere in the trail of files PunBB is including, there is a typo/bug that is thoroughly breaking my order of operations; but I don't know the code well enough to see it yet, and I can't be sure that's accurate.  Any ideas on what the hell is happening here?


(48 replies, posted in PunBB 1.3 extensions)

Fair enough.  I'm sorry an argument hijacked your thread, Garciat.  I like the extension idea. smile


(8 replies, posted in PunBB 1.3 extensions)

Right.  An extreme example would be GaiaOnline, which grew from mod/hacks of phpBB2.

While working on adding [center ][/ center] to BBCode, I also had [video ][/ video] extension installed.  By this I discovered that installing [center ] after installing [video ] would cause [video ] to break when it is wrapped in [center ].  Installing [center ] before installing [video ] allows the two extensions to coexist.

I must assume this is caused by the order in which these tags are parsed, due to the order of extension installation, which adds BBCode tags to $tags[].

A similar conflict has already been noted elsewhere, which is that pre-parsing posts for URLs can break new tags like [video ].  Turning the URL parsing feature off is no solution, since it omits a valuable function, and the solution must be dug out of the forum.

Both defects point to the need for prioritization of BBCode patterns.  One solution could be an administrator's form in which tag priority can be modified.

Free URLs shouldn't be wrapped in [url ] as a pre-parse action, but rather as a post-parse action.

Thanks, Slavok.  Regex always gets me in that bind where I over-complicate the pattern, trying to write one that won't be too greedy.  Your (.*?) worries me, but I'll leave it for now.

I got rid of the <center> and replaced with <div>, because PunBB is strict XHTML.

This process showed me a potential defect in the BBCode parser; I'm heading to the bug reports board now.


(48 replies, posted in PunBB 1.3 extensions)

I agree with sirena's post.  This is why I began by disagreeing with the philosophy, rather than the people directly.  However, I see that my use of "you" and "YOU" in my example scenario probably did more than personalize it; it allowed Garciat to perceive direct offense.

I called the philosophy (and those harboring it) lazy, which is accurate.  You'll just have to grow up and thicken your emotional skin a little.  I pissed you off because you aren't mature enough to parse an accurate criticism, not because I wasn't polite enough.  The previous sentence will probably piss you off too, and that is ok because it is also an accurate statement, and your reaction proves it.

It's not personal, and the way I see it is that perhaps I can explain it well enough that even though I make you angry, you'll understand.  Time will tell.


(12 replies, posted in PunBB 1.3 extensions)

Thanks, Garciat.  I use your Default Avatar extension, and appreciated it being here.


(8 replies, posted in PunBB 1.3 extensions)

By "Arcade", you mean ... an arbitrary list of games that can be played by forum members?  Some of them multiplayer?

It's possible, of course.  It's possible in very many ways; so you'll need to be more specific toward what type of arcade, and what games.

I think that the most accessible first step in this would be to find some existing online-game communities, and integrate some interaction with their gaming.  For instance, feed your username on GameSite-A into your forum profile, and our extension fetches your score data from GameSite-A, which would rank you inside the forum.  Next step would be fetching a list of games to play, then (the harder part) initiating games between forum members.

All of this depends upon what existing game community you integrate, or if you do that at all.


(48 replies, posted in PunBB 1.3 extensions)

sirena wrote:

It's great what Garciat is doing. This extension looks useful.


It is always advisable tonevertrust users [...]

Sure, I agree and have thanked Garciat for his work before, but if he's going to be haughty and arrogantly deny all criticism, and deny faults in his logic, then I'm not going to be nice.  I'm going to reflect his arrogance back at him, and no one likes an arrogant know it all.


(2 replies, posted in PunBB 1.3 extensions)

I love it.  This is a perfect tool for giving motion and a sense of urgent anticipation to an announced important date.  Good call.

FalconFour wrote:

Seriously: fixed-defining the positions of elements to "fake" a table out of a list element isdoin it rong. Very "rong".

No, that is a very correct and valid way to use CSS, it is EXTREMELY well documented and tested (although Informer has not perfected their Oxygen css yet).

FalconFour wrote:

Seeing as though, thanks to the genius that decided to inject CSS into every aspect of PunBB, the whole page layout is constructed in CSS, all I could really do is recycle and abuse other existing CSS classes and hope it doesn't break.

Right, the entire page styling is SUPPOSED to be in CSS, because if you drop all the CSS files, you are given a cleanly printed page which follows a logical top-to-bottom (vertical) progression of sentences which make sense.  This is ideal for web-pages because it lends itself well to being printed on a wide variety of screen types, sizes and resolutions.  A 1990's style rigid table design of this same page could NEVER be printed properly on a PDA or cell phone screen... this one can, if you drop the CSS or write a PDA appropriate CSS.

You're complaining too much, and projecting your frustration.  Truth of the matter is that your work wasn't perfect, either, but it was also nearly good enough.  Study more, and blame less, please.

That said, thanks for the extension, sir.  I like it, was inspired to fix it, and am inspired to consider improvements after I study it more.

* Closed a <div> that was breaking sibling <div>.
* Added the requested <h2>

<?xml version="1.0" encoding="utf-8"?>

<extension engine="1.0">
    <title>Active Topics List on Index</title>
    <description>This will add the x most recent posts to the index page of the forum for easy navigation and attention-grabbing.</description>
    <author>Slavok, FalconFour and whatrevolution</author>
        <hook id="in_main_output_start"><![CDATA[
$topics_count = 5;
$query_active_topics= array(
    'SELECT'    => ' AS tid, t.poster, t.subject, t.posted AS has_posted, t.last_post, t.last_post_id, t.num_replies, t.num_views, t.closed, t.sticky, t.forum_id, t.last_poster',
    'FROM'        => 'topics AS t',
    'JOINS'        => array(
            'INNER JOIN'    => 'forums AS f',
            'ON'            => ''
            'LEFT JOIN'     => 'forum_perms AS fp',
            'ON'            => '( AND fp.group_id='.$forum_user['g_id'].')'
    'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1)',
    'ORDER BY'    => 't.last_post DESC',
    'LIMIT' => $topics_count
$result_active = $forum_db->query_build($query_active_topics) or error(__FILE__, __LINE__);

if ($forum_db->num_rows($result_active) == 0) {

    <div class="main-content main-message">
        <p>There are no active topics.</p>
} else {
    require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/forum.php';

    <div class="main-head">
      <h2 class="hn"><span>Most Recent Posts</span></h2>
    <div class="main-subhead">
        <p class="item-summary">
                <strong class="subject-title"><?php echo $lang_index['Topics']; ?></strong>
                <strong class="info-replies"><?php echo $lang_forum['Replies']; ?></strong>
                <strong class="info-views"><?php echo $lang_forum['Views']; ?></strong>
                <strong class="info-lastpost"><?php echo $lang_index['last post']; ?></strong>
    <div class="main-content main-forum">                    

        $item_num = 1;

        while ($cur_set = $forum_db->fetch_assoc($result_active))
           // Start from scratch
            $item_subject = $item_body = $item_status = $item_nav = $item_title = array();
            $item_indicator = ''; 
            if (!empty($item_nav))
                $item_title['nav'] = '<span class="item-nav">'.sprintf($lang_forum['Topic navigation'], implode('&#160;&#160;', $item_nav)).'</span>';

            if ($cur_set['sticky'] == '1')
                $item_subject_status['sticky'] = $lang_forum['Sticky'];
                $item_status['sticky'] = 'sticky';

            if ($cur_set['closed'] != '0')
                $item_subject_status['closed'] = $lang_forum['Closed'];
                $item_status['closed'] = 'closed';
            if (!empty($item_subject_status))
                $item_title['status'] = '<span class="item-status">'.sprintf($lang_forum['Item status'], implode(' ', $item_subject_status)).'</span>';
            $item_title['link'] = '<a href="'.forum_link($forum_url['post'], $cur_set['last_post_id']).'">'.forum_htmlencode($cur_set['subject']).'</a>';
            if (!$forum_user['is_guest'] && $forum_config['o_show_dot'] == '1' && $cur_set['has_posted'] > 0)
                $item_title['posted'] = '<span class="posted-mark">'.$lang_forum['You posted indicator'].'</span>';
                $item_status['posted'] = 'posted';

            $item_body['subject']['title'] = '<h3 class="hn"><span class="item-num">'.forum_number_format(++$item_num).'</span> '.implode(' ', $item_title).'</h3> <em> by '.forum_htmlencode($cur_set['poster']).'</em>';

            // Does this topic contain posts we haven't read? If so, tag it accordingly.
            if (!$forum_user['is_guest'] && $cur_set['last_post'] > $forum_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_set['tid']]) || $tracked_topics['topics'][$cur_set['tid']] < $cur_set['last_post']) && (!isset($tracked_topics['forums'][$cur_set['forum_id']]) || $tracked_topics['forums'][$cur_set['forum_id']] < $cur_set['last_post']))
                $item_status['new'] = 'new';
            $item_body['subject']['desc'] = implode(' ', $item_subject);
            if (empty($item_status))
                $item_status['normal'] = 'normal';

            $item_style = (($item_num % 2 != 0) ? ' odd' : ' even').(($item_num == 1) ? ' main-first-item' : '').((!empty($item_status)) ? ' '.implode(' ', $item_status) : '');
            $item_body['info']['replies'] = '<li class="info-replies"><strong>'.forum_number_format($cur_set['num_replies']).'</strong> <span class="label">'.(($cur_set['num_replies'] == 1) ? $lang_forum['Reply'] : $lang_forum['Replies']).'</span></li>';
            $item_body['info']['views'] = '<li class="info-replies"><strong>'.forum_number_format($cur_set['num_views']).'</strong> <span class="label">'.(($cur_set['num_views'] == 1) ? $lang_forum['View'] : $lang_forum['Views']).'</span></li>';
            $item_body['info']['last_post'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_set['last_post_id']).'">'.format_time($cur_set['last_post']).'</a></strong> <cite>'.sprintf($lang_index['Last poster'], forum_htmlencode($cur_set['last_poster'])).'</cite></li>';

              <div class="main-item<?php echo $item_style ?>">
                  <span class="icon <?php echo implode(' ', $item_status) ?>"><!-- --></span>
                  <div class="item-subject">
                      <?php echo implode("\n\t\t\t\t", $item_body['subject'])."\n" ?>
                  <ul class="item-info">
                      <?php echo implode("\n\t\t\t\t", $item_body['info'])."\n" ?>



(10 replies, posted in PunBB 1.3 extensions)

I'll consider helping more when I know the community better, when I know its code in more detail, and when I understand the new direction(s) Informer is taking, and how that compares to what Flux is doing.

I find it bold and rude that you would take this line of inquiry with me when you know so little about me.  Are you going to claim seniority or point out some code you wrote before I got here, next?  Please don't.  I'm only passing through, and it's a nice forum software regardless.


(48 replies, posted in PunBB 1.3 extensions)

Garciat wrote:

Who the hell said I was too lazy to add a filter? I just didn't add it because I didn't think it was necessary.

I did.

whatrevolution wrote:

The hacker owns your administrator, and YOU... because you were too lazy to write a regex filter

Garciat wrote:

If anyone wants to  patch its extension, they are free to do so.

So we need to check all of your work for laziness.  Noted.

Garciat wrote:

I'm so sorry for trusting people...

Apology accepted, try to be more aware of your surroundings, please.