############################################################## ## MOD Title: Anti-Spam: Only Active Members Can Post URLs ## MOD Author: Kevin Nelson < N/A > (Flashfire Designs) http://www.flashfiredesigns.com/ ## 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 Version: 1.0.2 ## ## Installation Level: Easy ## Installation Time: ~10 Minutes ## Files To Edit: ## language/lang_english/lang_main.php ## language/lang_spanish/lang_main.php ## language/lang_english/lang_admin.php ## language/lang_spanish/lang_admin.php ## posting.php ## includes/usercp_register.php ## admin/admin_board.php ## templates/subSilver/admin/board_config_body.tpl ## templates/subSilver/profile_add_body.tpl ## Included Files: ## N/A ## ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ############################################################## ## For security purposes, please check: http://www.phpbb.com/mods/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://www.phpbb.com/mods/ ############################################################## ## Author Notes: ## ## Very simply, you can require that a poster be a member of ## the site for a certain number of days and/or require them ## to have a certain number of posts already before allowing ## them to post URLs to the site. This should help reduce ## links being posted by spambots, since they will have to ## wait days or post posts with no links in them before they ## will be able to post any links. ## ## The code checks to see if the user has past the "trial ## period" of days and posts. If they do not, then it does ## a regular expression check to see if certain strings are ## in the text. The code is currently setup to block the ## following strings: ## "url", "http", "www", ".com", ".us", ".net", ".biz" ## ".info", ".org", ".ru", and ".su" ## ## So, sitename.com and [url]mysite[/url] will both fail. ## ## As of version 1.0.1, there is some code that blocks the ## user from being able to post data to the personal profile ## fields, which can be turned on/off in the admin as of ## version 1.0.2. I would be remiss to not point out the fact ## that since someone had already done something along those ## lines, I took a look at their code to see placement, etc., ## which saved me some work even though my code had to be wholly ## different to account for my configurable admin settings, ## etc. Anyway, the MOD can be found at: ## ## http://www.phpbb.com/phpBB/viewtopic.php?t=186683 ## MOD Title: Instant Ban - Spam Bots registration ## MOD Author: niekas ## MOD Description: prevents spam bots registering on your forum by ## removing website and signature fields in registration and ## profile form untill users reached certain amount of posts ## ## Also, thanks to woofmang for pointing out that my regular ## expression was case-sensitive and allowing things such as: ## hTtp://wWw.site.Com. ## ############################################################## ## Upgrade Notes: ## ## For the most part, to upgrade just go back through each ## modification and overwrite any sections that already ## exist, and add any sections that don't. It should be as ## simple as that. Since version 1.0.0 there are also two ## new SQL inserts into the config database ## ############################################################## ## Author Notes: ## MOD History: ## ## 2006-12-27 - Version 1.0.2 ## - Gave the admin the ability to toggle whether they want ## users to be able to post profile information even before ## they meet the days/posts requirements. ## - change "www" block to "\bwww\." and "url" block to "\burl\b" ## so that "ewww" and "curl" won't get blocked... ## 2006-12-11 - Version 1.0.1 ## - MOD Team fixed the SQL on the released Version 1.0.0 ## to remove multi-line SQL INSERT, which was only ## compatible with MySQL. So, I made the same change ## here. ## 2006-11-03 - Version 1.0.1 ## - Added "Report" E-mail setting so that the admin can ## receive an e-mail showing what was posted and who ## posted it, which will flag the admin for bots. ## - Added registration code that will keep users from ## being able to put anything into the personal info ## fields of their profile until they become active ## members ## 2006-10-30 - Version 1.0.0 ## - Submitted for release ## 2006-10-19 - Version 0.0.2 ## - Just added more "Author Notes" above ## 2006-10-18 - Version 0.0.2 ## - Added ability for admin to modify configuration for ## days from registration and number of posts required ## before URL postings are allowed ## ############################################################## ## Antes de añadir este MOD a tus foros, haz una copia de seguridad de los archivos implicados ############################################################## # #-----[ SQL ]------------------------------------------ # INSERT INTO phpbb_config (config_name, config_value) VALUES ('url_post_days', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('url_post_posts', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('url_post_email', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('url_post_profile', '0'); # #-----[ ABRIR ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ LOCALIZAR ]------------------------------------------ # # #-----[ ANTES, AÑADIR ]------------------------------------------ # //-- mod : Active-Member-URLs-Only ----------------------------------------- //-- add $lang['url_active_only_message'] = "In order to try to prevent spammers, we do not allow our users to post URLs or enter personal data into their profile until they have posted at least %d legitimate posts and have been with us for more than %d days. We appreciate your understanding in this matter in order to help us eliminate spam from this forum. If you have somehow gotten this message even though you meet both of the criteria, please let us know ASAP.

