Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Prevent Users With Low Post Counts Posting/PM'ing URLS Details »»
Prevent Users With Low Post Counts Posting/PM'ing URLS
Version: 1.00, by NTLDR (Coder) NTLDR is offline
Developer Last Online: Oct 2004 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-10-2004 Last Update: Never Installs: 62
 
No support by the author.

Title: Prevent members with low post count posting/pm'ing urls.
Author: NTLDR
Version: 1.0.1
vB Compatibility: vB3 Gamma, RC1, RC2

Description: I created this hack a while ago for use on my board to prevent people signing up and just posting a URL. This hack will prevent users with less than X posts from PM'ing or posting URLs.

File edits:

In includes/functions_newpost.php find:

PHP Code:
        eval('$errors[] = "' fetch_phrase('toomanyimages'PHRASETYPEID_ERROR) . '";');
    } 
Add after:

PHP Code:
$errors array_merge($errorsverify_message_urls($post['message'])); 
Find:

PHP Code:
    return sizeof($errors);

Add after (making sure you change REPLACE_NUMBER_OF_POSTS_HERE to the number of posts a user must have before being able to post/pm URLS):

PHP Code:
function verify_message_urls($pagetext) {

    global 
$vboptions$vbphrase$bbuserinfo;

    
$errors = array();

    if (
$bbuserinfo['posts'] < REPLACE_NUMBER_OF_POSTS_HERE) {
        if (
THIS_SCRIPT == 'newthread' || THIS_SCRIPT == 'newreply' || THIS_SCRIPT == 'editpost') {
            
$typephrase $vbphrase['post'];
        } elseif (
THIS_SCRIPT == 'private') {
            
$typephrase $vbphrase['private_message'];
        } else {
            
$typephrase $vbphrase['message'];
        }

        if (
preg_match('/\[url/i'$pagetext)) {
            eval(
'$errors[] = "' fetch_phrase('x_contains_urls'PHRASETYPEID_ERROR) . '";');
            
$errored true;
        }

        
$pagetext strip_bbcode($pagetext);

        if (!
$errored && preg_match('/h(\s*)t(\s*)t(\s*)p/i'$pagetext)) {
            eval(
'$errors[] = "' fetch_phrase('x_contains_urls'PHRASETYPEID_ERROR) . '";');
            
$errored true;
        }

        if (!
$errored && preg_match('/w(\s*)w(\s*)w/i'$pagetext)) {
            eval(
'$errors[] = "' fetch_phrase('x_contains_urls'PHRASETYPEID_ERROR) . '";');
            
$errored true;
        }

        if (!
$errored && preg_match('/(\w*)(\s*)(\.|dot)(\s*)(c(\s*)o(\s*)m|c(\s*)o(\s*)(\.|dot)(\s*)u(\s*)k|n(\s*)e(\s*)t|o(\s*)r(\s*)g)/i'$pagetext)) {
            eval(
'$errors[] = "' fetch_phrase('x_contains_urls'PHRASETYPEID_ERROR) . '";');
            
$errored true;
        }
    }

    return 
$errors;

If you want this to apply to posts only you don't need to do the following edit which is for PM's:

In private.php find:

PHP Code:
        // process errors if there are any
        
if (!empty($errors)) 
Add BEFORE:

PHP Code:
$errors array_merge($errorsverify_message_urls($pm['message'])); 
Phrases to add:

In Front-End Error Messages add:
Varname: x_contains_urls
Text:
Code:
Your $typephrase contains one or more URLs, please remove them before submitting your message again.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 09-17-2004, 09:54 AM
Noiz Pollution Noiz Pollution is offline
 
Join Date: Jun 2003
Location: Glasgow, UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mefromspace
I think this hack is great to prevent spammers.

Now my question is if its possible to do this for attachments too.

I hate it when people register and in ther first post they post pictures
from other sites together with ther site link.

It would be awsome if it was possible!!!
Just use the promotion system, create a new user group with everything you want your fully registered members to be able to do, then change the default registered group by giving it much more restricted access (like the inability to post or view attachements) and use a promotion to upgrade them to your new user group once they hit a certain number of posts.


Cheers,
Robert
Reply With Quote
  #53  
Old 01-19-2005, 04:47 AM
Neutral Singh's Avatar
Neutral Singh Neutral Singh is offline
 
Join Date: Sep 2004
Location: Sikh Philosophy Network
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

** installed **
Reply With Quote
  #54  
Old 02-10-2005, 03:24 PM
cteselle cteselle is offline
 
Join Date: Jan 2002
Location: SoCal
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Works like a charm!
Reply With Quote
  #55  
Old 02-22-2005, 06:21 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello...

I just had someone report they could not post the below for they received the messages about no URL....

Quote:
Here's something I am considering. I would greatly appreciate any feedback or correction to my ideas.


I understand how the LNBs work with voltage switching for the polarization and the 22KHz signal for the 199 SAT, but I am determined to find a way to not have to run more than 2 coax lines (which I have now) down from my dishes (because of line of site problems I have multiple dishes for different SATs). The LNBS from the dishes currently all run into one multi-switch on the back of one of the dishes, then 2 coax lines run into the house. I recently got a DirecTiVo and now need three lines to take advantage of the dual input TiVo.


Here is what I am thinking of trying. Combining the LNBs using splitters with the 13V lines combined and the 18V lines combined. On the 119 lines put 22KHz generaters to keep them turned on. My understanding is that there is no overlap in the frequency spectrums being output by the different mode LNBs (obviously if there is overlap I can't do this).


So now I have two coax down lines into the house, but here is where I am less certain about what to do. Can I just run the two lines into the SAT A inputs of a multi-switch? Will the SAT A input pass all the frequencies from all the LNBs to the receivers even though it won't pass back the 22KHz tone? If not I will have to split those two lines into 4 and run them into the SAT A and SAT B inputs of the multi-switch, but then I have to find some way to block the 22KHz tone from being sent back to all of the LNBs.


I might also have to put an amplifier in somewhere in the downlines because of the combining and possible splitting losses. Maybe there is an amplifier that will pass back the DC without passing back the 22KHz tone.


Comments please.
I for the life of me can not figure out what it may be seeing in the above to think their is a URL somewhere.

Any help wpuld be great.

Thanks
Reply With Quote
  #56  
Old 03-14-2005, 12:12 PM
Michael2's Avatar
Michael2 Michael2 is offline
 
Join Date: Nov 2001
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to give this one a whirl, thanks!
Reply With Quote
  #57  
Old 03-14-2005, 12:48 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have now had four other users say that can not post a message because it contained a URL and I can not see what in the text is stopping them. Anyone? See above example of a stopped post.
Reply With Quote
  #58  
Old 03-14-2005, 01:40 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No offese but I dont install stuff from NTLDR. This user drops stuff and disapears and never ever supports it afterwards. (not like the user has too) just look around. vbindex ect...

Nah no thanks. Save yourself the head ache.
Reply With Quote
  #59  
Old 03-19-2005, 06:47 PM
cellardoor cellardoor is offline
 
Join Date: Oct 2004
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by David Bott
I for the life of me can not figure out what it may be seeing in the above to think their is a URL somewhere.

Is it this bit...

Quote:
I am thinking of trying. Combining the LNBs using splitters
Looks like .com
Reply With Quote
  #60  
Old 03-26-2005, 02:44 AM
dtzy dtzy is offline
 
Join Date: Feb 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Theater
I tested this out on 3.0.3, and it worked partly. I wasn't able to post a URL with under 10 posts, but was able to private message myself. I had my board shutoff for maintenance, and the TestDummy account was a moderator of a test forum. Maybe that had something to do with it, I'll test it out later.

Just to confirm, this is all that's needed to require registered members to have 10 posts before they can send PM's:

Code:
----------------------------------------
Find:
----------------------------------------

// process errors if there are any 
        if (!empty($errors)) 


----------------------------------------
Add BEFORE:
----------------------------------------

$errors = array_merge($errors, verify_message_urls($pm['message']));

You may have added the call to the function ( $errors = array_merge($errors, verify_message_urls($post['message'])); //SN add
) in wrong place, I didn' get it work, but later, I found my mistake. It works like a charm now, thanks to hack provider.
Reply With Quote
  #61  
Old 03-30-2005, 02:44 PM
subnet_rx subnet_rx is offline
 
Join Date: Mar 2005
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know of a hack that will allow certain usergroups to post URL's and images only? I wish this was in the usergroup permissions for the forum.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08227 seconds
  • Memory Usage 2,342KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (6)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete