Anto Flood On Shoutbox! (lavalair)
Started on the old forum in June 2007 · view the original in the archive · old links redirect here
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.
Be more explicit.what you need ?
And you can say a litle Plzz if you need some code External image (may be gone)
External image (may be gone) heeeeeeeeeeee yup, plzzzz help me.. a wan put anti flood 4 shout box..
stop fighting n help d dude already lol
$uid = getuid_sid($sid);
$tm = time();
$antiflood = 10;/// anti flood time
$lastshout = mysql_fetch_array(mysql_query("SELECT MAX(shtime) FROM ibwf_shouts WHERE shouter='".$uid."'"));
$shoutfl = $lastshout[0]+$antiflood;
if(ismod($uid))$shoutfl=0;
if($shoutfl<$tm)
{
part that allows u to shout blah blah blah
}else{
$rema = $shoutfl - $tm;
echo "<img src=\"images/notok.gif\" alt=\"X\"/>";
echo "Flood control: $rema Seconds
";
}
my main chat site has lot malaysians and when alot them ask a question it can seem more forward and sometimes bit rude but thats jus how there english is interpreted sometimes if u dnt wana help them there no point saying anything jus bcos u dnt care what ppl say 2u dnt mean u should do it to others they hav feelins u no... and making this site look beta would hav to start by all the admins n mods being nice if not whats the point in being 1 at all
my grandapa (a poor italian bumkin) said..the best thing everyone can do is to teach to others what someone else before has teached to you. we have a great lucky thing..language..we can talk and show our feelings to anybody all over the world..use it. people comes here need help..it don't care if sometimes questions are fool or seems like this..the only important thing is help and teach to others.. External image (may be gone)
the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com
your right just help people less arguing
i think u must put it in genproc.php
//////////////////////////////////////////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='".$uid."'"));
$shoutfl = $lastshout[0]+$antiflood;
if(ismod($uid))$shoutfl=0;
if($shoutfl<$tm)
{
$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;
mysql_query("UPDATE ibwf_users SET shouts='".$shts."' WHERE id='".$uid."'");
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&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
Are iam write ?? External image (may be gone) External image (may be gone)
Or i must put i in index.php ??
i think u must put it in genproc.php
//////////////////////////////////////////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='".$uid."'")); $shoutfl = $lastshout[0]+$antiflood; if(ismod($uid))$shoutfl=0; if($shoutfl<$tm) { $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; mysql_query("UPDATE ibwf_users SET shouts='".$shts."' WHERE id='".$uid."'"); 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&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo "</p>"; echo "</card>"; }Are iam write ?? External image (may be gone) External image (may be gone)
Or i must put i in index.php ??
that goes into index.php
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
$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);