[BETA] GoogleBB Link Enhancement 1.2.1

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
Kinetix-
Registered User
Posts: 128
Joined: Sun Aug 01, 2004 12:07 pm
Location: Canada
Contact:

[BETA] GoogleBB Link Enhancement 1.2.1

Post by Kinetix- » Mon Sep 13, 2004 1:21 pm

GoogleBB Link Enhancement 1.2.1 (Codename Surprise)

What is it?
GoogleBB Link Enhancement uses mod_rewrite technology to change the links into more search engine-friendly (hence the 'google' in the name) pages. As we all know, Google does not like to cache pages which have long names like viewtopic.php?t=2&blah=moreblah. That's where GoogleBB comes in. This updates the link to viewtopic.2-blah-moreblah.html. Not only is it better for search engines, but the links are a lot smaller when you want to copy and paste it to a friend.

What do I need to use it?
You need an Apache web server with mod_rewrite enabled and PHP4 or higher.

THIS MOD IS NOT COMPATIBLE WITH:
Any MOD that uses ob_start to replace things in a page, such as the PNG transparency fix MOD. However you can easily fix that by changing ob_get_clean to ob_get_contents in those MODs.

Code: Select all

##############################################################
## MOD Title: GoogleBB
## MOD Author: Kinetix < webmaster@ikrontik.tk > (N/A) http://localhost/
## MOD Description: This MOD changes links into more search engine-friendly
##                  .html links.
## MOD Version: 1.2.1
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 2: includes/page_tail.php
##                   includes/page_header.php
## Included Files: 1: .htaccess
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes: You must be using an Apache web server with
##               mod_rewrite enabled.
##
##############################################################
## MOD History:  0.1.0 Alpha release.
##               0.3.0 Fixed: viewtopic link
##                     Added: memberlist, faq, groupcp, viewprofile.
##               1.0.0 Release candidate 0.
##                     Fixed a view results poll bug.
##               1.0.0 Release Candidate 1.
##                     Fixed the watch/unwatch topic bug.
##               1.0.0 Release Candidate 2.
##                     Fixed a bug with the title link.
##               1.2.1 (Codename Surprise)
##                     Rewrote some code.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
############################################################## 
Download? See this post.

Please report any bugs on this thread. If you have any regex submissions for link updates (especially for MODs), please PM them to me - I can keep better track of them there.

This MOD was inspired by GoogleTap for PHP-Nuke by Paul Laudanski (Zhen-Xjell).
Last edited by Kinetix- on Tue Jun 28, 2005 4:43 am, edited 8 times in total.

~ TwiSteD ~
Registered User
Posts: 115
Joined: Sun Jun 27, 2004 4:03 am
Location: here
Contact:

Post by ~ TwiSteD ~ » Mon Sep 13, 2004 3:16 pm

Very nice :)

Now only if it could be wrote to an .html extension for the memberlist, aswell as groups & profile, it'd be one of teh best i've seen :wink:

User avatar
yukisho
Registered User
Posts: 130
Joined: Tue Jun 08, 2004 4:32 am
Contact:

Post by yukisho » Mon Sep 13, 2004 10:11 pm

Nice nice mod. Now can we have a demo?

User avatar
Seven-
Registered User
Posts: 48
Joined: Fri Apr 23, 2004 9:47 pm
Location: Tomah
Contact:

Post by Seven- » Tue Sep 14, 2004 12:37 am

yukisho wrote: Nice nice mod. Now can we have a demo?


his website... here is a sample link to one of his catagories ;)

http://ikrontik.adamhurst.com/forum1.html
Image

Kinetix-
Registered User
Posts: 128
Joined: Sun Aug 01, 2004 12:07 pm
Location: Canada
Contact:

Post by Kinetix- » Tue Sep 14, 2004 12:47 am

Updated to 0.3.0. All together, it now supports faq, search, memberlist, usergroups, viewprofile, viewtopic, viewforum.

If you ever need to upgrade, all you need to do is replace the actual function from page_tail with the new one, and replace the .htaccess with the new one as well. No other code will ever have to be changed to upgrade.

richard_5421
Registered User
Posts: 521
Joined: Tue Dec 30, 2003 12:57 am

Post by richard_5421 » Sat Sep 18, 2004 4:38 pm

Hi I added this, now how can I test it?

I did forum1.html but it doesn't work

Kinetix-
Registered User
Posts: 128
Joined: Sun Aug 01, 2004 12:07 pm
Location: Canada
Contact:

Post by Kinetix- » Sun Sep 19, 2004 4:51 pm

The one on my website is different from this.
Go to viewforum.1.html

cgmsys
Registered User
Posts: 2
Joined: Mon Sep 20, 2004 1:21 pm

Install questions (found some answers to my questions)

Post by cgmsys » Mon Sep 20, 2004 1:29 pm

I just did the install on three sites and seem to have answered my questions below. Once I figured it out it was simple. I now have real urls. Just waiting for the spiders.

Before I modified the 2 files, I simply made a copy of them.

One final thing. I think I'm going to have to modify the site's robots.txt to keep it from indexing the memberlist. I'll drive off that bridge when I get to it.

THANKS FOR POSTING THE MOD!!!