Thanks!"; $lang['url_active_only_email'] = "The following message was attempted by %s. If it appears to be spam, login to your admin area and delete the user--you may also wish to BAN their e-mail address domain if it is not a common domain in the format '%s':\r\n\r\n-------\r\nPOST\r\n-------\r\n%s"; //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # language/lang_spanish/lang_main.php # #-----[ LOCALIZAR ]------------------------------------------ # # #-----[ ANTES, AÑADIR ]------------------------------------------ # //-- mod : Active-Member-URLs-Only ----------------------------------------- //-- add $lang['url_active_only_message'] = "Con el fin de prevenir la acción de spammers, no se permite a los usuarios incluir URLs en los mensajes o introducir datos personales en su perfil hasta que hayan escrito un mínimo de %d mensajes legales y lleven registrados más de %d días. Espero que entiendas esta medida. Su fin es eliminar los mensajes basura (spam) de los foros.

Gracias"; $lang['url_active_only_email'] = "El mensaje siguiente fue enviado por %s. Si lo consideras como spam, entra en tu área de administrador y borra al usuario -- puedes banear la dirección de email si no es un dominio normal en el formato '%s':\r\n\r\n-------\r\nPOST\r\n-------\r\n%s"; //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # language/lang_english/lang_admin.php # #-----[ LOCALIZAR ]------------------------------------------ # # #-----[ ANTES, AÑADIR ]------------------------------------------ # //-- mod : Active-Member-URLs-Only ----------------------------------------- //-- add $lang['url_post_settings'] = "URL Posting Settings"; $lang['url_post_days'] = "Required Days of Membership"; $lang['url_post_days_explain'] = "Number of days a user must be a member before they can post URLs"; $lang['url_post_posts'] = "Required Number of Posts"; $lang['url_post_posts_explain'] = "Number of times a user must post (without URLs) before URLs are allowed"; $lang['url_post_email'] = "Report Attempts to E-mail"; $lang['url_post_email_explain'] = "Leave blank if you don't wish to receive e-mail reports"; $lang['url_post_profile'] = "Allow Profile Field Entries?"; $lang['url_post_profile_explain'] = "If 'Yes' user will be able to enter profile signature, msn, etc., before days/posts requirement is met, which may include spam links"; //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # language/lang_spanish/lang_admin.php # #-----[ LOCALIZAR ]------------------------------------------ # # #-----[ ANTES, AÑADIR ]------------------------------------------ # //-- mod : Active-Member-URLs-Only ----------------------------------------- //-- add $lang['url_post_settings'] = "Configuraciones de URL en Mensajes"; $lang['url_post_days'] = "Días requeridos para membresía"; $lang['url_post_days_explain'] = "Número de días que han de transcurrir antes de que un miembro pueda postear URLs"; $lang['url_post_posts'] = "Número de mensajes requeridos"; $lang['url_post_posts_explain'] = "Número de veces que un usuario ha de escribir mensajes sin URLs antes de que se le permita escribirlas"; $lang['url_post_email'] = "Informe de intentos de email"; $lang['url_post_email_explain'] = "Dejar en blanco si no quieres recibir informes de email"; $lang['url_post_profile'] = "¿Permitir entradas en campos de Perfil?"; $lang['url_post_profile_explain'] = "Si se permite o no incluir los datos en el Perfil correspondientes a la firma, MSN... antes de que finalice el plazo (días/mensajes) para insertar URLs en los mensajes"; //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # posting.php # #-----[ LOCALIZAR ]------------------------------------------ # = time() || $userdata['user_posts'] <= intval($board_config['url_post_posts']) || $userdata['user_id']==ANONYMOUS) ) { if( preg_match("/(\burl\b|http|\bwww\.|\.(com|us|net|biz|info|org|ru|su)\b)/i",$HTTP_POST_VARS['message']) ) { if( $userdata['user_id']!=ANONYMOUS && preg_match("/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.[\w-]{1,6}$/",$board_config['url_post_email']) ) { $url_post_message = sprintf($lang['url_active_only_email'],$userdata['username'],preg_replace("/^[^\@]+@/","*@",$userdata['user_email']),$HTTP_POST_VARS['message']); mail($board_config['url_post_email'],"[{$userdata['username']}]: Attempted Forum URL Post",$url_post_message,"From: {$board_config['board_email']}\n"); unset($url_post_message); } message_die(GENERAL_ERROR, sprintf($lang['url_active_only_message'],intval($board_config['url_post_posts']),intval($board_config['url_post_days']))); } } //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # includes/usercp_register.php # #-----[ LOCALIZAR ]------------------------------------------ # = time() ); $url_not_allowed_msg = sprintf($lang['url_active_only_message'],intval($board_config['url_post_posts']),intval($board_config['url_post_days'])); $posted_url_fields = !empty($HTTP_POST_VARS['icq']) || !empty($HTTP_POST_VARS['aim']) || !empty($HTTP_POST_VARS['msn']) || !empty($HTTP_POST_VARS['yim']) || !empty($HTTP_POST_VARS['website']) || !empty($HTTP_POST_VARS['location']) || !empty($HTTP_POST_VARS['occupation']) || !empty($HTTP_POST_VARS['interests']) || !empty($HTTP_POST_VARS['signature']); // --------------------------------------- if( $url_not_allowed && $posted_url_fields ) { message_die(GENERAL_ERROR, $url_not_allowed_msg); } //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ LOCALIZAR ]------------------------------------------ # else { $template->assign_block_vars('switch_namechange_disallowed', array()); } # #-----[ DESPUÉS, AÑADIR ]------------------------------------------ # //-- mod : Active-Member-URLs-Only ----------------------------------------- //-- add if( $url_not_allowed ) { $template->assign_block_vars('switch_disallow_url', array( "L_URL_NOT_ALLOWED" => $url_not_allowed_msg ) ); } else { $template->assign_block_vars('switch_allow_url', array()); } //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # admin/admin_board.php # #-----[ LOCALIZAR ]------------------------------------------ # append_sid("admin_board.$phpEx"), # #-----[ ANTES, AÑADIR ]------------------------------------------ # //-- mod : Active-Member-URLs-Only ----------------------------------------- //-- add "L_URL_POST_SETTINGS" => $lang['url_post_settings'], "L_URL_POST_DAYS" => $lang['url_post_days'], "L_URL_POST_DAYS_EXPLAIN" => $lang['url_post_days_explain'], "URL_POST_DAYS" => $new['url_post_days'], "L_URL_POST_POSTS" => $lang['url_post_posts'], "L_URL_POST_POSTS_EXPLAIN" => $lang['url_post_posts_explain'], "URL_POST_POSTS" => $new['url_post_posts'], "L_URL_POST_EMAIL" => $lang['url_post_email'], "L_URL_POST_EMAIL_EXPLAIN" => $lang['url_post_email_explain'], "URL_POST_EMAIL" => $new['url_post_email'], "L_URL_POST_PROFILE" => $lang['url_post_profile'], "L_URL_POST_PROFILE_EXPLAIN" => $lang['url_post_profile_explain'], "S_URL_POST_PROFILE_YES" => $url_post_profile_yes, "S_URL_POST_PROFILE_NO" => $url_post_profile_no, //-- fin mod : Active-Member-URLs-Only ------------------------------------- # #-----[ ABRIR ]------------------------------------------ # templates/subSilver/admin/board_config_body.tpl # #-----[ LOCALIZAR ]------------------------------------------ #

