vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Rule to prevent users with less than X posts to post URLs (https://vborg.vbsupport.ru/showthread.php?t=298100)

MaXimus 05-13-2013 10:50 AM

Rule to prevent users with less than X posts to post URLs
 
I have vBulletin 3.8.7

how can I create a rule that only members with above 30 posts may post links?

I don't want knew people to register just to post spammy links

nerbert 05-13-2013 11:23 AM

Give this plugin a try:

Product: vBulletn

Hook Location: postbit_display_complete

PHP Code:

if($post['posts'] < 30)
{
    
$post['message'] = preg_replace("/\[url[\s\S]*?\/url\]/i""LINK REMOVED"$post['message']);


It should remove any links if post count is less than 30


EDIT: This won't display properly in the php code box. It breaks to a new line after "?". Just be sure when you copy it to the admin CP there is no line break there and no spaces

MaXimus 05-13-2013 06:13 PM

Quote:

Originally Posted by nerbert (Post 2421716)
Give this plugin a try:

Product: vBulletn

Hook Location: postbit_display_complete

PHP Code:

if($post['posts'] < 30)
{
    
$post['message'] = preg_replace("/\[url[\s\S]*?\/url\]/i""LINK REMOVED"$post['message']);


It should remove any links if post count is less than 30


EDIT: This won't display properly in the php code box. It breaks to a new line after "?". Just be sure when you copy it to the admin CP there is no line break there and no spaces

can u give me step by step instructions where to paste this?

admin cp then?

nerbert 05-13-2013 06:22 PM

Go to Plugins & Products > Add New Plugin

Product: vBulletin

Hook Location: postbit_display_complete

Title : Kill links

Exectution Order: 5

Plugin PHP Code:

PHP Code:

if($post['posts'] < 30

    
$post['message'] = preg_replace("/\[url[\s\S]*?\/url\]/i""LINK REMOVED"$post['message']); 



Plugin is active: NO

Save and Reload

Now go find a post by a newby, change Plugin is active to YES and refresh the page with the newby post and see if it works and doesn't generate any errors. If there's an error turn the plugin back off and post here, I'll try to help.

MaXimus 05-14-2013 12:06 PM

Quote:

Originally Posted by nerbert (Post 2421795)
Go to Plugins & Products > Add New Plugin

Product: vBulletin

Hook Location: postbit_display_complete

Title : Kill links

Exectution Order: 5

Plugin PHP Code:

PHP Code:

if($post['posts'] < 30

    
$post['message'] = preg_replace("/\[url[\s\S]*?\/url\]/i""LINK REMOVED"$post['message']); 



Plugin is active: NO

Save and Reload

Now go find a post by a newby, change Plugin is active to YES and refresh the page with the newby post and see if it works and doesn't generate any errors. If there's an error turn the plugin back off and post here, I'll try to help.

no error message bro but didn't work:

http://forums.tweakarena.com/showthr...?p=136#post136


https://vborg.vbsupport.ru/external/2013/05/38.png

nerbert 05-14-2013 01:52 PM

Duh! It should be looking for html instead of bb code. Try this:

PHP Code:

if($post['posts'] < 30)  
{  
    
$post['message'] = preg_replace("/<a[\s\S]*?\/a>/i""LINK REMOVED"$post['message']);  


--------------- Added [DATE]1368545302[/DATE] at [TIME]1368545302[/TIME] ---------------

Note the Warning at the top in your screen shot. Go to your Options and find Plugin/Hook System and turn it on

MaXimus 05-14-2013 03:15 PM

Quote:

Originally Posted by nerbert (Post 2421970)
Duh! It should be looking for html instead of bb code. Try this:

PHP Code:

if($post['posts'] < 30)  
{  
    
$post['message'] = preg_replace("/<a[\s\S]*?\/a>/i""LINK REMOVED"$post['message']);  


--------------- Added [DATE]1368545302[/DATE] at [TIME]1368545302[/TIME] ---------------

Note the Warning at the top in your screen shot. Go to your Options and find Plugin/Hook System and turn it on

Thanks a looooooooot bro!! that worked like a charm after I enabled plugins globally :)

cheers!


All times are GMT. The time now is 08:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01199 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete