Here we go:

<?php
/***********************************************************************
[... copyright Rickard Andersson...]
************************************************************************/


// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
    exit;

$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_main>


// START SUBST - <pun_footer>
ob_start();

?>
<div id="brdfooter" class="block">
    <h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
    <div class="box">
        <div class="inbox">
<?php

// If no footer style has been specified, we use the default (only copyright/debug info)
$footer_style = isset($footer_style) ? $footer_style : NULL;

if ($footer_style == 'index' || $footer_style == 'search')
{
    if (!$pun_user['is_guest'])
    {
        echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
        echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n";

        if ($pun_config['o_subscriptions'] == '1')
            echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n";

        echo "\t\t\t\t".'<dd><a href="search.php?action=show_user&user_id='.$pun_user['id'].'">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
    }
    else
    {
        if ($pun_user['g_search'] == '1')
        {
            echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
            echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
        }
    }
}
else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
{
    echo "\n\t\t\t".'<div class="conl">'."\n";

    // Display the "Jump to" drop list
    if ($pun_config['o_quickjump'] == '1')
    {
        // Load cached quickjump
        @include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
        if (!defined('PUN_QJ_LOADED'))
        {
            require_once PUN_ROOT.'include/cache.php';
            generate_quickjump_cache($pun_user['g_id']);
            require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
        }
    }

    if ($footer_style == 'viewforum' && $is_admmod)
        echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";
    else if ($footer_style == 'viewtopic' && $is_admmod)
    {
        echo "\t\t\t".'<dl id="modcontrols"><dt><strong>'.$lang_topic['Mod controls'].'</strong></dt><dd><a href="moderate.php?fid='.$forum_id.'&tid='.$id.'&p='.$p.'">'.$lang_common['Delete posts'].'</a></dd>'."\n";
        echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";

        if ($cur_topic['closed'] == '1')
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";
        else
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";

        if ($cur_topic['sticky'] == '1')
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";
        else
            echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
    }

    echo "\t\t\t".'</div>'."\n";
}

?>
            <p class="conr">Powered by <a href="http://www.punbb.org/">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />© Copyright 2002–2005 Rickard Andersson</p>
<?php

// Display debug info (if enabled/defined)
if (defined('PUN_DEBUG'))
{
    // Calculate script generation time
    list($usec, $sec) = explode(' ', microtime());
    $time_diff = sprintf('%.3f', ((float)$usec + (float)$sec) - $pun_start);
    echo "\t\t\t".'<p class="conr">[ Generated in '.$time_diff.' seconds, '.$db->get_num_queries().' queries executed ]</p>'."\n";
}

?>
            <div class="clearer"></div>
        </div>
    </div>
</div>
<?php


// End the transaction
$db->end_transaction();

// Display executed queries (if enabled)
if (defined('PUN_SHOW_QUERIES'))
    display_saved_queries();

$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_footer>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_footer>


// START SUBST - <pun_include "*">
while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_main, $cur_include))
{
    if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
        error('Unable to process user include <pun_include "'.htmlspecialchars($cur_include[1]).'"> from template main.tpl. There is no such file in folder /include/user/');

    ob_start();
    include PUN_ROOT.'include/user/'.$cur_include[1];
    $tpl_temp = ob_get_contents();
    $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
    ob_end_clean();
}
// END SUBST - <pun_include "*">


// Close the db connection (and free up any result data)
$db->close();

// Spit out the page
exit($tpl_main);

I will try the comments, thanks for the answers.

mmm, nope.
Exactly the same error.

Do you use the account named "Fabien" or do you just look at the thread as a guest?
As I explained before, the default settings now is 15 posts seen per thread, and it's working nice.

But if the user (Fabien) sets it to 25 (the default setting for PunBB?)... CRAAASH !
Looks like there is too much data.

If only it was that simple for me to change this. smile
Free doesn't allow people out of France to access their FTP server, so it's getting a bit complicated to work on this site.
(If you know any French FTP proxy, I'm interested)

Anyway, it's done but doesn't change anything, unfortunately.

Of course. :)
mmm, I did change this file for PBB Gallery

- added line 114:

[line 113]
    function fetch_array($query_id = 0)
    {
        return ($query_id) ? @mysql_fetch_array($query_id) : false;
    }
[line 179]
    function close()
    {
        if ($this->link_id)
        {
            if ($this->query_result)
                @mysql_free_result($this->query_result);

            return @mysql_close($this->link_id);
        }
        else
            return false;
    }
}
[EOF]

But I don't see why it could break anything... :/

any clue ?

Hi everybody.

We ran into a small bug/problem lately on our PunBB forum: http://archiforum.free.fr/.
After a few long posts in the same thread, we had this error message (only on this thread):

