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

phpBB 2.0.x sürümleri için geliştirilen ve yapım aşamasındaki Alpha, Beta MODlar & PreMODlar.
Kilitli
Kullanıcı avatarı
pikachu
Kayıtlı Kullanıcı
Mesajlar: 3062
Kayıt: 16.07.2006, 15:32
Konum: ağandon /
İletişim:

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

Mesaj gönderen pikachu »

baştan belirtelim mod beta aşamasında.
bu modla admin panelinden ayarlamak suretiyle kaç günlük kullanıcılar yada kaç mesajı olanın mesajlarında url gönderebileceğini ayarlayabiliyorsunuz, yani yeni bir üye veya mesaj atmamaış bir üye(spamsa) bir sitenin reklamını link vererek yapamayacak. ayrıca bu normal kullanıcılarıda mesaj yazmaya itecek gibi. :D

Kod: Tümünü seç

############################################################## 
## 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_english/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
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ 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');
# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
# 
<?php
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : Active-Member-URLs-Only -----------------------------------------

# 
#-----[ FIND ]------------------------------------------ 
# 
?>
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
//-- 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.<br /><br />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 -------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
# 
<?php
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : Active-Member-URLs-Only -----------------------------------------

# 
#-----[ FIND ]------------------------------------------ 
# 
?>
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
//-- 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 -------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
posting.php

