| |
|
| :: |
| Author |
Message |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
Posted: Wed Jun 28, 2006 8:26 pm Post subject: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
I have a current version of phpBB that is heavily moded. I installed the advanced mod rewrite and sitemap without a hitch and it is working great!
I had to change a couple of things because my forum is at the root level but I change the phpbb index to forum.php. I got everything to work great, however there are viewtopic links in a "Last 10 Active Topics" Marquee on my sites index.php that I would like rewritten as they are with your mod.
By looking at the modifications to sessions.php the rewrite for "viewtopic" has something to do with the variable $seo_topic_name. I don't know php that well so I've been trying to define this variable in MY index.php page but I don't know if it's working. It certainly doesn't result in the rewrite of my viewtopic links on my index.
Thanks for all your hard work, and any help would be appriciated!!! |
|
|
| Back to top |
|
 |
|
 |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
Posted: Wed Jun 28, 2006 9:25 pm Post subject: An index.php like yours! |
|
|
I just saw that you have a latest topics table on your main index page (for phpbb-seo.com not boards.phpbb-seo.com)and that the links are rewritten.
This is exactly what I want!
I can supply a link to my site, so you can see what I mean, but I don't want to break any spamming rules!
While I'm waiting for an answer, I'll check out the code of your rewrite mod for mx-system CMS. |
|
|
| Back to top |
|
 |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14327
|
Posted: Wed Jun 28, 2006 10:39 pm Post subject: Re: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
Hi, welcome and sorry for delay here, you are quick in elaborating
I see you changed post to handyman_post, actually, I think you should even get rid of post then, handymanxx.html would work with the same small changes, but you should still disallow them in robots.txt for optimal results.
Last thing you need to implement the guest sessions mod to get rid of SIDs.
For the last message module, it's very doable and easy
You hit the right var with $seo_topic_name when searching to do it.
Actually, this mod's principle is very simple, instead of using ob_start() or to perform one SQL per link to either grab titles in the outputted page or to query for them, here, we just grab it from source.
Actually, with vanilla boards this could have been done without any editing in phpBB files other than function.php and Session.php, since the titles var are pretty standards among phpBB.
I decided to still go and grab them from the source to get a better control and to allow easier adaptations with mod outputting links.
The idea, is to fill $seo_topic_name with the topic title once censored (this is important not to output dupes in mods output) and just before append_sid() is called for this topic link.
append_sid() is the function used by phpBB to take care of SIDs in URLs, every phpBB links go through it.
If we need on particular URL to stay as is (which is never useful since 0.0.2 with phpBB, but could one day with one mod or portal) you can set $seo_topic_name to FALSE before append_sid() is called in the code.
So, are you using mxBB ?
If it's the case the link you sent is the solution.
If not, just send me a link to the mod if it's a mod. If it's custom code, then it should still be possible.
And you installed mx Google sitemaps perfectly, you can submit once you installed the guest sessions mod.
Mx sitemaps can help a lot as well
And don't forget the final touch  |
_________________ 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 |
|
 |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
Posted: Thu Jun 29, 2006 2:54 am Post subject: Re: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
| dcz wrote: | Hi, welcome and sorry for delay here, you are quick in elaborating
I see you changed post to handyman_post, actually, I think you should even get rid of post then, handymanxx.html would work with the same small changes, but you should still disallow them in robots.txt for optimal results. |
Got it done! I'm assuming the disallow is because indexing these is redundant because they are already spidered in xxx-vt.html
| dcz wrote: | | Last thing you need to implement the guest sessions mod to get rid of SIDs. |
I had already done this, but not with cyberalien's mod. I was quite puzzled when you said this, but I found that the your SEO mod replaced the modded code in sessions.php. I fixed this by using cyberalien's mod.
| dcz wrote: | For the last message module, it's very doable and easy
You hit the right var with $seo_topic_name when searching to do it.
Actually, this mod's principle is very simple, instead of using ob_start() or to perform one SQL per link to either grab titles in the outputted page or to query for them, here, we just grab it from source.
Actually, with vanilla boards this could have been done without any editing in phpBB files other than function.php and Session.php, since the titles var are pretty standards among phpBB.
I decided to still go and grab them from the source to get a better control and to allow easier adaptations with mod outputting links.
The idea, is to fill $seo_topic_name with the topic title once censored (this is important not to output dupes in mods output) and just before append_sid() is called for this topic link.
append_sid() is the function used by phpBB to take care of SIDs in URLs, every phpBB links go through it.
If we need on particular URL to stay as is (which is never useful since 0.0.2 with phpBB, but could one day with one mod or portal) you can set $seo_topic_name to FALSE before append_sid() is called in the code.
So, are you using mxBB ?
If it's the case the link you sent is the solution. |
No, I'm not using the mxBB CMS just a heavily modded phpBB2, so I might have to use something thats more custom.
| dcz wrote: | | If not, just send me a link to the mod if it's a mod. If it's custom code, then it should still be possible. |
Here you go:
http://www.phpbb.com/phpBB/viewtopic.php?t=145150
Done! I just reformatted it and added a "Optimized by" prefix, if this is ok? |
|
|
| Back to top |
|
 |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