Fatal error: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/166/sdb/8/9/archiforum/include/dblayer/mysql.php on line 185

I guess this means the MySQL request has been terminated too early, right?

Actually, the only solution I found was to reduce the number of posts per thread, so that the request doesn't fail.
If I clean the "cache" folder, I can see the thread with the first post only in it, then when one refreshes it, there goes the error report again.

I created a dummy account where I asked for 25 posts per thread (the previous settings for default user options) if you want to check (the code is "2ufn9XNG" and this account is read-only).

Thanks for any help if this weird situation doesn't come from PunBB, or thanks to fix this issue whenever you can (if it's a bug, of course). :)

Tobi wrote:

No, really, why trying to have a complete html replacement?
Would be easier to actually allow at least some HTML tags than having to learn a complete new markup language smile

I really agree with that.
One thing that lacked when i switched to PunBB was the ability to define a coma separated list of allowed HTML tags (like abbr, acronym, or whatever...).
I really found it usefull...
It's not that hard to implement, though. smile

One step forward in my geekiness...
+P

Connorhd > Could be Pleased to read the fuckin' manual, hu ? smile

ameenullah wrote:

An.archi... I really couldnt understand RTFM... And I dont want to create bad scene here, we are here to support each others and share the things we know.

Well, hum...
RTFM = Read the fuckin' manual, and i obviously didn't point the right thing with this URL.
That was meant to be a little sarcastic, and well... a lil' stupid too, maybe, but that wasn't written to hurt anyone.
It's quite a common expression, now, i guess, so...
Maybe am i wrong about that too.

And helping each other is my point of view too.
Sometimes i'm not patient enough, though.

ameenullah wrote:

Sorry to say, but i really dont like the way it was answered by you...

Well. So.
I apologize for having offended you.
I'll try to stay "sober" in my posts, next time, i guess.

After all that, i'm gonna hang myself to the nearest tree... smile
So long guys...

(anyway, you shouldn't use frames... wink )

BUT...

Ho... OK... stop those off topic posts. smile

I'll do my best... smile
(more after june, i guess)

Connorhd > Breathe.
I didn't had the link, but the two sentences underneath, because i thought that effectively, leaving just a RTFM with a simple link could be rude, which was not the point.

Hey... Just read the posts, you'll get the answer to what you don't want to see : I made a mistake.

If you weren't a moderator, i guess you wouldn't have used such terms as "tolerate".

You warned me, yes... I saw. smile
But then, what's next step ?
I guess it would be better to know why before warning, and trying to know intentions of people.
We are not machines, we are not perfect : we make mistakes sometimes.

So, Sorry.

Connorhd > wow... Keep cool. Please smile
I guess it would have been rude if i had not had any URL, by searching the answer to what i thought was the question.
'guess it was not the question.
Anyway, i guess it only concerns IE, for the scrollbars, so well found, ameenullah. smile
Wrong horse for me this time. smile

Ho, by the way, I think moderator's role is not censuring, but that's just a point of view.
Let people assume their asshole's fame, if they deserve it. If you censor them, they will never be.
As you can see, rudeness is most in the eye of the reader, since ameenullah didn't take it wrong (i think, and i hope).

Sometimes, it just can be some kind of joke.
Don't take it wrong...
Thanks ! smile

RTFM
Anyway, try to not to use iframe, that would be better.

We can talk about this if you don't know why. smile

13

(2 replies, posted in PunBB 1.2 discussion)

OK.
Thanks for the answer to which i agree. smile
But my opinion stays the same. I think it's faster to edit when you already know the html code, but in other cases... arg.

Anyway, adding extra selectors at the end for general properties will do the same and increase redeability without having to change selector by selector, even if it's a bit bigger (though i'm not sure repeating each time selectors is better than cleanly code properties for each selector, i'm gonna make a study about this, so... wink ).

Nice work, indeed.
Do you guys need some help one day, in any way (if ones can) ?

14

(2 replies, posted in PunBB 1.2 discussion)

Hi !
I checked to see if the topic is not discussed elsewhere, so i hope it didn't. smile

'think Paul will be the one to anwser...

I wonder why you did separate selectors in multiple categories (border, margin, etc.) instead of making one selector with all the rules in them.
I mean, i think it's a bit messy for newbies (and for people who don't code this way, i guess) who have to check all the document for each kind of selector's property.

Wouldn't it be more efficient (readable for people who don't crawl in PunBB code all day long) to group each id / class / element properties in one selector instead ?
This is just my vision, don't take it personnaly, ok ? smile
I really like the separated colors and structure CSS, though.

Is it your way of coding CSS, or is there any reason for coding like this ?

Anyway, thanks for all this great work on PunBB to all of you folks...