1 (edited by fantasma 2007-10-03 14:35)

Topic: [SEO_mod for PunBB] Meta Keyword and meta description for each post

Hello
I'm a SEO, and i use PunBB for my communities.

Few day ago i discovered a punbb forum that show in each post Meta Keyword and meta description, the description report the first part of the first post.( i have try to contact the admin of the forum but not have received reply)

Now i have tryed to do it, but with no good results.

Why we don't make a mod for this? It very important for search engine and i want implement this mod in my forum.
Please help me to create a SEO_mod for PunBB

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

Moved to Modifications

Meta keyword tags are useless for SEO purposes, search engines are smart enough not to let users pick their own keywords.
You only need at most one meta description tag in the head of the page. I'm not even sure that one per post is valid.

3 (edited by fantasma 2007-10-03 15:45)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

i have insert meta keyword and description general in main.tpl, yes it work, but i want insert it for each post, it very important for search engine, can help me to do it?

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

any help??

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

To insert it for each post you would need to modify viewtopic.php and/or header.php, I think, and do something like php echo the relevant database fields for topic posts into the <head> section, esp the meta description section, truncating the output of course...

But I agree to a degree with Smartys. Meta keyword and description are not that influential in search engine ranking algorithms anymore, since they (esp meta keywords) are so regularly abused as to be useless information.

If you really need this, why not put out a bid at http://www.getafreelancer.com or something? I'm sure some PHP coder on that site, in between programming web site scrapers or forum spamming tools or email address harvesters smile, could find the time to help you out for a small fee.

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

I know abotu i do for add this tag, but i'm not a php programmer.

I think that the meta description and meta key in each post i very useful for search engine, if used it in correct mode. Punbb need this mod, for me!

7 (edited by yemgi 2007-10-05 15:25)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

It is useless for SEO, it just helps for readbility in the search results.

to do it, create meta.php in /include/user/ with the following content:

<?php

function parser_del_bbcode($text, $size){
    global $pun_config;

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

    // ending html tags into line breaks
    $text=preg_replace('#\[(hide|url|img|quote)\](.*?)\[/(hide|url|img|quote)\]#s','',$text);
    $text=preg_replace('#\[quote=(?:.*?)\](.*?)\[/quote\]#s','',$text);
    $text=preg_replace('#\[(url|color|email)=(?:.*?)\](.*?)\[/(url|color|email)\]#s','$2',$text);
    // remove other bbcode tags
    $text=preg_replace('#\[(.*?)\]#s','',$text);
    // remove newlines
    $text=preg_replace('# +#s',' ',$text);
    $text=preg_replace('#\n#s','',$text);
    $text=str_replace('"',"'",$text);

    return substr($text, 0, $size);
}

if($pun_user['is_guest'])
{
    if ($footer_style == 'viewtopic')
    {
        $postertag=$cur_topic['subject'];
        $postertag=str_replace('"',"'",$postertag);
        echo '<meta name="description" content="Subjet:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';
    }
}
?>

and in your main.tpl  add <pun_include "meta.php"> before </head>

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

Hello my tuning friend!!!!! I have same tuning catalog and forum!! check the website in my details
Yuhu very nice!!! and the meta description for the post?

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

yemgi wrote:

It is useless for SEO, it just helps for readbility in the search results.

to do it, create meta.php in /include/user/ with the following content:

<?php

function parser_del_bbcode($text, $size){
    global $pun_config;

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

    // ending html tags into line breaks
    $text=preg_replace('#\[(hide|url|img|quote)\](.*?)\[/(hide|url|img|quote)\]#s','',$text);
    $text=preg_replace('#\[quote=(?:.*?)\](.*?)\[/quote\]#s','',$text);
    $text=preg_replace('#\[(url|color|email)=(?:.*?)\](.*?)\[/(url|color|email)\]#s','$2',$text);
    // remove other bbcode tags
    $text=preg_replace('#\[(.*?)\]#s','',$text);
    // remove newlines
    $text=preg_replace('# +#s',' ',$text);
    $text=preg_replace('#\n#s','',$text);
    $text=str_replace('"',"'",$text);

    return substr($text, 0, $size);
}

if($pun_user['is_guest'])
{
    if ($footer_style == 'viewtopic')
    {
        $postertag=$cur_topic['subject'];
        $postertag=str_replace('"',"'",$postertag);
    echo '<meta name="description" content="...' . parser_del_bbcode($description,350) . '" />';
    //echo '<meta name="description" content="Subjet:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';
    }
}
?>

and in your main.tpl  add <pun_include "meta.php"> before </head>

I do it but not work or i not understand how it work.

10

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

metas are only for the search engines so they only appear for guests. If you are logged in, you will not be able to see them in the page source

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

mmmm so , i have insert in my main.tpl meta key and meta description, i must remove it??

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

i see only this in my head <meta name="description" content="..." />

13 (edited by yemgi 2007-10-05 15:11)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

strange, replace:

    echo '<meta name="description" content="...' . parser_del_bbcode($description,350) . '" />';
    //echo '<meta name="description" content="Subjet:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';

by

echo '<meta name="description" content="Subject:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';

14 (edited by fantasma 2007-10-05 15:22)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

I see this now
<meta name="description" content="Subject: and part of the subject, but i see the subject alrady in the title tag.
I want show first part of the first post
Any suggest?

15

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

It works for me, I see:
<meta name="description" content="Subject:Arriva anche in Italia la nuova serie di catalizzatori Magnaflow./.." />

