limit in PMs
Started on the old forum in February 2010 · view the original in the archive · old links redirect here
count total sendpm in 246060 seconds
if (count>200) { /// dnt allow to send pm } else
{
/// allow }
rukiya wrote: count total sendpm in 246060 seconds
if (count>200) { /// dnt allow to send pm } else
{
/// allow }
ok rukiya what querry to give example
$tm24 = time() - (246060);
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
}
Erro occured when error file create
Good try but wrong! Do like this.
$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
}
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
$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/>";
but only show 10secs
Erro occured when error file create
that function is already in wapdesire core.php, find it and try.
look you already got the function name and put in your post by editing after I had posted.
but the correct code will be
$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/>";
rukiya wrote: look you already got the function name and put in your post by editing after I had posted.
but the correct code will be
$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/>";
thnx rukiya but the prblm is it show same tym for evry user n it will start frm 13hrs time left:13 hours 19 minutes
Erro occured when error file create
rukiya wrote: I know that.
ok so how i set 24hrs instead 13hrz
Erro occured when error file create
revenge wrote: ok so how i set 24hrs instead 13hrz
$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
}