Anto Flood On Shoutbox! (lavalair)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    i think u must put it in genproc.php
    Code:
    //////////////////////////////////////////shout
    
    else if($action=="shout")
    {
      $shtxt = $_POST["shtxt"];
        addonline(getuid_sid($sid),"Shouting","");
    
        echo "<card id=\"main\" title=\"Shout\">";
        echo "<p align=\"center\">";
        if(getplusses(getuid_sid($sid))<75)
        {
            echo "<img src=\"images/notok.gif\" alt=\"X\"/>You should have at least 75 plusses to shout!";
        }else{
          $shtxt = $shtxt;
        //$uid = getuid_sid($sid);
        $shtm = time();
          $antiflood = 10;/// anti flood time
    
    $lastshout = mysql_fetch_array(mysql_query("SELECT MAX(shtime) FROM ibwf_shouts WHERE shouter=&#39;".$uid."&#39;"));
    
    $shoutfl = $lastshout[0]+$antiflood;
    
    if(ismod($uid))$shoutfl=0;
    
      if($shoutfl<$tm)
      {
    
        $res = mysql_query("INSERT INTO ibwf_shouts SET shout=&#39;".$shtxt."&#39;, shouter=&#39;".$uid."&#39;, shtime=&#39;".$shtm."&#39;");
        if($res)
        {
        $shts = mysql_fetch_array(mysql_query("SELECT shouts from ibwf_users WHERE id=&#39;".$uid."&#39;"));
        $shts = $shts[0]+1;
        mysql_query("UPDATE ibwf_users SET shouts=&#39;".$shts."&#39; WHERE id=&#39;".$uid."&#39;");
        echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout added successfully";
            }else{
    
        $rema = $shoutfl - $tm;
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>";
        echo "Flood control: $rema Seconds
    
    ";
                }
        }else{
            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
        }
                }
             echo "
    
    <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
        echo "</p>";
        echo "</card>";
    }
    Are iam write ??

    Or i must put i in index.php ??[/b]
    that goes into index.php

    Comment


      #17
      oh... thnx for info amylee !!!

      Comment


        #18
        why does not work in lavalair xhtml scripts ?

        Comment


          #19
          provide xhtml plz
          Nice Effects

          Comment


            #20
            not all malaysian peple like that.. Some malaysian are polite... Sorry if my language was broken.. i also from malaysian.. =) , anti flood already have in wapdesire.. just copy from it.. it is good if u can block the same shout being post in shoutroom.. who can share this?
            our lfe is simple words....
            http://mygenkz.net
            ewanz06@yahoo.com
            PHP Code:
            $output="i am NOoob....";
            $newfile="ewanz.txt";
            $file fopen ($newfile"w");
            fwrite($file$output);
            fclose ($file); 

            Comment


              #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 <b>200</b> chatposts to enable shout system!<br/><br/>";
              }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!<br/><b>15</b> Plusses was deducted from your account!<br/><b>1</b> Credit was added to your account!";
              }else{
              $bantime = time() + (30*24*60*60);
              echo "Can't Post Shout Message<br/><br/>";
              echo "You just shouted 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>Ms.Ticket</b> 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 "<br/>-------<br/><a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a><br/>";
              echo "</p>";
              echo "</body>";
              }


              Comment


                #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 ::

                PHP Code:
                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&amp;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&amp;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&amp;sid=$sid&amp;tid=$tid&amp;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&amp;sid=$sid&amp;fid=$fid\">";
                echo 
                "$fname</a><br/>";
                      echo 
                "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
                echo 
                "Home</a>";
                      echo 
                "</p>";
                      echo 
                "</card>";


                Comment


                  #23
                  Originally posted by shakil420 View Post
                  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 ::

                  PHP Code:
                  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&amp;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&amp;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&amp;sid=$sid&amp;tid=$tid&amp;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&amp;sid=$sid&amp;fid=$fid\">";
                  echo 
                  "$fname</a><br/>";
                        echo 
                  "<a href=\"index.php?action=main&amp;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
                  PHP Code:
                  $output="i am NOoob....";
                  $newfile="ewanz.txt";
                  $file fopen ($newfile"w");
                  fwrite($file$output);
                  fclose ($file); 

                  Comment

                  Working...
                  X