Hide registrations spam
There are many spam bots that register on your forum with link to some junk website in their profile. Purpose of those bots is to increase search engine position of website they are spamming.
These users are completely harmless in terms of security, but linking to spam websites might decrease your website's search engine rankings, and you do not want your visitors to see those spam links, so its always a good idea to hide those links.
There are several methods to do it:
Open memberlist.php, find this:
These users are completely harmless in terms of security, but linking to spam websites might decrease your website's search engine rankings, and you do not want your visitors to see those spam links, so its always a good idea to hide those links.
There are several methods to do it:
1. Hide homepage link
Simpliest method is to hide homepage link in user's profiles. But we don't want to hide everyone's links, just spammer's links. All registration spammers have 0 posts.Open memberlist.php, find this:
Code:
- $www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
- $www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
and replace it with this:
Code:
- $www_img = ( $row['user_website'] && $row['user_posts'] > 0 ) ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
- $www = ( $row['user_website'] && $row['user_posts'] > 0 ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
then open includes/usercp_viewprofile.php, find this:
Code:
- $www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ' ';
- $www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : ' ';
and replace with this:
Code:
- $www_img = ( $profiledata['user_website'] && $profiledata['user_posts'] > 0 ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ' ';
- $www = ( $profiledata['user_website'] && $profiledata['user_posts'] > 0 ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : ' ';
That's all.
Open memberlist.php, find this:
2. Hide 0 posters from users list
Another method is to hide all users with 0 posts from users list.Open memberlist.php, find this:
Code:
- FROM " . USERS_TABLE . "
- WHERE user_id <> " . ANONYMOUS . "
- ORDER BY $order_by";
and replace with this:
Code:
- FROM " . USERS_TABLE . "
- WHERE user_id <> " . ANONYMOUS . " AND user_posts > 0
- ORDER BY $order_by";
then find this:
Code:
- $sql = "SELECT count(*) AS total
- FROM " . USERS_TABLE . "
- WHERE user_id <> " . ANONYMOUS;
and replace with this:
Code:
- $sql = "SELECT count(*) AS total
- FROM " . USERS_TABLE . "
- WHERE user_id <> " . ANONYMOUS . " AND user_posts > 0";
That's all. If you have applied both methods then user profiles and member list will be clear of spammers.
Don't worry about extra space spammers take in database, its nothing compared to size of other data in your forum database, so I think its not worth the effort to manually delete those spammers and hiding them is a good simple solution.
Don't worry about extra space spammers take in database, its nothing compared to size of other data in your forum database, so I think its not worth the effort to manually delete those spammers and hiding them is a good simple solution.