limit in PMs

Started on the old forum in February 2010 · view the original in the archive · old links redirect here

11 replies · 784 views · started 16 years ago · 1 min read

2 participants
revenge Junior · 12 posts #1

how to add limit in PMs user send 200 pms per day it will renew next 24hrz plz help thnx

Erro occured when error file create

revenge Junior · 12 posts #3

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

revenge Junior · 12 posts #5

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

revenge Junior · 12 posts #7

plz rukiya give function name in core.php

Erro occured when error file create

rukiya Lead · 569 posts #8

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/>"; 
revenge Junior · 12 posts #9

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

revenge Junior · 12 posts #11

rukiya wrote: I know that.

ok so how i set 24hrs instead 13hrz

Erro occured when error file create

rukiya Lead · 569 posts #12

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 

} 

 
 

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close