FluxBB.fr

Le site des utilisateurs francophones de FluxBB.

Recherche rapide

Dernière discussion dans la colonne "Dernier Message" de l'index des forums

Permet de visualiser sur la page d'accueil le libellé du dernier sujet auquel il y a eu une réponse ou un message pour chaque Forum.

  • Version : S/O
  • Créateur : Crazy
  • Traduction : S/O (international)

Il suffit de modifier index.php comme suit :

1) remplacer (ligne 42) :

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catégories et des forums', __FILE__, __LINE__, $db->error());

par :

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, t.subject FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'topics AS t ON (t.last_post_id=f.last_post_id OR NULL) LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catégories et des forums', __FILE__, __LINE__, $db->error());

2) remplacer (ligne 110) :

    if ($cur_forum['last_post'] != '')
        $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';

par :

    if ($cur_forum['last_post'] != '')
    {
        if (strlen($cur_forum['subject']) > 40)
            $cur_forum['subject'] = substr(pun_htmlspecialchars($cur_forum['subject']), 0, 36).'...';
        $last_post = $cur_forum['subject'].'<br><a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
    }

C'est tout !

 
fluxbb_1_2/astuces/last_topic_index_forums.txt · Dernière modification: 2010/06/26 22:27 (édition externe)