{L_CONFIGURATION_TITLE}

# #-----[ ANTES, AÑADIR ]------------------------------------------ # # #-----[ LOCALIZAR ]------------------------------------------ # {L_SMTP_PASSWORD}
{L_SMTP_PASSWORD_EXPLAIN} # #-----[ DESPUÉS, AÑADIR ]------------------------------------------ # {L_URL_POST_SETTINGS} {L_URL_POST_DAYS}
{L_URL_POST_DAYS_EXPLAIN} {L_URL_POST_POSTS}
{L_URL_POST_POSTS_EXPLAIN} {L_URL_POST_EMAIL}
{L_URL_POST_EMAIL_EXPLAIN} {L_URL_POST_PROFILE}
{L_URL_POST_PROFILE_EXPLAIN} {L_YES}   {L_NO} # #-----[ ABRIR ]------------------------------------------ # templates/subSilver/profile_add_body.tpl # #-----[ LOCALIZAR ]------------------------------------------ #
# #-----[ ANTES, AÑADIR ]------------------------------------------ # # #-----[ LOCALIZAR ]------------------------------------------ #   {L_PROFILE_INFO} # #-----[ DESPUÉS, AÑADIR ]------------------------------------------ # {switch_disallow_url.L_URL_NOT_ALLOWED} # #-----[ LOCALIZAR ]------------------------------------------ # {L_SIGNATURE}:
{L_SIGNATURE_EXPLAIN}

{HTML_STATUS}
{BBCODE_STATUS}
{SMILIES_STATUS}
# #-----[ DESPUÉS, AÑADIR ]------------------------------------------ # # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM