vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Rate-limiting new thread creation (https://vborg.vbsupport.ru/showthread.php?t=48897)

mute 02-14-2003 11:26 AM

Rate-limiting new thread creation
 
We disabled Guest posting on our board, but we occasionally get idiots who like to spam/flood the board by creating a multitude of new posts/threads.

The posts don't bother me so much as a million new threads, so I was wondering if anyone knew of a hack that would limit registered users to N new thread creations per hour (or some other time period).

I thought something along the lines of 5 new threads per hour wouldn't inconvienience anyone, but would keep the flooding to a minimum.

Anyone know if i just missed such a hack in the db?

filburt1 02-14-2003 12:14 PM

You can already limit the time between posts in the admin CP unless you only want threads to be limited in which case I think you do need a hack.

mute 02-14-2003 12:19 PM

Yeah, I don't actually wanna limit posting, just thread creation.

I think I have it nailed down.

mysql> select dateline,postusername from thread where dateline > UNIX_TIMESTAMP(NOW())-3600 and postusername = 'John-PB2X';

+------------+--------------+
| dateline | postusername |
+------------+--------------+
| 1045231378 | John-PB2X |
| 1045231443 | John-PB2X |
+------------+--------------+
2 rows in set (0.67 sec)

Thats just for some user I noticed was currently posting.

I think I can do something similar to that in the newthread.php and have it work..

mute 02-14-2003 12:59 PM

This is what I came up with (in newthread.php)

PHP Code:


    
// new thread creation rate-limiting
    
if ($enablefloodcheck) {
       
$lastthreads=$DB_site->query("SELECT dateline FROM thread WHERE dateline > UNIX_TIMESTAMP(NOW())-3600 AND postusername='$bbu
serinfo[username]'"
);
        
$lastthreads=$DB_site->num_rows($lastthreads);
      if (
$bbuserinfo[userid]!=and $lastthreads>=and !ismoderator($foruminfo[forumid])) {
            eval(
"standarderror(\"".gettemplate("error_threadcheck")."\");");
            exit;
        }
    } 

All i have to do now is make an error_threadcheck template


All times are GMT. The time now is 06:16 PM.

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.01027 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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