Posted: Thu Jun 29, 2006 4:00 am Post subject: Re: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
I was perusing the thread for the "Latest Active Topic Mod" and see you have several posts in there. I was looking for a mod rewrite fix, and figured out a fix by a post you made.
I replaced this:
| Code: | | 'TOPIC_URL' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"]), |
With:
| Code: | | 'TOPIC_URL' => append_sid($phpbb_root_path . $row[$i]["topic_title"] . '-vt' . $row[$i]["topic_id"].'.html'), |
The only thing is the spaces in the URL get replaced with the standard %20, but it works. I don't know if bots hate this in URLs, but I would like to replace the spaces (%20) with a dash, such as in your rewrites. How would I go about doing this? |
|
|
| Back to top |
|
 |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
Posted: Thu Jun 29, 2006 4:41 am Post subject: Re: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
OK, I think I got it!
I changed the above code to this:
| Code: | | 'TOPIC_URL' => append_sid($phpbb_root_path . format_url($row[$i]["topic_title"]) . '-vt' . $row[$i]["topic_id"].'.html'), |
The "format_url" changed all the "%20" to dashes "-", and I hope this is the correct way to go about it and that it doesn't screw something up! As I said before, I don't know PHP, but I can somewhat understand what is happening in the code by backwards engineering it.
Let me know if this is good! thanks! |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14327
|
Posted: Thu Jun 29, 2006 10:28 am Post subject: Re: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
| handy1 wrote: |
Got it done! I'm assuming the disallow is because indexing these is redundant because they are already spidered in xxx-vt.html
|
Exactly, and we want no duplicates to end up with the best PageRank as possible.
For the SID I think you used the able2know method, Guest session's is better as it will additionally track guest sessions so that they don't end up creating on session per loaded page.
The prefix is fine, thanks
Your last change for the topic links is perfect, that's exactly what forumat_url() is made for.
But you need to use the censor system for topic titles, at least if you want to be able to ban words with no risk latter on.
To do this, and I assume you are using a modded version of the mod but will be able to figure out the small differences.
So in the mod's code find :
| Code: |
//
// Get The Data
// |
Before add :
| Code: | //
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word); |
Find :
| Code: |
for($i = 0; $i < $topics; $i++)
{
$mar_title = $row[$i]["topic_title"]; |
Replace with :
| Code: | for($i = 0; $i < $topics; $i++)
{
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$mar_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $row[$i]["topic_title"]) : $row[$i]["topic_title"];
$seo_topic_name = $mar_title;
// www.phpBB-SEO.com SEO TOOLKIT END |
With this you won't even have to change more things in you files for the title to be injected. That's how $seo_topic_name is used, will pass the title to the append_sid() where it will be injected using format_url().
=> mx Google sitemaps & mx sitemaps & dynamic meta tags
++
[EDITED] To get rid of an extra semicolon  |
_________________ 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
Last edited by dcz on Thu Jun 29, 2006 2:48 pm; edited 1 time in total |
|
| Back to top |
|
 |
handy1
Joined: 28 Jun 2006 Posts: 17 Location: Appleton, WI
|
Posted: Thu Jun 29, 2006 2:31 pm Post subject: Re: phpBB SEO mod Rewrite and rewriting links on MY index page |
|
|
Thanks for all the help! Everything works great! I just had to change my URL variable definitions to fit your code. It now looks like this:
| Code: | | $mar_url = $phpbb_root_path . format_url($seo_topic_name) . '-vt' . $row[$i]["topic_id"].'.html'; |
and...
| Code: | | 'TOPIC_URL' => append_sid($phpbb_root_path . format_url($seo_topic_name) . '-vt' . $row[$i]["topic_id"].'.html'), |
Additionally, for others reference, you accidently had an extra semi-colon in this code at "$replacement_word, $row[$i]["topic_title"];)"
| Code: | for($i = 0; $i < $topics; $i++)
{
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$mar_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $row[$i]["topic_title"];) : $row[$i]["topic_title"];
$seo_topic_name = $mar_title;
// www.phpBB-SEO.com SEO TOOLKIT END |
I will try the other sitemap mod and dynamic keyword mod!
Thanks again! |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14327
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|