[archive] phpBB SEO Dynamic Meta Tags

Support for the phpBB2 SEO mods released in the phpBB2 SEO Toolikt forum.

Moderator: Moderators

[archive] phpBB SEO Dynamic Meta Tags

Postby dcz » Sun Jun 11, 2006 6:30 pm

WARNING
    0.2.0 is out : To update please read this thread.

    What follows is kept for archive.

    0.0.1 support will continue for some time for 0.0.1 user, until they update.

    Do not use this version if you are first installing this mod.


---------------------------------------------------------------------------------------

[Toolkit] phpBB SEO Dynamic Meta Tags

Here is a mod to output nice Dynamic Meta Tags for phpBB.
It is as well possible to use the Categories Hierarchy Edition together with Categories Hierarchy ;)

The solution is installed in no time and will create different Meta Tags for the forum index, the categories, the forums and the topics ;)

Once installed, you'll certainly need some meta keywords optimization.

Keywords and descriptions tags will now be related to your actual content.
We know those are not as useful as they used to be, but still the meta description is very important, many pages with the same description will for sure not end up as well Ranked as if they all had different tags.

Same for Keywords, they won't add much weight on themselves, but the fact they will be different for every topic will help out.

In the mod's code, you will have to fill the proper infos directly in the code changes, read the install comments carefully.

I could have had those in ACP, but I think the lightest the best, no need to add SQL for a site description, just to heavy for nothing.

Anyway, this is first version, tested and working here on this site.
Enhancement will be added in the future, maybe some rand() could be good to add for the static part ;)

As well I will son write more about how to obtain very precise keywords lists in meta tags while optimizing the phpBB Search Tables ;)

Anyway, here is the mod :


Code: Select all
##############################################################
## MOD Title: phpBB SEO Dynamic Metatags
##
## MOD Author: dcz <n/a> http://www.phpbb-seo.com/
##
## MOD Description: Generates dynamic meta-tags for phpBB.
##
## MOD Version: 0.0.1
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: (2)
##            includes/page_header.php,
##            templates/subSilver/overall_header.tpl
##
## Included Files: n/a
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## Author Notes:
##
## You can edit the amount of keywords outputted for topics by editing the number in this line:
## AND t.topic_id = $meta_topic_id LIMIT 20";
## Part of this code inspired from -http://www.phpbb.de/viewtopic.php?t=49679 Larsneo and Titus (@phpbb.de)
## You SHOULD NOT use more than 20 keywords in the keyword meta tags
## As well, you SHOULD NOT use too long description tags
##
##############################################################
## MOD History:
##
##   2006-10-06 - First released version
##
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


Download :

phpBB SEO Dynamic Meta Tags

phpBB SEO Dynamic Meta Tags - Edition Categories Hierarchy

Support Follows.

Support Francophone.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Postby Peter77 » Sun Jun 11, 2006 6:40 pm

Okay cool! sounds great... nope, no problem in waiting. :)
Peter77
phpBB SEO Team
phpBB SEO Team
 
Posts: 532
Joined: Wed May 10, 2006 9:46 am

Postby AmirAbbas » Sun Jun 11, 2006 7:07 pm

Just add one $lang entry for each static field to fill, such as $lang['meta_keywd'], $lang['meta_keywd_short'] etc.. and use those in the php code instead of the strait text, I think this should work.


OK
could you explain it :roll:
thanks
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Sun Jun 11, 2006 7:14 pm

Instead of
    "YOUR_DEFAULT_KEYWORDS_COMA_SEPARATED",
    "YOUR_DEFAUT_DESCRITPION",
    "YOUR_DEFAULT_KEYWORDS_COMA_SEPARATED",
    "YOUR_AUTHOR_INFOS",
    "YOUR_COPYRIGHT_INFOS"
    and "FEW_MORE_KEYWORDS_COMA_SEPARATED",
just add
    "'.$lang['meta_def_keywd'].'",
    "'.$lang['meat_def_desc'].'",
    "'.$lang['meta_author'].'",
    "'.$lang['meta_cinfo'].'"
    and "'.$lang['meta_more_keywd'].'"


in the mod's code.

And then add in every lang_main.php :

$lang['meta_def_keywd'] ="what do you want in utf 8";
...


for every corresponding $lang key.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Tue Jun 13, 2006 11:35 am

hello

excuse me
your explanation was not clear
i couldnt find

"YOUR_DEFAULT_KEYWORDS_COMA_SEPARATED"

