limit in PMs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    limit in PMs

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

    #2
    count total sendpm in 24*60*60 seconds

    if (count>200)
    {
    /// dnt allow to send pm
    }
    else

    {

    /// allow
    }

    Comment


      #3
      Originally posted by rukiya View Post
      count total sendpm in 24*60*60 seconds

      if (count>200)
      {
      /// dnt allow to send pm
      }
      else

      {

      /// allow
      }
      ok rukiya what querry to give example
      $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
      }
      Last edited by revenge; 06.02.10, 13:32. Reason: mistake

      Comment


        #4
        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


          #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

          PHP 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/>"
          but only show 10secs
          Last edited by revenge; 06.02.10, 20:39.

          Comment


            #6
            that function is already in wapdesire core.php, find it and try.

            Comment


              #7
              plz rukiya give function name in core.php

              Comment


                #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

                PHP Code:
                $tm24 mktime(000date("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(2400date("m"), date("d"), date("y"))-time())."<br/><br/>"
                Last edited by rukiya; 06.02.10, 22:11. Reason: many changes

                Comment


                  #9
                  Originally posted by rukiya View Post
                  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(000date("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(2400date("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

                  Comment


                    #10
                    I know that.

                    Comment


                      #11
                      Originally posted by rukiya View Post
                      I know that.
                      ok so how i set 24hrs instead 13hrz

                      Comment


                        #12
                        Originally posted by revenge View Post
                        ok so how i set 24hrs instead 13hrz
                        PHP Code:
                        $tm24 mktime(000date("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

                        Working...
                        X