Comment renseigner les meta pour chaque topic

WRInaute discret
Bonjour,

j'aimerai savoir comment renseigner les meta description et keywords pour chaque topic d'un forum phpbb?

Merci.
 
WRInaute discret
Re,

Après avoir installé ce code:

Code:
##############################################################
## MOD Title:         Dynamic keyword metatags
## Original MOD Author:  Larsneo and Titus (@phpbb.de)
## http://www.phpbb.de/viewtopic.php?t=49679
##
## Modified by 993ti -www.twenteracingscene.com
##
## MOD Description:     Generates dynamic metatags for your phpbb
##             Please read the author notes BEFORE using this mod.
##
## MOD Version:     N/A
##
## Installation Level:     Easy
## Installation Time:     5 Minutes
## Files To Edit:     (2)
##            includes/page_header.php,
##            templates/subSilver/overall_header.tpl
##
## Included Files: n/a
##############################################################
## Author Notes:
## You can edit the amount of keywords by editing the number in this line:
## AND t.topic_id = $topic_id LIMIT 25";
##
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
##Don't forget to edit these lines:
##These are used when on a different page then viewforum and viewtopic
##
##      $meta_description = '<meta name="description" content="YOUR DESCRIPTION">';
##      $meta_keywords = '<meta name="keywords" content="YOUR KEYWORDS">';
##
##
#
#-----[ OPEN ]------------------------------------------
#

includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#

define('HEADER_INC', TRUE);

#
#-----[ AFTER, ADD  ]------------------------------------------
#

if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
    {
       $topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
    }
    else if ( isset($HTTP_GET_VARS['topic']) )
    {
       $topic_id = intval($HTTP_GET_VARS['topic']);
    }

    if ( $topic_id )
    {
        $sql = "SELECT c.cat_title, f.forum_name, t.topic_title
                FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
                WHERE f.forum_id = t.forum_id
                AND c.cat_id = f.cat_id
                AND t.topic_id = $topic_id";
        if( ($result = $db->sql_query($sql)) )
        {
            if ( $meta_row = $db->sql_fetchrow($result) )
            {
                $meta_description = '<meta name="description" content="' . $meta_row['cat_title'] . ' :: ' . $meta_row['forum_name'] . ' :: ' . $meta_row['topic_title'] . '">';
            }
        }
        $sql = "SELECT w.word_text
                FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
                WHERE t.topic_first_post_id = m.post_id
                AND m.word_id = w.word_id
                AND t.topic_id = $topic_id LIMIT 25";
        if( ($result = $db->sql_query($sql)) )
        {
            $meta_keywords = '';
            while ( $meta_row = $db->sql_fetchrow($result) )
            {
                $meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ',' . $meta_row['word_text'];
            }
            $meta_keywords = '<meta name="keywords" content="' . $meta_keywords . '">';
        }
    }
   else
   {
      $meta_description = '<meta name="description" content="YOUR DESCRIPTION">';
      $meta_keywords = '<meta name="keywords" content="YOUR KEYWORDS">';
   }

#
#-----[ FIND ]------------------------------------------------
#
'PAGE_TITLE' => $page_title,

#
#-----[ AFTER, ADD ]------------------------------------------
#
    'META_DESCRIPTION' => $meta_description,
    'META_KEYWORDS' => $meta_keywords,

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------------
#
<META http-equiv="Content-Style-Type" content="text/css" />

#
#-----[ AFTER, ADD ]------------------------------------------
# If you already have description & keywords metatags, replace them with these

{META_DESCRIPTION}
{META_KEYWORDS}

#
#---[ SAVE/CLOSE ALL FILES ]-----------------------
#
# eom

Ça fonctionne à merveille pour les post mais pour l'index et viewforum ça ne fonctionne pas il ne sont pas dynamiques.

J'aimerai faire pour l'index un peux comme WRI et mettre le titre dans la meta description et keyword, quelqu'un sait comment? Voici un exemple des meta de WRI:

Code:
<meta name="keywords" content="Forum R&eacute;f&eacute;rencement Google, Yahoo! - Forums WebRankInfo &trade;, forum google, forum referencement, google forum, google dance">
<meta name="description" content="Forum R&eacute;f&eacute;rencement Google, Yahoo! - Forums WebRankInfo &trade; - Forums d'aide au referencement sur Google">

Merci
 
WRInaute discret
Bon, encore le bon vieux Ohax qui frappe! :D

Ohax a dit:
il les lits mais n'en tient pas compte ou trés peu ;-)


c'est assé facile à faire sous phpbb et je l'ai moi même adapté chez moi :D

il suffi d'insérer le titre dans les meta avec title


voici ce que ça donne chez moi dans overall_header:


Code:
<meta name="description" content="{PAGE_TITLE} Adojeunz est un forum gratuit de jeunes">
<meta name="keywords" content="{PAGE_TITLE} forum, gratuit, adojeunz, jeunz">

Merci.
 
Discussions similaires
Haut