this part doesn't have qoutation mark and this two part of code

"YOUR_COPYRIGHT_INFOS"
and "FEW_MORE_KEYWORDS_COMA_SEPARATED"

only have a single qoutation mark
i tried to change it but i get a error message

i changed that par to this form


Code: Select all
//BEGIN www.phpBB-SEO.com Dynamic meta tags
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) ) {
   $meta_topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
} elseif ( isset($HTTP_GET_VARS[POST_FORUM_URL]) ) {
   $meta_forum_id = intval($HTTP_GET_VARS[POST_FORUM_URL]);
} elseif ( isset($HTTP_GET_VARS[POST_CAT_URL]) ) {
   $meta_cat_id = intval($HTTP_GET_VARS[POST_CAT_URL]);
}
if ( isset($meta_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 = $meta_topic_id";
        if( ($result = $db->sql_query($sql)) ) {
      if ( $meta_row = $db->sql_fetchrow($result) ) {
         $description = $board_config['sitename'] . ' :: ' . $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 = $meta_topic_id LIMIT 20";
        if( ($result = $db->sql_query($sql)) ) {
      $keywords = '';
      while ( $meta_row = $db->sql_fetchrow($result) ) {
         $keywords .= ($keywords == '') ? $meta_row['word_text'] : ',' . $meta_row['word_text'];
      }
        }
} elseif ( isset($meta_forum_id) ) {
   $sql = "SELECT c.cat_title, f.forum_name
                FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
                WHERE c.cat_id = f.cat_id
                AND f.forum_id = $meta_forum_id";
   //SQL CACHE
          if( ($result = $db->sql_query($sql)) ) {
   //if( ($result = $db->sql_query($sql, false, 'META_')) ) {
      if ( $meta_row = $db->sql_fetchrow($result) ) {
         $description = $board_config['sitename'] . ' :: ' . $meta_row['cat_title'] . ' :: ' . $meta_row['forum_name'];
         $keywords = $board_config['sitename'] . ', ' . $meta_row['cat_title'] . ', ' . $meta_row['forum_name'] . ', '.$lang['meta_more_keywd'].';
      }
      //here we clear $result from ram and cache it
      $db->sql_freeresult($result);
      //End sql cache opt
          }
} elseif ( isset($meta_cat_id) ) {
   $sql = "SELECT cat_title
                FROM " . CATEGORIES_TABLE . "
                WHERE cat_id = $meta_cat_id";
   //SQL CACHE
        if( ($result = $db->sql_query($sql)) ) {
   //if( ($result = $db->sql_query($sql, false, 'META_')) ) {
      if ( $meta_row = $db->sql_fetchrow($result) ) {
         $keywords = $board_config['sitename'] . ', ' . $meta_row['cat_title'] . ', '.$lang['meta_more_keywd'].';
         $description = $board_config['sitename'] . ' :: ' . $meta_row['cat_title'];
      }
      //here we clear $result from ram and cache it
      $db->sql_freeresult($result);
      //End sql cache opt
   }
} else {
   $description .= "'.$lang['meat_def_desc'].'";
   $keywords = "'.$lang['meta_def_keywd'].'";
}
$phpbb_meta  = '<meta name="title" content="' . $page_title .'">' . "\n";
//$meta_str .= '<meta name="author" content="'.$lang['meta_author'].'">' . "\n";
//$meta_str .= '<meta name="copyright" content="'.$lang['meta_cinfo'].'">' . "\n";
$phpbb_meta .= '<meta name="keywords" content="' . $keywords  .'">' . "\n";
$phpbb_meta .= '<meta name="description" lang="fr" content="'. $description .'">' . "\n";
$phpbb_meta .= '<meta name="category" content="general">' . "\n";
$phpbb_meta .= '<meta name="robots" content="index, follow">' . "\n";
//END  www.phpBB-SEO.com Dynamic meta tags


and lang_main.php is like this

Code: Select all
lang['meta_def_keywd'] = 'سایت آموزش کامپیوتر , کامپیوتر , طراحی وب , وب , phpbb فارسی , mod های فارسی , پارسی , پورتال , فارسی ساز , رفع عیب , سوال و جواب , گفتگوی آزاد , webdesign , phpbb , persian , CMS';
lang['meat_def_desc'] = 'سایتی جامع در زمینه طراحی وب با مطالبی مفید و کاربردی. فارسی ساز جدیدترین پورتال های موجود همراه با ده ها مقاله حرفه ای در مورد طراحی وب';
lang['meta_author'] = 'امیر عباس عبدالعلی';
lang['meta_cinfo'] = 'استفاده از مطالب داخل سایت تنها با ذکر منبع مجاز می باشد';
lang['meta_more_keywd'] = 'طراحی , فلش , گرافیک , مقالات SEO , آموزش , phpbb farsi';
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Tue Jun 13, 2006 11:40 am

I put the quotations marks to limit what to find and replace,

Just change what's inside of them with what is proposed, do not paste them ;)

Basically, you just need to get rid of the extra " in the code ;)

Anyway, I'll add this in next version, ACP is a bit too much, lang files is cool :)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Tue Jun 13, 2006 12:14 pm

thanks

i have this meta tags in my page source

Code: Select all
<meta name="title" content="صفحه اصلی">
<meta name="keywords" content="سایت آموزش کامپیوتر , کامپیوتر , طراحی وب , وب , phpbb فارسی , mod های فارسی , پارسی , پورتال , فارسی ساز , رفع عیب , سوال و جواب , گفتگوی آزاد , webdesign , phpbb , persian , CMS">
<meta name="description" lang="fr" content="سایتی جامع در زمینه طراحی وب با مطالبی مفید و کاربردی. فارسی ساز جدیدترین پورتال های موجود همراه با ده ها مقاله حرفه ای در مورد طراحی وب">
<meta name="category" content="general">
<meta name="robots" content="index, follow">


code of my language is FA not FR
how can i change that part

thanks, very useful mod
i searched a lot for something like this
excellent :wink:
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Tue Jun 13, 2006 12:16 pm

amir abbas wrote:
code of my language is FA not FR
how can i change that part

thanks, very useful mod
i searched a lot for something like this
excellent :wink:


Jeez, I forgot about this one, well, not really, but I should have told you can just edit this line ;)

<meta name="description" lang="fr" content="'. $description .'">


I am so french sometime :D
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Tue Jun 13, 2006 12:21 pm

thanks :D
everything is OK now
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby AmirAbbas » Tue Jun 13, 2006 2:12 pm

i have a suggestion
this mod is very good but keyword meta tag is not accurate in this mod
see this picture

Image

as you can see there are lot of preposition in keyword meta tag
preposition is not valuable and you know that the number of preposition is limited in all languages

is it possible for you to add a field to ACP that give ability to users to make list of
preposition and other useless word to remove them from meta tag ?
i mean add a feature to this mod for remove a list of word from meta tag

excuse me
my english is not good and i can't demonstrate it well
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Tue Jun 13, 2006 2:18 pm

Don't worry, I am currently translating the article I just wrote in french. It will learn you how to optimize your meta keywords while optimizing your search tables ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby SeO » Tue Jun 13, 2006 7:00 pm

SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby dcz » Sat Jun 24, 2006 1:38 pm

added support for Categories Hierarchy ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby murph » Sat Jun 24, 2006 4:18 pm

Thanks for this mod btw...i was starting to get worried when i could only see the global meta tags mod over at the phpbb mods section! These things have to be dynamic!!

Anyway, i was wondering if it was possible to has the keywords generated slightly differently...

eg... say i have "download greatest php scripts" as my thread title. The meta description has that whole phrase put in, but would it be possible to have..

(eg) keywords="download greatest php scripts,download greatest php,download greatest,download,greatest php scripts,php scripts,scripts"

What i mean is, is there a way to have a formula to output the keywords like that, the formula being...

thread title = A B C D
keywords= "A B C D, A B C, A B, A, B C D, C D, D"

This would pretty much cover all possible search patterns of the thread title...

Hopefully i'm making sense here? I just think this may be better than having a bunch of single words taken from the title
murph
 
Posts: 14
Joined: Sat Jun 24, 2006 4:09 pm

Postby dcz » Sat Jun 24, 2006 4:29 pm

This could be something to think of, but have you noticed that it was the actual first post content to be used in the topic meta keywords?

The problem being, you don't have much control over the topic titles posted, so you will still end up with some strange cases, where only useless keywords are used. And playing over like this with orders won't change much I think.

I'll think about how to enhance those, but remember meta keywords are not worth this much, meta descriptions are more important now-days.
The most important thing is them to be dynamic so that bots do not see the same thing all the time. And here, content will always be related. So ...

As well, you can read this to go further.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to phpBB2 SEO MODS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Bing [Bot] and 4 guests