chris

-------------------------------------------------------------
Sorry for what are probably some stupid questions. I have done 2 other mods but they were a little different.

I downloaded googlebb. I see the .htaccess and the .txt file. FTP'ing them if necessary is no problem.

Questions:

1. Is the .txt file something that can be run once it is FTP'd or do you do the changes to the specified files manually?

All I did was follow the directions in the .txt file


2. This is a dumb one.. If you replace the .htaccess file is it at the website root or is it in another directory (My knowledge of working with htaccess is limited and I'm not sure if it exists in other directories other than the root)

I figured out that the .htaccess file is in the root of the phpbb discussion folder

3. The sites where I am using PHPbb have a regular website side to them along with phpbb. If .htaccess is only in the root, then I assume that I would want to copy the googlebb .htaccess lines into my site's .htaccess

see above

3. I'm trying to check to see if both of my hosting services support mod-rewrite. I think they do. If I do this mod and they don't support mod rewrite will it break anything (I will make a copy of the header and footer before making the changes.)

Trial by fire - it worked.


Thanks

chris
Last edited by cgmsys on Tue Sep 21, 2004 2:29 am, edited 1 time in total.

User avatar
webmedic
Registered User
Posts: 323
Joined: Tue May 28, 2002 2:37 am
Contact:

Post by webmedic » Mon Sep 20, 2004 3:19 pm

how does that mod differ from this one?

http://www.phpbb.com/phpBB/viewtopic.ph ... highlight=

User avatar
webmedic
Registered User
Posts: 323
Joined: Tue May 28, 2002 2:37 am
Contact:

Post by webmedic » Mon Sep 20, 2004 3:20 pm

oh and were can that transparent png mod be found? I cant find it.

Kinetix-
Registered User
Posts: 128
Joined: Sun Aug 01, 2004 12:07 pm
Location: Canada
Contact:

Re: Install questions (found some answers to my questions)

Post by Kinetix- » Sat Oct 09, 2004 1:42 pm

cgmsys wrote: 1. Is the .txt file something that can be run once it is FTP'd or do you do the changes to the specified files manually?

2. This is a dumb one.. If you replace the .htaccess file is it at the website root or is it in another directory (My knowledge of working with htaccess is limited and I'm not sure if it exists in other directories other than the root)

3. The sites where I am using PHPbb have a regular website side to them along with phpbb. If .htaccess is only in the root, then I assume that I would want to copy the googlebb .htaccess lines into my site's .htaccess

3. I'm trying to check to see if both of my hosting services support mod-rewrite. I think they do. If I do this mod and they don't support mod rewrite will it break anything (I will make a copy of the header and footer before making the changes.)


Sorry, I've been away for a while.

1. You can run it if you have EasyMOD, it will parse the file and do the changes for you. But this is a very small MOD and doesn't need EasyMOD for you to do it.

2. It works for the dir you put it in until the subdirs.
Eg: If you put it in root/discussion, it will also work for root/discussion/hello, but not root/ or root/hello.

3. Most hosts running on Apache have MOD rewrite.

how does that mod differ from this one?

As far as I can tell, your MOD doesn't change all links. Mine does. Mine is also simpler. But if you want to have keyworded links, then I'm sure they will go with yours.

thesmallelder
Registered User
Posts: 1
Joined: Sat Oct 09, 2004 2:22 pm
Contact:

Post by thesmallelder » Sat Oct 09, 2004 2:27 pm

Cool mod! Real easy to install and it works pretty well. In the next version you should add one for viewprofile then it would be pefect.
Image

Kinetix-
Registered User
Posts: 128
Joined: Sun Aug 01, 2004 12:07 pm
Location: Canada
Contact:

Post by Kinetix- » Sat Oct 09, 2004 2:43 pm

The current version already supports viewprofile.

Updated to 1.0.0 Release Candidate.
Added the following, the first one goes in the top array, the second one goes in the second array, the third one goes in .htaccess. This is just for reference so you know what I changed.
String to replace
"'(?<!/)viewtopic.php\?t=([0-9]+)&postdays=([0-9]+)&postorder=([a-zA-Z]*)&vote=([a-zA-Z0-9_]*)'",
Replace with
"viewtopicres.\\1-\\2-\\3-\\4.html",
htaccess
RewriteRule ^viewtopicres.([0-9]+)-([0-9]+)-([a-zA-Z]*)-([a-zA-Z0-9_]*).html viewtopic.php\?t=$1&postdays=$2&postorder=$3&vote=$4

User avatar
Cross_+_Flame
Registered User
Posts: 295
Joined: Wed Oct 30, 2002 3:37 pm
Location: Okie-homa!
Contact:

Post by Cross_+_Flame » Sat Oct 09, 2004 4:00 pm

will all the previous links work? Like all my links on other websites that point to my specific threads now, will they still work even though they are mod_rewrote?

Kinetix-
Registered User
Posts: 128
Joined: Sun Aug 01, 2004 12:07 pm
Location: Canada
Contact:

Post by Kinetix- » Sat Oct 09, 2004 7:45 pm

Yes. They will work fine. This only adds aliases for the .html links, you can always access the pages with the normal .php links.

Post Reply

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 9 guests