Anto Flood On Shoutbox! (lavalair)

Started on the old forum in June 2007 · view the original in the archive · old links redirect here

22 replies · 3,169 views · started 19 years ago · 1 min read

TL;DR · summary of 22 replies
  • Guest asked for help with adding anti-flood code to the shoutbox.
  • Wizard provided a basic example of how to add anti-flood control code, suggesting it should be placed on the script file.
  • The thread concluded that the anti-flood code should be added to index.php.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

11 participants
bluangelo Junior · 19 posts #21

Here's mine. pls put the anti flood control code ..

//////////////////////////////////////////shout

else if($action=="shout") { $shtxt = $_POST["shtxt"]; addonline(getuid_sid($sid),"Shouting",""); echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo "<left>"; if(getchmsgs(getuid_sid($sid))<200) { echo "You should have at least 200 chatposts to enable shout system!

"; }else{ $shtxt = $shtxt; //$uid = getuid_sid($sid); $shtm = time(); $res = mysql_query("INSERT INTO ibwf_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'"); if($res) { $shts = mysql_fetch_array(mysql_query("SELECT shouts from ibwf_users WHERE id='".$uid."'")); $shts = $shts[0]+1; $plus = getplusses(getuid_sid($sid)); $plusses = $plus - 15; $cred = getcredits(getuid_sid($sid)); $credits = $cred + 1; mysql_query("UPDATE ibwf_users SET shouts='".$shts."', plusses='".$plusses."', credits='".$credits."' WHERE id='".$uid."'"); echo "Shout added successfully! 15 Plusses was deducted from your account! 1 Credit was added to your account!"; }else{ $bantime = time() + (302460*60); echo "Can't Post Shout Message

"; echo "You just shouted a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action:

  1. you have lost your sheild

  2. you have lost all your plusses

  3. You are BANNED!"; $user = getnick_sid($sid); mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='Ms.Ticket auto banned $user for spamming shoutbox', actdt='".time()."'"); mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'"); echo "</body>"; echo "</html>"; exit; } }

    echo "


<a href="index.php?action=main&sid=$sid">Main Menu</a> "; echo " "; echo "</body>"; }

🤨🤨🤨🤨

shakil420 Developer · 125 posts #22

i need a code that can stop same forum posts in lavalair scripts.......like user1:abla abla abla if user1: says: abla abla abla alert : hey user1 r u 420 why u want to post same post in the forum??!

now what is the code?

my genproc.php foe post is like this ::

else if($action=="post")
{
    $tid = $_POST["tid"];
    $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
    {
      echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
      echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
    }
if(istrashed(getuid_sid($sid)))
  {
      echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot create post!<br/>please try again later...<br/><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
  }
  $reptxt = $_POST["reptxt"];
  $qut = $_POST["qut"];
  addonline(getuid_sid($sid),"Posted A reply","");
  echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
      $crdate = time();
      $fid = getfid($tid);
      //$uid = getuid_sid($sid);
      $res = false;
      $closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));

      if(($closed[0]!='1')||(ismod($uid)))
      {

        $lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
        global $post_af;
        $antiflood = time()-$lpost[0];
        if($antiflood>$post_af)
{
  if(trim($reptxt)!="")
      {
    if(!isblocked($reptxt,$uid))
    {
      $res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
    }else{
    $bantime = time() + (30*24*60*60);
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
    echo "Can't Post Reply<br/><br/>";
   echo "You just tried posting a reply with a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
        $user = getnick_sid($sid);
    mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>Wap Desire</b> auto banned $user for spamming forums', actdt='".time()."'");
    mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
    mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
    echo "</p></card>";
    echo "</wml>";
    exit();
  }
}
      if($res)
      {
        $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
        $res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM ibwf_topics WHERE id='".$tid."'"));
	  $usr = getnick_uid($uid);
	  $tname = htmlspecialchars($res2[0]);
      if(($res2[1]!=$uid)&&(automsgs($res2[1]))){
	  $msg = "Your Topic [topic=$tid]$tname"."[/topic] has been Replied to by $usr [br/][small][i]p.s: this is an automated pm[/i][/small]";
	  autopm($msg, $res2[1]);
        }
        $ups = $usts[0]+1;
        $upl = $usts[1]+1;
        mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
        mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
        echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">";
echo "View Topic</a>";
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
      }
      }else{
$af = $post_af -$antiflood;
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
      }
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
      }

      $fname = getfname($fid);
      echo "<br/><br/><a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "$fname</a><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
      echo "</p>";
      echo "</card>";

}
ewanz Developer · 187 posts #23

shakil420 wrote: i need a code that can stop same forum posts in lavalair scripts.......like user1:abla abla abla if user1: says: abla abla abla alert : hey user1 r u 420 why u want to post same post in the forum??!

now what is the code?

my genproc.php foe post is like this ::

else if($action=="post")
{
    $tid = $_POST["tid"];
    $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
    {
      echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
      echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
    }
if(istrashed(getuid_sid($sid)))
  {
      echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot create post!<br/>please try again later...<br/><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
  }
  $reptxt = $_POST["reptxt"];
  $qut = $_POST["qut"];
  addonline(getuid_sid($sid),"Posted A reply","");
  echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
      $crdate = time();
      $fid = getfid($tid);
      //$uid = getuid_sid($sid);
      $res = false;
      $closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));

      if(($closed[0]!='1')||(ismod($uid)))
      {

        $lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
        global $post_af;
        $antiflood = time()-$lpost[0];
        if($antiflood>$post_af)
{
  if(trim($reptxt)!="")
      {
    if(!isblocked($reptxt,$uid))
    {
      $res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
    }else{
    $bantime = time() + (30*24*60*60);
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
    echo "Can't Post Reply<br/><br/>";
   echo "You just tried posting a reply with a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
        $user = getnick_sid($sid);
    mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>Wap Desire</b> auto banned $user for spamming forums', actdt='".time()."'");
    mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
    mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
    echo "</p></card>";
    echo "</wml>";
    exit();
  }
}
      if($res)
      {
        $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
        $res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM ibwf_topics WHERE id='".$tid."'"));
	  $usr = getnick_uid($uid);
	  $tname = htmlspecialchars($res2[0]);
      if(($res2[1]!=$uid)&&(automsgs($res2[1]))){
	  $msg = "Your Topic [topic=$tid]$tname"."[/topic] has been Replied to by $usr [br/][small]p.s: this is an automated pm[/small]";
	  autopm($msg, $res2[1]);
        }
        $ups = $usts[0]+1;
        $upl = $usts[1]+1;
        mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
        mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
        echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">";
echo "View Topic</a>";
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
      }
      }else{
$af = $post_af -$antiflood;
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
      }
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
      }

      $fname = getfname($fid);
      echo "<br/><br/><a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "$fname</a><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
      echo "</p>";
      echo "</card>";

}

nice idea.. you give me a good idea to stop free post in forum.. i'll try code it now..

our lfe is simple words.... 😌 http://mygenkz.net ewanz06@yahoo.com

$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); 

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close