Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-12-2007, 05:59 PM   #1
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
phpbb Question - How To Make All Posted Links Have rel="nofollow" Attribute?

Can anyone tell me what needs to be modified in phpbb script to make all links made by members in forum posts have rel="nofollow" attribute automatically assigned to them?
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:13 PM   #2
CyberHustler
Masterbaiter
 
Industry Role:
Join Date: Feb 2006
Posts: 26,208
This might help a little

http://phpbbhacks.com/download/7666

But i'm sure you're looking for all links to have "nofollow" no matter the post count.
CyberHustler is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:20 PM   #3
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
That's a pretty helpful link. thanks a lot, Cyber. I was hoping hor a patch that would assign nofollow to all links posted. But even this one is a lot of help already
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:36 PM   #4
minusonebit
So Fucking Banned
 
Join Date: Feb 2006
Posts: 7,391
Why would you bother? Spammers will keep on spamming. I switched away from phpBB to SMF and installed a few mods and have not had near as many problems with spam.
minusonebit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:43 PM   #5
CyberHustler
Masterbaiter
 
Industry Role:
Join Date: Feb 2006
Posts: 26,208
I upgraded one of my boards to phpBB RC5 and have absolutely no spam problems at all. And that board was a major target.
CyberHustler is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:50 PM   #6
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
You know what I did, minusonebit? I decided to try a public experiment. I installed a forum script on a brand new domain and disabled all email confirmations, approval and shit and posted just one big sign on it saying that this is a completely unmoderated forum and anyone can post in it, including spammers.

Inside I made one sticky thread which I named "Read This First" and wrote, what did you think you would find here. This is the unmoderated forum where anyone can post anything. If this turns into spam heaven - who the fuck cares...

After that I just left the site be. I haven't touched it for a few months, now I come back to it and guess what:

Our users have posted a total of 2370 articles
We have 2681 registered users

and all of it is the biggest spam shit you could imagine. i want to let the site fly. You never know what could happen with it next. Maybe someone real will start posting and maybe it'll turn into an active forum. However, at present time the spam heaven is going berserk and all links lead to the wors neighborhoods on the web. I'd love to have the bots not follow those links so they don't nuke my site for linking to bad neighborhoods. That's why i was hoping for a mod to add rel="nofollow" to all external links posted in forums there
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:53 PM   #7
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
This is pretty easy to do. Case in point? I just did it. This will stop people from URL spamming in their profile, and via BBCode URL tags, which is about 99% of the problem.

I can even install this for cash, but I'll put this one out there for free. Save as 'file.diff' and use GNU's patch against your original source tree - or find the files (listed at the top with --- / +++, and remove the lines that have - at the beginning, then replace with the lines starting with +.

Code:
diff -urN phpBB2/includes/bbcode.php phpBB2-nofollow/includes/bbcode.php
--- phpBB2/includes/bbcode.php	2006-12-19 11:29:15.000000000 -0600
+++ phpBB2-nofollow/includes/bbcode.php	2007-10-12 19:42:54.000000000 -0600
@@ -624,13 +624,13 @@
 	// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
 	// xxxx can only be alpha characters.
 	// yyyy is anything up to the first space, newline, comma, double quote or <
-	$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
+	$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\" rel=\"nofollow\">\\2</a>", $ret);
 
 	// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
 	// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
 	// zzzz is optional.. will contain everything up to the first space, newline, 
 	// comma, double quote or <.
-	$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
+	$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\" rel=\"nofollow\">\\2</a>", $ret);
 
 	// matches an email@domain type address at the start of a line, or after a space.
 	// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
diff -urN phpBB2/viewtopic.php phpBB2-nofollow/viewtopic.php
--- phpBB2/viewtopic.php	2006-12-19 11:29:16.000000000 -0600
+++ phpBB2-nofollow/viewtopic.php	2007-10-12 19:45:29.000000000 -0600
@@ -939,8 +939,8 @@
 			$email = '';
 		}
 
