| |
|
| :: |
| Author |
Message |
Pennywise83
Joined: 14 May 2007 Posts: 7
|
Posted: Mon May 14, 2007 2:09 pm Post subject: Different description tag |
|
|
Hi,
actually the mod write for the description metatag the topic title and the site name...
There is a way to have the first 20 words of the first message of the topic? I've looked at phpbb_seo_class.php but I don't know how I can call the topic content for use it as description...
anyone can help me? |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14854
|
|
| Back to top |
|
 |
Pennywise83
Joined: 14 May 2007 Posts: 7
|
Posted: Thu May 31, 2007 3:30 am Post subject: Re: Different description tag |
|
|
Hi dcz, thanks for the help!
I've rebuild the search table but I've the same problem... my head meta-tags looks like this:
<title>ke giochi avete??? - Pagina 4 - Wii Italia Forum</title><meta name="title" content="ke giochi avete??? - Pagina 4">
<meta name="description" lang="it" content="Wii Italia Forum : ke giochi avete??? - Pagina 4">
<meta name="keywords" content="giochi,wii,Wii,Italia,Forum,avete,Pagina">
<meta name="category" content="general">
<meta name="robots" content="index,follow">
also, i've added some words in search_stopwords.txt as suggested on your link but phpbbseo find it! One keyword, for example, is "Pagina"... in search_stopwords.txt there is "pagina", the "p" lowercase, maybe it could be the problem? |
|
|
| Back to top |
|
 |
noworyz PR0

Joined: 08 Jan 2007 Posts: 87
|
Posted: Thu May 31, 2007 3:57 am Post subject: Re: Different description tag |
|
|
I seem to be having the same issue. The description meta tag on my topic pages are [sitename] : [forum name] : [topic title]
it doesn't have the first 20 words of the post. I have just rebuilt my search tables also. |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 809
|
Posted: Thu May 31, 2007 2:09 pm Post subject: Re: Different description tag |
|
|
I think we're confusing the keywords metatag and description metatag. The latter is shown as an "abstract" by some search engines if no search keywords are provided (e.g., google site:yoursite.com). I don't know that it matters much to search engines, but it looks neater.
Here's some example code. It's not fancy, just takes the first post and strips off quotes, BBcode, image references, etc., then cuts it down to a bite size sentence. It's not efficient, it's not pretty, but worth everything you paid for it...
Open viewtopic.php and find:
| Code: | //
// Was a highlight request part of the URI?
// |
Insert before:
| Code: | //
// meta content = description
//
$entry = $postrow[0]['post_text'];
$entry = preg_replace('/(\[quote:[a-z0-9]{10,}\]((.|\n)*)\[\/quote:[a-z0-9]{10,}\])/si',"", $entry);
$entry = preg_replace('/(\[quote:[a-z0-9]{10,}=(.*?)\]((.|\n)*)\[\/quote:[a-z0-9]{10,}\])/si',"", $entry);
// copied from functions_search.php
$entry = strip_tags($entry);
// Replace line endings by a space
$entry = preg_replace('/[\n\r]/is', ' ', $entry);
// Remove URL's
$entry = preg_replace('/\b[a-z0-9]+:\/\/[a-z0-9\.\-]+(\/[a-z0-9\?\.%_\-\+=&\/]+)?/', ' ', $entry);
// Quickly remove BBcode.
$entry = preg_replace('/\[img:[a-z0-9]{10,}\].*?\[\/img:[a-z0-9]{10,}\]/', ' ', $entry);
// change space to alternative if you prefer (e.g., {video}, {link})
$entry = preg_replace('/\[youtube\].*?\[\/youtube\]/', ' ', $entry);
$entry = preg_replace('/\[gvideo\].*?\[\/gvideo\]/', ' ', $entry);
$entry = preg_replace('/\[\/?url(=.*?)?\]/', ' ', $entry);
$entry = preg_replace('/\[\/?[a-z\*=\+\-]+(\:?[0-9a-z]+)?:[a-z0-9]{10,}(\:[a-z0-9]+)?=?.*?\]/', '', $entry);
// remove whitespace, reduce to first sentence or two.
$entry = preg_replace('/\\s+/', ' ', $entry);
$entry = str_replace('"', "", $entry);
if (strlen($entry) > 300) {
$entry = substr($entry, 0, 360);
$xx = strrpos($entry, '.');
if ($xx !== false)
$entry = substr($entry, 0, $xx + 1);
}
$entry = trim($entry);
if (strlen($entry) == 0)
$entry = $topic_title;
$template->assign_vars(array(
"META" => '<meta name="description" content="' . $entry . '">')
); |
|
_________________ Dan Kehn |
|
| Back to top |
|
 |
noworyz PR0

Joined: 08 Jan 2007 Posts: 87
|
Posted: Thu May 31, 2007 2:15 pm Post subject: Re: Different description tag |
|
|
| my keywords are working fine but the first poster in this thread is referring to the first 20 words of the posts contents as the description. If this is not how it is supposed to work, then mine is working fine. It is a neat idea though! |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14854
|
Posted: Fri Jun 01, 2007 8:26 am Post subject: Re: Different description tag |
|
|
Well, the mod will pick the most used keywords among the topic title and the first post content, 3 letter at least.
The words from the topic are queried for in the search table, so you should pick the words in the topic first post that are the most used among all in your forum, making the mod quite interesting.
Could you post a link to where you think the first post keywords where not taken into account ?
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
Pennywise83
Joined: 14 May 2007 Posts: 7
|
Posted: Fri Jun 01, 2007 2:02 pm Post subject: Re: Different description tag |
|
|
| HB wrote: | | I think we're confusing the keywords metatag and description metatag. |
I was clear, I've talked about the description metatag, not the keywords one.
Btw thanks for your help but either with your modification the thing doesn't work...
You can check my phpbb installation here: http://www.wiitalia.it/forum/giochi-wii-il-migliore-t58.html |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14854
|
Posted: Sat Jun 02, 2007 11:14 am Post subject: Re: Different description tag |
|
|
Ho, I see now, so since the mod is using the search tables to be able to query directly the keyword with the most weight among the forum and within the topic first post, all we get is a keyword list.
The description is only built using the forum and topic title, which is IMHO enough if not better the let's say first two sentences of a given post.
At least the forum info adds some way to categorize the topic, where the first sentences could be totally out of the point, like :
| Quote: |
Hello,
yes you're right, bla bla ....
So about your concern, ... |
And then the interesting part.
HB suggestion is doing what you want, you'd need to mod the templating a bit, but it can easily be used with the regular mod.
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|