vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Add-On Releases - Throttle Posts/Threads (restrict number of posts/threads by usergroup/forum by time) (https://vborg.vbsupport.ru/showthread.php?t=131014)

CyberRanger 06-27-2007 07:17 PM

Quote:

Originally Posted by ElForro (Post 1277800)
I'm sorry... but this is not working in any way when I try to limit to ONE forum... I've changed the settings a million times, and there are only two results:

- I can post unlimited times
- I can't post not even one time

Could you explain a little more how to limit a usergroup to post X times in 24 hs in ONE forum?

Okay, I figured out the stupid coding mistake I made.

I'll release a full update tomorrow. In the meantime, for the per forum/usergroup number of allowed threads to work right, replace the plugin "Check if Max Number of Threads Reached" with the code below:

PHP Code:

global $vbulletin;
$vbulletin->input->clean_array_gpc('r', array(
    
'f'     => TYPE_INT
));

$limitquery '';


if (
$vbulletin->options['throttle_advanced'])
{
   
// see if per forum/usergroup permissions exist
   
$tempadvanced $db->query_first("
       SELECT * 
       FROM " 
TABLE_PREFIX "tp_throttleposts 
       WHERE `tp_forumid` = " 
$vbulletin->GPC['f'] . " AND `tp_usergroupid` = ".$db->sql_prepare($vbulletin->userinfo['usergroupid']));
   
   if (
$tempadvanced['tp_id'] > 0// forum\usergroup advanced record exists
   
{
    
$vbulletin->options['throttle_threads_time'] = $tempadvanced['tp_threadtime'];
    
$permissions['throttle_threadspermissions'] = $tempadvanced['tp_threadlimit'];            
        
$limitquery " AND `forumid` = " $vbulletin->GPC['f'] . " ";
   }

}


if (
$permissions['throttle_threadspermissions'] >= 0)
{

     
$tempmax2 $db->query_first("SELECT COUNT(threadid) AS threadcount 
                FROM " 
TABLE_PREFIX "thread 
                WHERE `postuserid`="
.$db->sql_prepare($vbulletin->userinfo['userid']).
                                AND `visible`=1
                                
$limitquery
                     AND `dateline` >= "
.$db->sql_prepare((int) (TIMENOW - ($vbulletin->options['throttle_threads_time'] * 60))));

  
$threadremaining = ($permissions['throttle_threadspermissions']) - ($tempmax2['threadcount']);

        
  if (
$threadremaining <= AND $permissions['throttle_threadspermissions'] >= 0)
  {
     eval(
standard_error(fetch_error('throttle_threads_max_reached'$permissions['throttle_threadspermissions'], $vbulletin->options['throttle_threads_time'])));
  }


The per forum/usergroup number of posts is also not working properly. I'll have that in tomorrow's fix.

bigcurt 06-27-2007 08:49 PM

Did that and everything seems to be fixed so far.

ElForro 06-29-2007 05:23 PM

Quote:

Originally Posted by CyberRanger (Post 1277907)
Okay, I figured out the stupid coding mistake I made.

I'll release a full update tomorrow. In the meantime, for the per forum/usergroup number of allowed threads to work right, replace the plugin "Check if Max Number of Threads Reached" with the code below:

PHP Code:

global $vbulletin;
$vbulletin->input->clean_array_gpc('r', array(
    
'f'     => TYPE_INT
));

$limitquery '';


if (
$vbulletin->options['throttle_advanced'])
{
   
// see if per forum/usergroup permissions exist
   
$tempadvanced $db->query_first("
       SELECT * 
       FROM " 
TABLE_PREFIX "tp_throttleposts 
       WHERE `tp_forumid` = " 
$vbulletin->GPC['f'] . " AND `tp_usergroupid` = ".$db->sql_prepare($vbulletin->userinfo['usergroupid']));
   
   if (
$tempadvanced['tp_id'] > 0// forum\usergroup advanced record exists
   
{
    
$vbulletin->options['throttle_threads_time'] = $tempadvanced['tp_threadtime'];
    
$permissions['throttle_threadspermissions'] = $tempadvanced['tp_threadlimit'];            
        
$limitquery " AND `forumid` = " $vbulletin->GPC['f'] . " ";
   }

}


if (
$permissions['throttle_threadspermissions'] >= 0)
{

     
$tempmax2 $db->query_first("SELECT COUNT(threadid) AS threadcount 
                FROM " 
TABLE_PREFIX "thread 
                WHERE `postuserid`="
.$db->sql_prepare($vbulletin->userinfo['userid']).
                                AND `visible`=1
                                
$limitquery
                     AND `dateline` >= "
.$db->sql_prepare((int) (TIMENOW - ($vbulletin->options['throttle_threads_time'] * 60))));

  
$threadremaining = ($permissions['throttle_threadspermissions']) - ($tempmax2['threadcount']);

        
  if (
$threadremaining <= AND $permissions['throttle_threadspermissions'] >= 0)
  {
     eval(
standard_error(fetch_error('throttle_threads_max_reached'$permissions['throttle_threadspermissions'], $vbulletin->options['throttle_threads_time'])));
  }


The per forum/usergroup number of posts is also not working properly. I'll have that in tomorrow's fix.

Thanks! I think it's working just fine now!!!

CyberRanger 06-29-2007 05:40 PM

Quote:

Originally Posted by ElForro (Post 1279331)
Thanks! I think it's working just fine now!!!

Great! I just uploaded ver2.1 that incorporates the fix for the per forum/usergroup setting for threads and posts.

TCattitude 06-29-2007 11:06 PM

Really nice mod.
Thanks for this ;)

jwocky 07-10-2007 12:27 AM

Quote:

Originally Posted by CyberRanger (Post 1279342)
Great! I just uploaded ver2.1 that incorporates the fix for the per forum/usergroup setting for threads and posts.

Awesome! does 2.1 include the update to exclude the deleted/closed threads?

CyberRanger 07-13-2007 02:49 AM

Quote:

Originally Posted by jwocky (Post 1287157)
Awesome! does 2.1 include the update to exclude the deleted/closed threads?

No, but I'll get that out "soon"!

jwocky 07-16-2007 08:42 PM

Quote:

Originally Posted by CyberRanger (Post 1289676)
No, but I'll get that out "soon"!

Can't wait, thanks!!!

Nathan2006 07-24-2007 10:07 PM

Thank you for the update :)

lostgirl815 09-09-2007 04:50 AM

It seems that people can get around this by using Quick Reply. Anybody have a solution?


All times are GMT. The time now is 04:23 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.01612 seconds
  • Memory Usage 1,783KB
  • 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
  • (2)bbcode_php_printable
  • (6)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