vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forbid Users from Posting Links or Images if They Have Fewer than 15 Posts (https://vborg.vbsupport.ru/showthread.php?t=96018)

Andreas 03-23-2006 12:21 PM

@amykhar
This Hack has a serious bug which causes issues with other Hacks that automatically create threads (and are using others users for this):
You check the posts for the viewing user, instead of checking the posts for the user that makes the post.

Corrected Plugins:
postdata_presave
PHP Code:

// get useriinfo for this post
$userid =& $this->fetch_field('userid');
$userinfo fetch_userinfo($userid);
$pagetext =& $this->fetch_field('pagetext''post');

if ((
$userinfo['posts'] < 15) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) 
{
    
$this->error('error_nourlallowed');
    
$return_value false;


threadfpdata_presave
PHP Code:

// get useriinfo for this post
$userid =& $this->fetch_field('postuserid');
$userinfo fetch_userinfo($userid);
$pagetext =& $this->fetch_field('pagetext''post');
if ((
$userinfo['posts'] < 15) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) 
{
    
$this->error('error_nourlallowed');
    
$return_value false;



the Sandman 03-23-2006 06:53 PM

This causes an error on my board for anyone replying to a thread:

Warning: Missing argument 1 for fetch_userinfo() in /includes/functions.php on line 998

Quote:

Originally Posted by Andreas
@amykhar
This Hack has a serious bug which causes issues with other Hacks that automatically create threads (and are using others users for this):
You check the posts for the viewing user, instead of checking the posts for the user that makes the post.

Corrected Plugins:
postdata_presave
PHP Code:

// get useriinfo for this post
$userid =& $this->fetch_field('userid');
$userinfo fetch_userinfo();
$pagetext =& $this->fetch_field('pagetext''post');

if ((
$userinfo['posts'] < 2) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) 
{
    
$this->error('error_nourlallowed');
    
$return_value false;


threadfpdata_presave
PHP Code:

// get useriinfo for this post
$userid =& $this->fetch_field('postuserid');
$userinfo fetch_userinfo($userid);
$pagetext =& $this->fetch_field('pagetext''post');
if ((
$userinfo['posts'] < 2) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://'))) 
{
    
$this->error('error_nourlallowed');
    
$return_value false;




amykhar 03-23-2006 07:21 PM

sandman, the parameter for fetch_userinfo is $userid.

Andreas 03-24-2006 12:50 AM

I knew I would mess up something ^.^
Though, it was just the missing userid as amy already pointed to - edited the post.

the Sandman 03-24-2006 01:20 AM

Thanks!

Bulent Tekcan 03-24-2006 06:29 AM

Title is ......Fewer than 15 Posts but here is (($userinfo['posts'] < 2) It must be 15 I think :)

Darat 03-24-2006 08:47 AM

Quote:

Originally Posted by Andreas
@amykhar
This Hack has a serious bug which causes issues with other Hacks that automatically create threads (and are using others users for this):
You check the posts for the viewing user, instead of checking the posts for the user that makes the post.

Corrected Plugins:
postdata_presave

threeadfpdata_presave

I'm probably being completely stupid - but what do I edit to fix the bug?

pipin 03-24-2006 09:18 AM

Quote:

Originally Posted by Bulent Tekcan
Title is ......Fewer than 15 Posts but here is (($userinfo['posts'] < 2) It must be 15 I think :)

probably he adjusted it for is own needs, i lowered it at our forum to 5.

aeroguy 03-27-2006 06:43 PM

Mod is great However, amykhar is there a way to disable it for certain forums. For example this would conflict with the Reported Posts mod since members with less then 15 posts would not be able to report posts.
I tried the following but it didnt work.

if (($vbulletin->userinfo[posts] < 15) and ($vbulletin->forum[forumid]!=X) and (stristr($pagetext,'[url') or stristr($pagetext,'[URL') or stristr($pagetext,'www.') or stristr($pagetext,'http://')))
{

HUMMERh3 03-27-2006 07:04 PM

Is there a way to let the users who has less than 15 posts be able to post Smiley faces? Right now if a user types in a message and uses a smiley faces it doesn't let them post. Frankly I don't mind the smiley faces...? Anyone know how to change this?

Thanks!!!


All times are GMT. The time now is 06:56 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.01426 seconds
  • Memory Usage 1,766KB
  • 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
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete