Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Anti-Flood [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-04-30 15:12:15
Updated for V3 credit to original author

Have it up on test site seems fine if anyone wants to test

[color=rgb(251, 160, 38)]in config.php add[/color]

$site_config["floodsize"]  = 1000;  // Maximum size of messages, forumposts, comments
$site_config["floodlimit"] = 10;    // Amount of sources before to be considered flood
$site_config["floodtime"]  = 10;    // Time between messages, forumposts, comments


[color=rgb(251, 160, 38)]in comments.php find[/color]
    if (!$body)
       show_error_msg(T_("ERROR"), T_("YOU_DID_NOT_ENTER_ANYTHING"), 1);


add after

//===| Anti-Flood
   if ( strlen($body) > $site_config['floodsize'] )
       show_error_msg("Error", "Your comment is too big, only $site_config[floodsize] characters are allowed.", 1);

   $res = SQL_Query_exec("SELECT COUNT(*) FROM `comments` WHERE user = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config["floodtime"] * 60)) . "'");
   $row = mysqli_fetch_row($res);
   if ($row[0] > $site_config["floodlimit"])
       show_error_msg("Error", "You are only prohibited $site_config[floodlimit] comments in $site_config[floodtime] minutes.", 1);
   //===| End


[color=rgb(251, 160, 38)]in forums.php find[/color]
    $added = "'" . get_date_time() . "'";
   $body = sqlesc($body);


replace with
  //===| Anti-Flood
   if ( strlen($body) > $site_config['floodsize'] )
       show_error_msg("Error", "Your post is too big, only $site_config['floodsize'] characters are allowed.", 1);
   //===| End

   //Insert the new post
   $added = "'" . get_date_time() . "'";
   $body = sqlesc($body);

   //===| Anti-Flood
   $res = SQL_Query_exec("SELECT COUNT(*) FROM `forum_posts` WHERE userid = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config['floodtime'] * 60)) . "'");
   $row = mysqli_fetch_row($res);
   if ($row[0] > $site_config['floodlimit'])
       show_error_msg("Error", "You are only prohibited $site_config[floodlimit] forumposts in $site_config[floodtime] minutes.", 1);
   //===| End    


[color=rgb(251, 160, 38)]in mailbox.php find[/color]
$status = (@$_POST['send'] ? 'yes' : 'no');


add after

//===| Anti-Flood
   if ( strlen($msg) > $site_config["floodsize"] )
       show_error_msg("Error", "Your message is too big, only $site_config[floodsize] characters are allowed.", 1);

   $res = SQL_Query_exec("SELECT COUNT(*) FROM `messages` WHERE sender = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config['floodtime'] * 60)) . "'");
   $row = mysqli_fetch_row($res);
   if ($row[0] > $site_config["floodlimit"])
       show_error_msg("Error", "You are only prohibited $site_config[floodlimit] messages in $site_config[floodtime] minutes.", 1);
   //===| End
Unknown User
2019-04-30 23:29:37
Great job m-jay only comments.php part is left to be fixed. Forums and PM is working well!
Unknown User
2019-05-20 19:11:11
[USER=20288]@m-jay[/USER] i forgot to post here a fix and you can add this in completed.

In torrents-details.php find
if (!$body)

show_error_msg...


Below that add
//===| Anti-Flood

   if ( strlen($body) > $site_config['floodsize'] )

       show_error_msg("Error", "Your comment is too big, only $site_config[floodsize] characters are allowed.", 1);



   $res = SQL_Query_exec("SELECT COUNT(*) FROM `comments` WHERE user = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config["floodtime"] * 60)) . "'");

   $row = mysqli_fetch_row($res);

   if ($row[0] > $site_config["floodlimit"])

       show_error_msg("Error", "You are only prohibited $site_config[floodlimit] comments in $site_config[floodtime] minutes.", 1);

   //===| End
Unknown User
2019-05-28 16:46:01
[USER=20288]@m-jay[/USER] seems like there is a bug with new topic in forum anti-flood. If the topic is created it will show error message for anti-flood but will post a new thread from "deluser" with no post message. We need to include new topic too.
2019-10-18 18:46:00
"shadows, post: 66642, member: 20311":

[USER=20288]@m-jay[/USER] seems like there is a bug with new topic in forum anti-flood. If the topic is created it will show error message for anti-flood but will post a new thread from "deluser" with no post message. We need to include new topic too.

Has this been fixed?
If It Ain't Dutch, It Ain't Much!!
2019-10-18 19:07:21
I would also suggest anti-flood on reseed requests
If It Ain't Dutch, It Ain't Much!!
2019-12-06 15:20:49
Bumping this topic, as there still appears to be a bug as mentioned by shadows above.
If It Ain't Dutch, It Ain't Much!!
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728