Archives FluxBB.fr

Les archives de FluxBB.fr

Vous n'êtes pas identifié(e).

#1 29-10-2006 23:19:42

Bugsy Siegel
Membre

Active topics mod

Bonsoir à tous,

j'aurai besoin de plus d'information concernant l'installation de ce mod : active topics mod 1.2x http://www.alexking.org/index.php?conte … ontent.php

quand j'ouvre le fichier php, cela m'indique :

To install, include this file below the forums list in your index.php file:

  include('mod_active_topics_1.2.php');

*/

vous allez rire, mais je ne sais pas localiser la liste des forums dans l'index... quelqu'un peut-il m'éclairer, et par la même occasion me rendre moins c.. ??? ^^

Merci d'avance !!

Hors ligne

#2 30-10-2006 11:12:33

Bugsy Siegel
Membre

Re : Active topics mod

personne pour me renseigner ??? pleure

Hors ligne

#3 30-10-2006 11:15:35

romain9441
Admin locker

Re : Active topics mod

Attend un peu !

Tout le monde n'utilise pas cette mod !!


Avant de poser une question, avez-vous consulté la FAQ ou fait une recherche ?

Pas de support si pas d'adresse de forum !

Hors ligne

#4 31-10-2006 10:48:12

Bugsy Siegel
Membre

Re : Active topics mod

Non vraisemblablement, personne n'utilise ce mod, je vais essayer de placer le code à "taton" ! smile

Hors ligne

#5 31-10-2006 21:55:49

Bugsy Siegel
Membre

Re : Active topics mod

Voilà pour ceux que ça intéresse, mod finalement très facile à installer

vous pouvez le visualiser à cette adresse sachant que vous pouvez choisir le nombre de topics à afficher
http://www.usetasks.com/forums/
ou ici mais mon forum est en construction (l'adresse va changer, je viendrais mettre à jour)
http://www.culture-foot.com/forums

##
##
##          Titre mod :  mod_active_topics_1.2
##
##        Version mod :  1.2
##         Pour PunBB :  1.2.x
##    Date Traduction :  31/10/2006
##           Date 1.2 :  12/02/2005
##  
##             Auteur :  Copyright 2004-2005 Alex King, http://www.alexking.org/
##             http://www.alexking.org/blog/2005/02/12/active-topics-mod-for-punbb-12/
##       
##        Description :  Affiche les derniers topics actifs sur l'index en dessous des forums
##
##  Fichiers affectés :  index.php
##
##         DISCLAIMER :  Veuillez noter que ces mods ne sont pas
##                       officiellement supportés par PunBB. L'installation
##                       de ces modifications est à vos risques et périls.
##                       N'oubliez pas de sauvegarder la base de données et
##                       les fichiers affectés avant de procéder à
##                       l'installation de cette modification.
##


#-------------------------------------------------------------------------------
#
#---------[ OUVRIR ]------------------------------------------------------------

index.php


#
#---------[ TROUVER ]---------------------------------------------------------
#

list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);

?>


#
#---------[ APRES AJOUTER ]------------------------------------------------------
#

<?php


$ak_limit = 10; // change this to the number of active topics you want to display.

$result = $db->query('
    SELECT t.*
    FROM '.$db->prefix.'topics AS t
    INNER JOIN '.$db->prefix.'forums AS f
    ON f.id=t.forum_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 t.last_post DESC
    LIMIT '.$ak_limit
) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

?>
<div id="vf" class="blocktable">
    <h2><span>Live & Direct On Stage</span></h2>
    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <thead>
                <tr>
                    <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
                </tr>
            </thead>
            <tbody>
<?php
// If there are topics in this forum.
if ($db->num_rows($result))
{
    while ($cur_topic = $db->fetch_assoc($result))
    {
        $icon_text = $lang_common['Normal icon'];
        $item_status = '';
        $icon_type = 'icon';

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

        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);

        if ($cur_topic['moved_to'] != 0)
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }

        if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null)
        {
            $icon_text .= ' '.$lang_common['New icon'];
            $item_status .= ' inew';
            $icon_type = 'icon inew';
            $subject = '<strong>'.$subject.'</strong>';
            $subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
        }
        else
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (1 == 0 && !$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
        {
            if ($cur_topic['has_posted'] == $pun_user['id'])
                $subject = '<strong>·</strong> '.$subject;
            else
                $subject = '  '.$subject;
        }

        if ($cur_topic['sticky'] == '1')
        {
            $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
            $item_status .= ' isticky';
            $icon_text .= ' '.$lang_forum['Sticky'];
        }

        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

        if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

        // Should we show the "New posts" and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
        {
            $subject .= '  '.(!empty($subject_new_posts) ? $subject_new_posts : '');
            $subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
        }

?>
                <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
                    <td class="tcl">
                        <div class="intd">
                            <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
                            <div class="tclcon">
                                <?php echo $subject."\n" ?>
                            </div>
                        </div>
                    </td>
                    <td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : ' ' ?></td>
                    <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : ' ' ?></td>
                    <td class="tcr"><?php echo $last_post ?></td>
                </tr>
<?php

    }
}
else
{

?>
                <tr>
                    <td class="tcl" colspan="4"><?php echo $lang_forum['Empty forum'] ?></td>
                </tr>
<?php

}

?>
            </tbody>
            </table>
        </div>
    </div>
</div>

#
#---------[ ENREGISTRER ET ENVOYER SUR LE SERVEUR ]-------------------------
#

index.php

Dernière modification par Bugsy Siegel (06-09-2007 09:21:08)

Hors ligne

#6 04-09-2007 20:14:25

Bugsy Siegel
Membre

Re : Active topics mod

Pour info, avec la mod de tcheval pour le référencement, il faut remplacer un passage :

if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

remplacé par :

if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'sujet-'.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

Hors ligne

Pied de page des forums