5 hours active

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

    5 hours active

    damn guys have a big prob after few hours active the whole site got plusses and auto pm bout 30 times and its still going on whats wrong with this code
    Code:
    function addonline($uid,$place,$plclink)
    {
      $tm = time();
      $timeout = $tm - 420; //time out = 5 minutes
      $deloff = mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");
      ///now try to add user to online list
     $lastactive2 = mysql_fetch_array(mysql_query("SELECT resetime FROM ibwf_users WHERE id='".$uid."'"));
    $tolsla2 = time() - $lastactive2[0];
    $totaltimeonline2 = mysql_fetch_array(mysql_query("SELECT onlinetime FROM ibwf_users WHERE id='".$uid."'"));
    $totaltimeonline2 = $totaltimeonline2[0] + $tolsla2;
    $onlinetime = mysql_fetch_array(mysql_query("SELECT onlinetime FROM ibwf_users WHERE id='".$uid."'"));
    $num = $onlinetime[0]/86400;
    $days = intval($num);
    $num2 = ($num - $days)*24;
    $hours = intval($num2);
    $num3 = ($num2 - $hours)*60;
    $mins = intval($num3);
    $num4 = ($num3 - $mins)*60;
    $secs = intval($num4);
    if(!onlinetime($uid))
        {
    if($hours==5)
        {
    $kano ="100";
    $msg = "".getnick_uid(getuid_sid($sid))."Congratulation! You are lucky, coz even if you did not reach 5 hours. Youve got 100plusses n 100bp."."[br/][small]Note: This is an automated PM[/small]";
                            autopm($msg, $uid);
    $res = mysql_query("UPDATE ibwf_users SET plusses=plusses+'$kano' WHERE id='".$uid."'");
    $res = mysql_query("UPDATE ibwf_users SET onlinedone='1' WHERE id='".$uid."'");
    $res = mysql_query("UPDATE ibwf_users SET battlep=battlep+'$kano' WHERE id='".$uid."'");
    }
    }
    
    
     $ttime = time();
    $res = mysql_query("UPDATE ibwf_users SET resetime='".$ttime."' WHERE id='".$uid."'");
     $res = mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='".$uid."'");
      $res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");
      if(!$res)
      {
        //most probably userid already in the online list
        //so just update the place and time
        $res = mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."' WHERE userid='".$uid."'");
    
    
      }
      $maxmem=mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));
    
                $result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
    
              if($result[0]>=$maxmem[0])
              {
                $tnow = date("D d M Y - H:i");
                mysql_query("UPDATE ibwf_settings set name='".$tnow."', value='".$result[0]."' WHERE id='2'");
              }
              $maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
              if($maxtoday[0]==0||$maxtoday=="")
              {
                mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");
                $maxtoday[0]=1;
              }
              if($result[0]>=$maxtoday[0])
              {
                mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");
              }
    }
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    m8 remove
    $num = $onlinetime[0]/86400;
    $days = intval($num);
    $num2 = ($num - $days)*24;
    $hours = intval($num2);
    $num3 = ($num2 - $hours)*60;
    $mins = intval($num3);
    $num4 = ($num3 - $mins)*60;
    $secs = intval($num4);


    put

    $num = $onlinetime[0]/5;
    $hours = intval($num);

    it will work if not then post back
    Last edited by spiderwebs; 11.09.09, 16:03.
    E107 Security Team Leader
    Proudly Support AccountLab Plus Billing Software

    Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com
    ------------------

    Comment


      #3
      Theres a problem in deleting time there. . .
      com site: http://vampist.net
      download site: http://wapdloads.net
      fb: http://www.facebook.com/pmplx

      Comment


        #4
        if i want to make the time online to 1 hour what must i change this to
        $num = $onlinetime[0]/86400;
        ________________
        Jacques
        jacques@gw-designs.co.za
        http://coding.biz.tm
        Come join and lets make it a place to learn all the noobies how to code
        __________________

        NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

        Comment


          #5
          adjust it for 1hr
          E107 Security Team Leader
          Proudly Support AccountLab Plus Billing Software

          Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com
          ------------------

          Comment


            #6
            Code:
            $num = $onlinetime[0]/5; = $num = $onlinetime[0]/1;
            Code:
                 
            $num = $onlinetime[0]/86400;    1*60*60 = 3600(sec) 1 hour 3600*24= 86400(sec)

            Comment


              #7
              does that code require a sql? im using the gsm.pinoy3g.info script uploaded by kabooms but the reward keeps flooding in my inbox even if its not yet 1 hour.

              Comment


                #8
                what is the code in profile to see the idle time or 5 hours stat? Anyone will post pls!?

                Comment

                Working...
                X