Dynamische Meta-Tags Mod

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
vollmilch
Mitglied
Beiträge: 4
Registriert: 16.10.2007 19:38

Dynamische Meta-Tags Mod

Beitrag von vollmilch »

hallo!

ich habe ein kleines problem mit dem meta tag mod (http://www.phpbb.de/viewtopic.php?t=496 ... =meta+tags).

er funktioniert eigentlich gut. das komische ist allerdings, dass er die meta-tags fuer meine index-seite aus den wörtern des ersten threads zusammenbaut!? also ist dann meine description der titel des ersten threads, und das moechte ich nicht. hier der ausschnitt aus der page_header.tpl:

Code: Alles auswählen

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";
        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="Griffbrett-Brasilianer. Forum für Gitarristen. Gitarren, Licks, Amps, Effekte, Recording, Theorie, Technik, Equipment">'."\n";
   $meta_keywords = '<meta name="keywords" content="griffbrett, gitarristen, gitarren, licks, spieltechnik, theorie, amps, gitarre, verstärker, gitarre, endstufe, effektgeräte">'."\n";
}
Antworten

Zurück zu „phpBB 2.0: Mod Support“