GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   phpbb Question - How To Make All Posted Links Have rel="nofollow" Attribute? (https://gfy.com/showthread.php?t=776127)

pornask 10-12-2007 05:59 PM

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?

CyberHustler 10-12-2007 06:13 PM

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.

pornask 10-12-2007 06:20 PM

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 :)

minusonebit 10-12-2007 06:36 PM

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.

CyberHustler 10-12-2007 06:43 PM

I upgraded one of my boards to phpBB RC5 and have absolutely no spam problems at all. And that board was a major target.

pornask 10-12-2007 06:50 PM

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 :)

GrouchyAdmin 10-12-2007 06:53 PM

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']) )
                {


pornask 10-12-2007 06:57 PM

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?

BigBen 10-12-2007 07:00 PM

Quote:

Originally Posted by pornask (Post 13228150)
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);

GrouchyAdmin 10-12-2007 07:04 PM

Quote:

Originally Posted by pornask (Post 13228273)
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 (Post 13228273)
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.

minusonebit 10-12-2007 07:18 PM

Quote:

Originally Posted by pornask (Post 13228246)
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. :thumbsup

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.

GrouchyAdmin 10-12-2007 07:20 PM

Quote:

Originally Posted by minusonebit (Post 13228353)
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.

CyberHustler 10-12-2007 07:41 PM

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.

pornask 10-12-2007 08:34 PM

This shit worked. Thanks a lot guys.

GFY is awesome. Real time help anytime. Fucking awesome :)

You Rock

minusonebit 10-12-2007 09:20 PM

Quote:

Originally Posted by GrouchyAdmin (Post 13228365)
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.

pornask 10-12-2007 09:27 PM

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.

GrouchyAdmin 10-12-2007 10:13 PM

Quote:

Originally Posted by minusonebit (Post 13228851)
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?

pornask 10-12-2007 10:34 PM

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 :)

GrouchyAdmin 10-12-2007 10:42 PM

Quote:

Originally Posted by pornask (Post 13229074)
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.) :thumbsup

Although, I gotta say:

Code:

                if ( $postrow[$i]['user_posts'] <= NOFOLLOW_POSTS )
That's kinda hokey, but hey, it works.


All times are GMT -7. The time now is 02:34 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123