how to add limit in PMs user send 200 pms per day it will renew next 24hrz plz help thnx
limit in PMs
Collapse
X
-
ok rukiya what querry to give exampleOriginally posted by rukiya View Postcount total sendpm in 24*60*60 seconds
if (count>200)
{
/// dnt allow to send pm
}
else
{
/// allow
}
$tm24 = time() - (24*60*60);
where to ad $tm24 in querry
$act = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE uid='".$uid."'"));
if($act[0]<2000)
{
not allow
}else{
allow
}
Comment
-
Good try but wrong! Do like this.
PHP Code:$tm24 = time() - (24*60*60); //where to ad $tm24 in querry $act = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_private WHERE byuid=$uid AND timesent>$tm24")); if($act[0]>200) { //not allow } else { //allow }Last edited by rukiya; 06.02.10, 14:22.
Comment
-
thnx rukiya its working help me 1more thing how add timer that will start after completing his limit
23hrs:25min:51sec LEFT
for restart ur PMS
but only show 10secsPHP Code:$tm24 = time() - (24*60*60); $tim = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_private WHERE byuid='".$uid."' AND timesent>'".$tm24."'")); $timer = $tim[0]; $lol = gettimemsg($timer); echo "time left: $lol<br/><br/>";Last edited by revenge; 06.02.10, 20:39.
Comment
-
look you already got the function name and put in your post by editing after I had posted.
but the correct code will be
PHP Code:$tm24 = mktime(0, 0, 0, date("m"), date("d"), date("y")); $pmcount = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_private WHERE byuid='".$uid."' AND timesent>'".$tm24."'")); if($pmcount[0]>200) { // not allow } else { // allow } echo "time left:". gettimemsg(mktime(24, 0, 0, date("m"), date("d"), date("y"))-time())."<br/><br/>";
Comment
-
thnx rukiya but the prblm is it show same tym for evry user n it will start frm 13hrsOriginally posted by rukiya View Postlook you already got the function name and put in your post by editing after I had posted.
but the correct code will be
PHP Code:$tm24 = mktime(0, 0, 0, date("m"), date("d"), date("y")); $pmcount = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_private WHERE byuid='".$uid."' AND timesent>'".$tm24."'")); if($pmcount[0]>200) { // not allow } else { // allow } echo "time left:". gettimemsg(mktime(24, 0, 0, date("m"), date("d"), date("y"))-time())."<br/><br/>";
time left:13 hours 19 minutes
Comment
-
Originally posted by revenge View Postok so how i set 24hrs instead 13hrzPHP Code:$tm24 = mktime(0, 0, 0, date("m"), date("d"), date("y")); $pmcount = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_private WHERE byuid='".$uid."' AND timesent>'".$tm24."'")); if($pmcount[0]>200) { $rukiya =mysql_fetch_array(mysql_query("SELECT timesent FROM ibwf_private WHERE byuid='".$uid."' ORDER BY timesent LIMIT 1")); $rukiya = $rukiya[0]+86400-time(); if($rukiya>0) { echo "time left:".gettimemsg($rukiya) ."<br/><br/>"; } sleep(86400); ////add pm send code I mean the pm input box and submit button here }Last edited by rukiya; 07.02.10, 15:12.
Comment
Comment