16

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

The description does not appear as it should, I will check it at home as the code I  gave is a modified one for my site

17 (edited by fantasma 2007-10-05 15:30)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

The Subject already show in title see below
<title>Magnaflow community Italia / [Tuning News]Anticipazioni sulla Grande Punto Abarth</title>

your file meta.php add this:
<meta name="description" content="Subject:[Tuning News]Anticipazioni sulla Grande Punto Abarth./.." />

i have add this in main.tpl
<meta name="Keywords" content="Magnaflow, video magnaflow, catalizzatori magnaflow, silenziatori omologati,

But i want that in <meta name="description" content= will show the first part of the post and no the title

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

ok finally it work fine! well done, compliment for your mod, so i need keyword tag generator for each post!!!
Who have it ready???  smile

19

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

I am not the author of this mod.
ok, here is the complete process:

#
#---------[ 1. open ]-----------------------------------------------------
#

include/template/main.tpl

#
#---------[ 2. find ]-----------------------------------------------------
#
<pun_head>

#
#---------[ 3. add after ]------------------------------------------------
#
<pun_include "meta.php">

#
#---------[ 4. open ]-----------------------------------------------------
#
viewtopic.php

#
#---------[ 5. find ]-----------------------------------------------------
#
// Perform the main parsing of the message (BBCode, smilies, censor words etc)

#
#---------[ 6. add before ]-----------------------------------------------------
#


if($post_count == 1) $description = $cur_post['message'];


##---------[ 7. create meta.php with the following content ------------------
#


<?php

function parser_del_bbcode($text, $size){
    global $pun_config;

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

    // ending html tags into line breaks
    $text=preg_replace('#\[(hide|url|img|quote)\](.*?)\[/(hide|url|img|quote)\]#s','',$text);
    $text=preg_replace('#\[quote=(?:.*?)\](.*?)\[/quote\]#s','',$text);
    $text=preg_replace('#\[(url|color|email)=(?:.*?)\](.*?)\[/(url|color|email)\]#s','$2',$text);
    // remove other bbcode tags
    $text=preg_replace('#\[(.*?)\]#s','',$text);
    // remove newlines
    $text=preg_replace('# +#s',' ',$text);
    $text=preg_replace('#\n#s','',$text);
    $text=str_replace('"',"'",$text);

    return substr($text, 0, $size);
}

if ($pun_user['is_guest'] &&  $footer_style == 'viewtopic')
{  $postertag=$cur_topic['subject'];
$postertag=str_replace('"',"'",$postertag);

    echo '<meta name="description" content="Subject:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';

}else{
echo '<meta name="description" content="'.$page_title.'" />';
}
?>

##---------[ 7. upload meta.php- ------------------
#
include/user/meta.php

20 (edited by basell 2007-10-05 21:16)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

hello

thank you for made this mod

yemgi i have problem

this

 echo '<meta name="description" content="Subject:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';

don't work .

but this work

 echo '<meta name="description" content="'.$page_title.'" />';

i need the first one to work .

Check my page source of my forum it is arabic UTF8 it is show just the page title i need meta description for each post.
http://cncarab.com/community/

21

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

have you done the modifications in viewtopic.php?

22 (edited by fantasma 2007-10-06 12:22)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

ok it work perfectly but i see the tag in the description meta

<br> <p> ecc

all the bbcode tag
i can leave it? Iwant that this mod show only the text

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

the best way for this SEO Mod Beta IS this:

Add general <meta name="Keywords" content= keyword /> in main.tpl.

After will modified meta.php on this:

<?php

function parser_del_bbcode($text, $size){
    global $pun_config;

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

    // ending html tags into line breaks
    $text=preg_replace('#\[(hide|url|img|quote)\](.*?)\[/(hide|url|img|quote)\]#s','',$text);
    $text=preg_replace('#\[quote=(?:.*?)\](.*?)\[/quote\]#s','',$text);
    $text=preg_replace('#\[(url|color|email)=(?:.*?)\](.*?)\[/(url|color|email)\]#s','$2',$text);
    // remove other bbcode tags
    $text=preg_replace('#\[(.*?)\]#s','',$text);
    // remove newlines
    $text=preg_replace('# +#s',' ',$text);
    $text=preg_replace('#\n#s','',$text);
    $text=str_replace('"',"'",$text);

    return substr($text, 0, $size);
}

if($pun_user['is_guest'])
{
    if ($footer_style == 'viewtopic')
    {
        $postertag=$cur_topic['subject'];
        $postertag=str_replace('"',"'",$postertag);
echo '<meta name="description" content="' . parser_del_bbcode($description,350) . '" />';
    //echo '<meta name="description" content="Subjet:'.$postertag.'./..' . parser_del_bbcode($description,350) . '" />';
    }
}
?>

In header of your punbb you will show the Base title of board and the title of the single post, the general keyword, and the  meta description is the first 350 characters of the first post.

24 (edited by fantasma 2007-10-06 11:52)

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

now i have this nice idea for add keyword for each post see below

A php programmer must make this only for the first new post (new discussion):

http://img63.imageshack.us/img63/6569/senzatitolo1sd6.png

Who can make it????

Re: [SEO_mod for PunBB] Meta Keyword and meta description for each post

fantasma wrote:

ok it work perfectly but i see the tag in the description meta

<br> <p> ecc

all the bbcode tag
i can leave it? Iwant that this mod show only the text

up this!!!