[BETA] Anti-Spam: Only Active Members Can Post URLs

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.
calamus77
Registered User
Posts: 60
Joined: Wed Oct 18, 2006 11:32 pm
Location: Idaho, U.S.
Contact:

[BETA] Anti-Spam: Only Active Members Can Post URLs

Post by calamus77 » Wed Oct 18, 2006 11:54 pm

MOD Title: Anti-Spam: Only Active Members Can Post URLs
MOD Description: Members must be registered for at least X days and have more than Y posts (configurable on the admin config page) before they can post URLs or enter personal information into their profile. Guest user can never post URLs.
MOD Date: 2006-12-27
MOD Version: 1.0.2 [BETA]

MOD Download: http://www.flashfiredesigns.com/phpbb_a ... .2.txt.mod

version 1.0.1 RC1 wrote: MOD Title: Anti-Spam: Only Active Members Can Post URLs
MOD Description: Members must be registered for at least X days and have more than Y posts (configurable on the admin config page) before they can post URLs or enter personal information into their profile. Guest user can never post URLs.
MOD Date: 2006-11-03
MOD Version: 1.0.1 [BETA]

MOD Download: http://www.flashfiredesigns.com/phpbb_a ... .1.txt.mod


version 1.0.0 RC1 wrote: MOD Title: Only Active Members Can Post URLs
MOD Description: Members must be registered for at least X days and have more than Y posts (configurable in the admin) before they can post URLs. Guest user can never post URLs.
MOD Date: 2006-10-31
MOD Version: 1.0.0 RC1

MOD Download: http://www.flashfiredesigns.com/phpbb_a ... .0.txt.mod

version 0.0.2 wrote: MOD Title: Only Active Members Can Post URLs
MOD Description: Members must be registered for at least X days and have more than Y posts before they can post URLs. Guest user can never post URLs
MOD Date: 2006-10-18
MOD Version: 0.0.2

MOD Download: http://www.flashfiredesigns.com/phpbb_a ... .2.txt.mod

Took the first posters suggestion and the admin can now change the configuration for both the number of days a user must be registered and the number of posts they must have before being allowed to post URLs. There is now more likelihood that I've got a bug. However, things are running smoothly as far as I can tell on the live site this is running on.

version 0.0.1 wrote: MOD Date: 2006-10-18
MOD Version: 0.0.1

MOD Download: http://www.flashfiredesigns.com/phpbb_a ... .1.txt.mod

This is a very simplistic MOD that I wrote today, because I finally got sick of deleting spambot posts. It's so simplistic that I don't expect there to be any bugs, but want to dot my i's and cross my t's :).

I've already got it running on a live site, so I labeled it a BETA just for the heck of it. I'm not sure how much time I can dedicate to working on this for suggestions, etc., but feel free to offer any suggestions or tweaks if you spot anything off--such as not conforming to phpbb standards, etc. I've written quite a few phpbb MODs in the past but never posted one before for lack-of-time.

Kevin
Last edited by calamus77 on Wed Dec 27, 2006 7:30 pm, edited 8 times in total.

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Post by Elias » Thu Oct 19, 2006 12:17 am

Would be nice if an admin can modify the the how many times that user has to have posted before being able to post URLs.
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

Caitlain
Registered User
Posts: 27
Joined: Tue Aug 29, 2006 2:31 am
Location: Fort Lauderdale, FL

Post by Caitlain » Thu Oct 19, 2006 1:30 am

Very nice.
~Caitlain

calamus77
Registered User
Posts: 60
Joined: Wed Oct 18, 2006 11:32 pm
Location: Idaho, U.S.
Contact:

Post by calamus77 » Thu Oct 19, 2006 2:57 am

Hey EY,

Yep, being able to change values in the admin configuration make sense for anyone who's not a programmer (sometimes I forget about that). So, I have added a link to the revised version 0.0.2 at the top, which allows the admin to modify the settings.

Thanks,

Kevin

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Post by Elias » Thu Oct 19, 2006 3:04 am

Hey calamus77,

Nice MOD.
Thanks for adding that feature. Very nice MOD and great Job.

Thanks
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

calamus77
Registered User
Posts: 60
Joined: Wed Oct 18, 2006 11:32 pm
Location: Idaho, U.S.
Contact:

Post by calamus77 » Tue Oct 31, 2006 6:56 pm

Changed to RC1 because I've submitted it to the MOD Team, but it is not approved yet so I don't want to change it to MODDB and get it locked...hope I'm doing that right :roll: ...if not, let me know and I'll change ASAP.