# 
#-----[ FIND ]------------------------------------------ 
# 
<?php
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : Active-Member-URLs-Only -----------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
# 
//
// End session management
//
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : Active-Member-URLs-Only -----------------------------------------
//-- add
if( $submit && (($userdata['user_regdate']+intval($board_config['url_post_days'])*86400) >= 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 -------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
includes/usercp_register.php

# 
#-----[ FIND ]------------------------------------------ 
# 
<?php
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : Active-Member-URLs-Only -----------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
# 
$error = FALSE;
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

//-- mod : Active-Member-URLs-Only -----------------------------------------
//-- add
$url_not_allowed        = $board_config['url_post_profile']=="0" && ( $mode == 'register' || $userdata['user_id']==ANONYMOUS || $userdata['user_posts'] <= intval($board_config['url_post_posts']) || ($userdata['user_regdate']+intval($board_config['url_post_days'])*86400) >= 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 -------------------------------------

# 
#-----[ FIND ]------------------------------------------ 
# 
    else
    {
        $template->assign_block_vars('switch_namechange_disallowed', array());
    }
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- 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 -------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
admin/admin_board.php

# 
#-----[ FIND ]------------------------------------------ 
# 
<?php
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : Active-Member-URLs-Only -----------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
# 
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

//-- mod : Active-Member-URLs-Only -----------------------------------------
//-- add
$url_post_profile_yes	= ( $new['url_post_profile']  ) ? " checked=\"checked\"" : "";
$url_post_profile_no	= ( !$new['url_post_profile'] ) ? " checked=\"checked\"" : "";
//-- fin mod : Active-Member-URLs-Only -------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
# 
    "S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
//-- 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 -------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/admin/board_config_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
<h1>{L_CONFIGURATION_TITLE}</h1>
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
<!-- mod : Active-Member-URLs-Only ----------------------------------------- -->

# 
#-----[ FIND ]------------------------------------------ 
# 
    <tr>
        <td class="row1">{L_SMTP_PASSWORD}<br /><span class="gensmall">{L_SMTP_PASSWORD_EXPLAIN}</span></td>
        <td class="row2"><input class="post" type="password" name="smtp_password" value="{SMTP_PASSWORD}" size="25" maxlength="255" /></td>
    </tr>
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<!-- mod : Active-Member-URLs-Only ----------------------------------------- -->
<!-- add -->
    <tr>
      <th class="thHead" colspan="2">{L_URL_POST_SETTINGS}</th>
    </tr>
    <tr>
        <td class="row1">{L_URL_POST_DAYS}<br /><span class="gensmall">{L_URL_POST_DAYS_EXPLAIN}</span></td>
        <td class="row2"><input class="post" type="text" name="url_post_days" value="{URL_POST_DAYS}" size="25" maxlength="5" /></td>
    </tr>
    <tr>
        <td class="row1">{L_URL_POST_POSTS}<br /><span class="gensmall">{L_URL_POST_POSTS_EXPLAIN}</span></td>
        <td class="row2"><input class="post" type="text" name="url_post_posts" value="{URL_POST_POSTS}" size="25" maxlength="5" /></td>
    </tr>
    <tr>
        <td class="row1">{L_URL_POST_EMAIL}<br /><span class="gensmall">{L_URL_POST_EMAIL_EXPLAIN}</span></td>
        <td class="row2"><input class="post" type="text" name="url_post_email" value="{URL_POST_EMAIL}" size="25" maxlength="64" /></td>
    </tr>
	<tr>
		<td class="row1">{L_URL_POST_PROFILE}<br /><span class="gensmall">{L_URL_POST_PROFILE_EXPLAIN}</span></td>
		<td class="row2"><input type="radio" name="url_post_profile" value="1" {S_URL_POST_PROFILE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="url_post_profile" value="0" {S_URL_POST_PROFILE_NO} /> {L_NO}</td>
	</tr>
<!-- fin mod : Active-Member-URLs-Only ------------------------------------- -->
# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/profile_add_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
<form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post">
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
<!-- mod : Active-Member-URLs-Only ----------------------------------------- -->

# 
#-----[ FIND ]------------------------------------------ 
# 
    <tr> 
      <td class="catSides" colspan="2" height="28">&nbsp;</td>
    </tr>
    <tr> 
      <th class="thSides" colspan="2" height="25" valign="middle">{L_PROFILE_INFO}</th>
    </tr>
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<!-- mod : Active-Member-URLs-Only ----------------------------------------- -->
<!-- add -->
    <!-- BEGIN switch_disallow_url -->
    <tr> 
      <td class="row2" colspan="2" style='padding:30px 30px 30px 30px;'><span class="gensmall">{switch_disallow_url.L_URL_NOT_ALLOWED}</span></td>
    </tr>
    <!-- END switch_disallow_url -->
    <!-- BEGIN switch_allow_url -->
<!-- fin mod : Active-Member-URLs-Only ------------------------------------- -->
# 
#-----[ 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>
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<!-- mod : Active-Member-URLs-Only ----------------------------------------- -->
<!-- add -->
    <!-- END switch_allow_url -->
<!-- fin mod : Active-Member-URLs-Only ------------------------------------- -->
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
En son pikachu tarafından 05.02.2007, 01:28 tarihinde düzenlendi, toplamda 2 kere düzenlendi.
Kullanıcı avatarı
Mirach
Destek Ekibi Lideri
Destek Ekibi Lideri
Mesajlar: 1664
Kayıt: 27.03.2006, 01:06
Konum: İstanbul

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

Mesaj gönderen Mirach »

pikachu yazdı:baştan belirtelim mod beta aşamasında.
o halde [MOD] tagını [BETA] olarak düzeltiniz..
Profilinde phpBB forumunun adresini girmemiş üyelere ve kurallara aykırı şekilde açılmış başlıklara destek verilmez.
Resim Resim Resim
Kullanıcı avatarı
pikachu
Kayıtlı Kullanıcı
Mesajlar: 3062
Kayıt: 16.07.2006, 15:32
Konum: ağandon /
İletişim:

Mesaj gönderen pikachu »

yapım aşamasındaki modlar bölümü olduğu için gerek duymamıştım ama düzelttim sağol..
Kullanıcı avatarı
radyobulut
Kayıtlı Kullanıcı
Mesajlar: 486
Kayıt: 18.07.2007, 08:55
Konum: İstanbul
İletişim:

Mesaj gönderen radyobulut »


bunu kullanacağım..

Beta olduğu için soruyum dedim:

Bi sorunu veya yeni sürümü filan var mı??
chnnmhyt
Kayıtlı Kullanıcı
Mesajlar: 45
Kayıt: 13.02.2008, 23:56
Konum: antalya
İletişim:

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

Mesaj gönderen chnnmhyt »

peki kullanıcılar sadece aktif linkmi gönderemiyolar yoksa

Kod: Tümünü seç

 içine alınca yinemi gönderemiyorlar
Metal Müzik - Kültür Sanat Paylaşım Platformu
http://www.cehennemhayat.org
Kilitli

“2.0.x PreMODlar & Yapım aşamasındaki MODlar” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Hiç bir kayıtlı kullanıcı yok ve 6 misafir