PhpBB is one of the most popular forum programmes on the net. Of-course with the added benefit that it’s free (Open source is cool). As usual the problem with popular, great online systems is they attract the most evil of online folk known as spammers. They do have other names but this is a family site so we’ll leave those until after the watershed.
These spammers come in a number of different flavours. They’re sole purpose is to tell your beautiful forum lots of off-topic info such as where to buy little blue pills and where to see the latest home-video of some celebrity who forgot to put their clothes on and who sounds out of breath.
Anyway we don’t have to suffer in silence.
Prevention
There are a number of methods that can be used to cut down the number of spam registrations on phpbb3. The most popular that is used is the captcha
The captcha once upon a time used to be pretty effective in stopping the spammers. Now it seems that it doesn’t matter how difficult the captcha is to read, automated systems can easily signup. Therefore you end up alienating real users who want to sign-up and make it near impossible for visually impaired users.
One improvement on the visual captcha is the audio version. Once again this can cause problems for disabled users.
On phpbb2 there used to be a very good mod which basically asked the users questions. If the user answered correctly then they could signup. The useful feature of this simple mod was that it could be setup with numerous questions and answers. This meant that a different question would be displayed when the forum signup page was loaded. Only problem with this great mod was that on upgrading to phpbb3 it wasn’t there. There is another similar anti-bot mod but this one only has one question with two possible answers. This appears very successful at the moment but the question will have be changed regularly so that the answer doesn’t become mainstream and easily hacked again.
This helps reduce the number of auto bot based registrations where a computer program is fed lots of forum addresses and off it goes to create havoc.
Zero poster
The zero poster is the laziest of the bunch. More often than not they are created via bots. They signup then fill in their website details and other spam information then leave the account to fester and hope that google thinks their profile link is adding some spectacular service to the internet that their profile should be indexed. Mmmm I’m afraid not.
Next in the food chain …. The one poster
Evolution then gives us the one poster these can also be bots or sometimes the lazy human spammer. These creatures turn-up, register (include web address in profile and signature). They then make one post saying anything from a non-value adding comment such as “great site” or “nice weather” or some other inane words to the other end of the spectrum saying about their great site and once again put in a link.
These blighters can be controlled via a number of methods requiring varying forms of effort. Obviously they can be manually warned / deleted by moderators or forum owners. As in the zero poster they can be pruned using the built in prune users function in the phpbb3 admin panel.
phpBB tweaks
One method is to modify the forum so that their website link, signature is only shown after they’ve posted an arbitrary amount. Obviously this amount depends on how busy your forum is. You need to keep a balance between keeping the undesirables out and keeping the regulars happy.
One route that can help deter the flytipping users is to use a nofollow tag. This doesn’t stop them from posting rubbish links to your site but it helps in a couple of ways. Firstly it means none of your google rank juice is given to these sites. Secondly a lot of people who either buy links or acquire links for these people will not go near a site which has nofollow.
In php I’ve put a couple of nofollow’s into the code. The first is in the forum post. I got a cool one-liner from this forum and tweaked it not to alienate the loyal band of users.
In viewtopic.php find the following lines
$message = bbcode_nl2br($message);
$message = smiley_text($message);
Then copy and paste the following.
if ($user_cache[$poster_id]['posts'] < 75)
{
$message = preg_replace('/(class="postlink")/','class="postlink" rel="nofollow" target="_blank"',$message);
}
This then got me thinking about the register page. I've also nofollowed their sites unless they post more than a certain amount of posts. This was slightly more work to achieve the same effect but only involves a couple of file edits.
In memberlist.php after
$age = (int) ($now['year'] - $bday_year - $diff);
}
}
I added a field to set nofollow or not.
if (!empty($data['user_website']) && $data['user_posts'] < 75)
{
$u_nofollow = 'rel="nofollow"';
}
else
{
$u_nofollow = '';
}
Then underneath
'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '',
the following line was added
'U_NOFOLL' => (!empty($data['user_website'])) ? $u_nofollow : '',
Then edit memberlist_body.html in the template section of the style your using. Find
Add
{memberrow.U_NOFOLL}
after
{memberrow.U_WWW}"
and before
title="{L_VISIT_WEBSITE}
Robots.txt
Another way to stop search engines from indexing profile pages is to use the robots.txt file. This site gave some phpbb specific robots.txt edits. This is quicker than than the file edits above. It just depends on whther you want to exclude all or tweak it so that only those lower down the food chain get excluded.
The fight goes on
Looking after a forum can be hard work sometimes. By adding modifications makes it slightly easier. This post gives a brief look at some tweaks it doesn't go into the why, that will come in later posts.