Ok, thank you Smartys...

Tubby made a mod with the solution : http://punbb.org/forums/viewtopic.php?id=15607
Thank you Tubby

Here is the correct request :

SELECT t.id, t.poster, t.subject, t.num_replies, t.forum_id, p.topic_id, p.message, p.posted
FROM pun_topics AS t
INNER JOIN pun_posts AS p ON t.id = p.topic_id
AND p.posted = t.posted
WHERE t.forum_id =8
ORDER BY t.posted DESC
LIMIT 3

It missed an other join: AND p.posted = t.posted
GREAT!
Hope it'll help...

That would be a pity to use two requests.

I'm trying to get a topic list from a specific forum with poster, date, message, etc.
I know I could make it easily with two SQL requests but I know it's possible with an unique request.
I've tried this :

SELECT t.id, t.poster, t.subject, t.posted, t.num_replies, p.message FROM pun_topics AS t INNER JOIN pun_posts AS p ON p.topic_id=t.id WHERE forum_id=8 ORDER BY t.posted DESC LIMIT 3

Obviously, I get all the post in the specific forum but not all the first post of each topic.

This request misses something, but I don't understand what...
Please...

When all forums are deleted in admin_forums.php, it becomes "not valid!"
But here is an easy fix :

if ($db->num_rows($result)):

select lines 403 to 456 IF NO MODIFICATIONS BEFORE
403 starting with

        <h2 class="block2"><span>Edit forums</span></h2>

456 starting with

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

-->REPLACE WITH :

<?php
// Display all the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result)):
?>
        <h2 class="block2"><span>Edit forums</span></h2>
        <div class="box">
            <form id="edforum" method="post" action="admin_forums.php?action=edit">
                <p class="submittop"><input type="submit" name="update_positions" value="Update positions" tabindex="3" /></p>
<?php

    $tabindex_count = 4;

    $cur_category = 0;
    while ($cur_forum = $db->fetch_assoc($result))
    {
        if ($cur_forum['cid'] != $cur_category)    // A new category since last iteration?
        {
            if ($cur_category != 0)
                echo "\t\t\t\t\t\t\t".'</table>'."\n\t\t\t\t\t\t".'</div>'."\n\t\t\t\t\t".'</fieldset>'."\n\t\t\t\t".'</div>'."\n";

?>
                <div class="inform">
                    <fieldset>
                        <legend>Category: <?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></legend>
                        <div class="infldset">
                            <table cellspacing="0">
<?php

            $cur_category = $cur_forum['cid'];
        }

?>
                                <tr>
                                    <th><a href="admin_forums.php?edit_forum=<?php echo $cur_forum['fid'] ?>">Edit</a> - <a href="admin_forums.php?del_forum=<?php echo $cur_forum['fid'] ?>">Delete</a></th>
                                    <td>Position  <input type="text" name="position[<?php echo $cur_forum['fid'] ?>]" size="3" maxlength="3" value="<?php echo $cur_forum['disp_position'] ?>" tabindex="<?php echo $tabindex_count ?>" />
                                      <strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>
                                </tr>
<?php

        $tabindex_count += 2;
    }

?>
                            </table>
                        </div>
                    </fieldset>
                </div>
                <p class="submitend"><input type="submit" name="update_positions" value="Update positions" tabindex="<?php echo $tabindex_count ?>" /></p>
            </form>
        </div>
<?php endif; ?>        </div>
    <div class="clearer"></div>

5

(4 replies, posted in Feature requests)

a function that gets called on every page, yes but which read a pattern you can edit.

6

(4 replies, posted in Feature requests)

Here is a little suggestion, not so important...
In many pages, this line appears:

$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_****['*****'];

Why not a common pattern which allows to customize title ?
That's not so hard to add thanks to the punbb power.

Sorry for my poor english...