Hi all, I would like a way to limit the number of messages per day that each user can write in the shoutbox my chat lavalair (for example, each user can write a maximum of 5 messages in the shoutbox every 24 hours) thanks to who can help me
message limit in shoutbox lava
Collapse
X
-
i don't remember lava structure, so edit this to match your script. hope you will get it.
when a user wants to post a message:
$time = time() - 24*60*60;
$howmuch = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM shoutbox WHERE poster = '".$user."' AND timepost > '".$time."'"));
if ($howmuch[0] > 4)
{
echo "you have reached the maximum of 5 shouts / day";
}
else
{
insert process goes here
}Last edited by Mysterio; 10.04.10, 22:32.mysterio.al - programming is a functional art
-
does not work, or maybe I don't know where to put it I did so $time = time() - 24*60*60;
$howmuch = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM shoutbox WHERE poster = '".$user."' AND timepost > '".$time."'"));
if ($howmuch[0] > 4)
{
echo "you have reached the maximum of 5 shouts / day";
}
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 "<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!<br/><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
if(istrashed(getuid_sid($sid)))
{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot shout!<br/>please try again later...<br/><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}else{
$shtm = time();
if(!isblocked($shtxt,$uid))
{
in genproc.php but don t work
Comment
-
yeah you just a noob!
Code:$oras = time() - 24*60*60; $howmuch = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter = '".$uid."' AND shtime > '".$oras."'")); if ($howmuch[0] > 4) { echo "<div align=\"center\">"; echo "<img src=\"../images/notok.gif\" alt=\"X\"/>"; echo "you have reached the maximum of 5 shouts / day"; echo "</div>"; echo "</body>"; echo "</html>"; exit(); }
and click thanks!Last edited by wapmetal; 11.04.10, 09:22.
Comment
-
hahaha, lol
this is why i am lazy to help some people some timemysterio.al - programming is a functional art
Comment
Comment