-		$www_img = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
-		$www = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
+		$www_img = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww"  rel="nofollow"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
+		$www = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww"  rel="nofollow">' . $lang['Visit_website'] . '</a>' : '';
 
 		if ( !empty($postrow[$i]['user_icq']) )
 		{
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 06:57 PM   #8
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
Thanks a lot for your help, Grouchy, though I'm not sure this is exactly what I'm looking for. I actually don't want to prevent members (in my case bots for the most part) form posting links. I just want the search engine spiders to ignore all URLs posted.

As an alternative - can I maybe modify my robots.txt the way so the site is entirely spidered, but no external links are followed? Is there a way to achieve that with robots.txt?
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 07:00 PM   #9
BigBen
Confirmed User
 
Join Date: Nov 2004
Location: scv
Posts: 2,299
Quote:
Originally Posted by pornask View Post
That's a pretty helpful link. thanks a lot, Cyber. I was hoping hor a patch that would assign nofollow to all links posted. But even this one is a lot of help already
Change this:

define('NOFOLLOW_POSTS', 5);

to this:

define('NOFOLLOW_POSTS', 5000000);
BigBen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 07:04 PM   #10
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by pornask View Post
Thanks a lot for your help, Grouchy, though I'm not sure this is exactly what I'm looking for. I actually don't want to prevent members (in my case bots for the most part) form posting links. I just want the search engine spiders to ignore all URLs posted.
That's all it does. It sets links to have rel='nofollow' in them.


Quote:
Originally Posted by pornask View Post
As an alternative - can I maybe modify my robots.txt the way so the site is entirely spidered, but no external links are followed? Is there a way to achieve that with robots.txt?
robots.txt does not work that way.
__________________

Last edited by GrouchyAdmin; 10-12-2007 at 07:06 PM..
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 07:18 PM   #11
minusonebit
So Fucking Banned
 
Join Date: Feb 2006
Posts: 7,391
Quote:
Originally Posted by pornask View Post
You know what I did, minusonebit? I decided to try a public experiment. I installed a forum script on a brand new domain and disabled all email confirmations, approval and shit and posted just one big sign on it saying that this is a completely unmoderated forum and anyone can post in it, including spammers.

Inside I made one sticky thread which I named "Read This First" and wrote, what did you think you would find here. This is the unmoderated forum where anyone can post anything. If this turns into spam heaven - who the fuck cares...

After that I just left the site be. I haven't touched it for a few months, now I come back to it and guess what:

Our users have posted a total of 2370 articles
We have 2681 registered users

and all of it is the biggest spam shit you could imagine. i want to let the site fly. You never know what could happen with it next. Maybe someone real will start posting and maybe it'll turn into an active forum. However, at present time the spam heaven is going berserk and all links lead to the wors neighborhoods on the web. I'd love to have the bots not follow those links so they don't nuke my site for linking to bad neighborhoods. That's why i was hoping for a mod to add rel="nofollow" to all external links posted in forums there
Ah, I think I understand now.

Shit, that site probably would make a nice honeypot to base a blacklist off of. I have always disliked the way boards in general handle spam. Visual verification is a good idea in theory, but these things eventually become compromised. Trust principles are another good once, since most spammers make thier very first post a spam post.

But I wish there was more of a blacklist/whitelist approach. Same for comments on blogs, same type of spammer and alot of the same tools could fight the war. Where some group would take the responsibility for maintaining a trustworthy, reliable, centralized database of spammers and then webmasters could, by way of a plugin, connect to this database and check new posts from newer members against this database.
minusonebit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 07:20 PM   #12
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by minusonebit View Post
But I wish there was more of a blacklist/whitelist approach. Same for comments on blogs, same type of spammer and alot of the same tools could fight the war.
Something like OpenID, then, with a simple blacklist feature. It'd require people to use OpenID for centralized access; but that's kind of the point.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 07:41 PM   #13
CyberHustler
Masterbaiter
 
Industry Role:
Join Date: Feb 2006
Posts: 26,208
Theres a shit load of mods that can help stop spam for phpBB.

You can also use Anti-Spam ACP: This hack prevents spam bots from registering on your forum by removing the fields of your choice in the registration and profile form until users reach certain requirements. If a spam bot is detected, you are sent an e-mail notification with the username, IP address and more.

Also, I use the MPS mod. It gives your members a MySpace like profile, but if you set it to mandatory it will stop 99% of the spam bots because before anyone can post they will have to set up their profile.
CyberHustler is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 08:34 PM   #14
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
This shit worked. Thanks a lot guys.

GFY is awesome. Real time help anytime. Fucking awesome

You Rock
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 09:20 PM   #15
minusonebit
So Fucking Banned
 
Join Date: Feb 2006
Posts: 7,391
Quote:
Originally Posted by GrouchyAdmin View Post
Something like OpenID, then, with a simple blacklist feature. It'd require people to use OpenID for centralized access; but that's kind of the point.
No, I am thinking more of a SpamHaus/SpamCop type approach. I dislike OpenID. While it probably would get rid of ALOT of problems, it would make the internet extremely traceable and remove any amount of annomnity.
minusonebit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 09:27 PM   #16
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
Can't get any worse than google. Combine it with Facebook that's controlled by CIA and you get the idea of how much "anonymity" people get when surfing.
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 10:13 PM   #17
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by minusonebit View Post
No, I am thinking more of a SpamHaus/SpamCop type approach. I dislike OpenID.
While true (It does have a smell of Passport.Net), I don't think that OpenID is quite as problematic. If you're just using OpenID for blogs/comments and Forums use, I fail to see where this would come into play.

So, pornask, what'd you end up doing?
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 10:34 PM   #18
pornask
So Fucking Banned
 
Join Date: Aug 2006
Location: 253-233-241
Posts: 6,518
I took that text file that Cyber linked to and followed instructions to manually modify the script. It does exactly the job. Couldn't be happier. Thanks for your response too, but since the first option worked, I didn't even get to explore the second. I appreciate that though
pornask is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-12-2007, 10:42 PM   #19
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by pornask View Post
I took that text file that Cyber linked to and followed instructions to manually modify the script. It does exactly the job.
Cool. Haha. Looking at it, it does almost the same thing, but that one lets you set a 'minumum number of posts' before not adding the 'nofollow' tag. Mine doesn't take that into consideration. (Then again, it wasn't asked for, and that would have been more than 5 minutes of work.)

Although, I gotta say:

Code:
		if ( $postrow[$i]['user_posts'] <= NOFOLLOW_POSTS )
That's kinda hokey, but hey, it works.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.