On a side note (though, go figure I'd think of this AFTER I submitted it), I just modified the code I'm running on the live site using this code so that it e-mails me everytime a new user attempts to post URLs, and it sends their post as well. This way, when I find a bot, I can go and delete their account and add their domain name to my ban list (e.g. *@theirdomain.com), because all the bots that I've had, anyway, use their own domain names and not stuff like "yahoo.com" that a lot of valid users have since the bot needs to be able to check via POP, etc.

So, anyway, I was thinking that I need one more admin configurable variable:

Code: Select all

E-mail Admin(s) when a blocked registered user tries to post URL? Yes/No
This will allow you to get the username of anyone trying to post a URL so that the user can be deleted and their domain name put on the ban-list if desired.

Kevin

abumslife
Registered User
Posts: 192
Joined: Thu Apr 10, 2003 8:26 pm

Post by abumslife » Wed Nov 01, 2006 3:05 pm

how about X amount of posts before they can put a URL in their profile as well?

calamus77
Registered User
Posts: 60
Joined: Wed Oct 18, 2006 11:32 pm
Location: Idaho, U.S.
Contact:

Post by calamus77 » Wed Nov 01, 2006 3:29 pm

Yeah, that's a good idea...I actually modified that on my site before I ever got around to doing this mod, so it was unnecessary. Though, on my site, if they post a website to their profile, they don't show up on the memberlist or on the "newest member" part of the homepage until they start posting. So, they can put their website address in their profile, but nobody will ever see it if they aren't an active member. This was partly from bots, but also from other people with less active forums trying to get additional traffic to their forums without ever becoming an active member of the one I manage.

However, tying the two together could be good...just apply the exact same requirement on their profile that I apply to posts. Though, I found that when people can't post their website URL, they often do it in the MSN Messenger elements and other places. So, the best thing to do there would be to make sure all of the instant message elements match a valid regular expression as well. I know MSN uses an e-mail...anybody know the requirements of all of the other IM apps (e.g. what characters are allowed in an AIM username? Is ICQ just numbers? etc.)?

Kevin

dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz » Wed Nov 01, 2006 10:34 pm

Interesting and useful, thank you :D

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS

User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee » Thu Nov 02, 2006 11:35 pm

abumslife wrote: how about X amount of posts before they can put a URL in their profile as well?


Hello,

this mod does already exist:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#

$error = FALSE;


#
#-----[ AFTER, ADD ]------------------------------------------
#

$cut_off=10; //how many posts should user have before form fields are activated

// ---------------------------------------
if (($mode == 'register' && ($HTTP_POST_VARS['website'] != '' || $HTTP_POST_VARS['signature'] != '') ) || ($userdata['user_posts'] < $cut_off && $mode=='editprofile' && ($HTTP_POST_VARS['website'] != '' || $HTTP_POST_VARS['signature'] != '')))
{
   message_die(GENERAL_MESSAGE, "You cannot use the fields signature and website before you have posted $cut_off messages.", '', __LINE__, __FILE__);
}

#
#-----[ FIND ]------------------------------------------
#
if ( $mode == 'editprofile' )
   {
      $template->assign_block_vars('switch_edit_profile', array());
   }

#
#-----[ REPLACE WITH ]------------------------------------------
#

if ( $mode == 'editprofile' )
   {
      $template->assign_block_vars('switch_edit_profile', array());
      if ($userdata['user_posts'] >= $cut_off)
      {
      $template->assign_block_vars('switch_edit_website', array());
      }
   }

#
#-----[ OPEN ]------------------------------------------
#

/templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<tr>
     <td class="row1"><span class="gen">{L_WEBSITE}:</span></td>
     <td class="row2">
      <input type="text" class="post"style="width: 200px"  name="website" size="25" maxlength="255" value="{WEBSITE}" />
     </td>
   </tr>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_edit_website -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- END switch_edit_website -->


#
#-----[ FIND ]------------------------------------------
#

   <tr>
     <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2">
      <textarea name="signature"style="width: 300px"  rows="6" cols="30" class="post">{SIGNATURE}</textarea>
     </td>
   </tr>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_edit_website -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- END switch_edit_website -->
This is a variation of the following mod:

http://www.phpbb.com/phpBB/viewtopic.php?t=186683

Please don´t forget to look here, too:

http://www.phpbb.com/phpBB/viewtopic.php?t=396855

@calamus77: Your mod is a very nice idea - thank you! :P

Regards
Wolfgang

calamus77
Registered User
Posts: 60
Joined: Wed Oct 18, 2006 11:32 pm
Location: Idaho, U.S.
Contact:

Post by calamus77 » Sat Nov 04, 2006 1:32 am

CODE UPDATED (see original post):

Added an admin configuration so that the admin can add an e-mail address that a report will be sent to when a new user attempts to submit a URL. If the admin leaves it blank, then no report will be sent.

Added some code to the profile that requires the same X days and Y posts before allowing the user to enter any personal profile fields.

Rolled it back to a BETA since it hasn't been tested much yet...but wasn't sure if I should start a new thread since 1.0.0 was submitted to the MOD team, or roll back the version number to 0.0.3 and see if there's some way to scrap my submission...? Again, if I've not followed any of the rules, just let me know :)

Kevin

womblewilly
Registered User
Posts: 3
Joined: Sat Nov 04, 2006 1:28 pm

Post by womblewilly » Sat Nov 04, 2006 5:24 pm

Great Mod - I was trying to do something similar but less sophisticated here: http://www.phpbb.com/phpBB/viewtopic.php?t=466902

However, you should change the title so that it's clear that this is an anti-spam Mod, because I was looking hard for something like this it didn't seem to show up on the "spam" keyword when I searched.

User avatar
TheMistress
Registered User
Posts: 69
Joined: Wed Dec 15, 2004 12:49 am
Location: London, UK
Contact:

Post by TheMistress » Fri Dec 01, 2006 3:01 pm

Great MOD, easy to install, and so far had stopped posting of spam on my board. I have noticed however, that URLs/Images can be posted through the signature field.

Is there a way to apply the 'Active' check to the signature field too?

Thanks,
Yael (TheMistress)
"Share your knowledge. It's a way to achieve immortality." -- Dalai Lama

User avatar
TheMistress
Registered User
Posts: 69
Joined: Wed Dec 15, 2004 12:49 am
Location: London, UK
Contact:

Oops

Post by TheMistress » Fri Dec 01, 2006 3:10 pm

Just noticed the threads answering my question... :)

Cheers,
Yael (TheMistress)
"Share your knowledge. It's a way to achieve immortality." -- Dalai Lama

Kirsty2
Registered User
Posts: 320
Joined: Wed Jun 14, 2006 4:08 am

Post by Kirsty2 » Sat Dec 02, 2006 8:10 am

Thanks i'll give it a go, i've been looking for something like this!

Post Reply

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