Methos Total Time Online

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

    Methos Total Time Online

    Here is the code to show the total time online from the MethosWap script.

    Add this field to the users tabel:
    field: tottimeonl, tipe: int, Length/Values: 100, Default: 0.

    Change This in login.php:
    if($res)
    {
    $tolog=true;
    //echo "Bookmark THIS page to avoid repeating the login proccess in the future

    ";
    echo "Logged in successfully as $uid
    ";
    $idn = getuid_nick($uid);

    $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));
    mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."' WHERE id='".$idn."'");
    }else{
    to This:
    if($res)
    {
    $tolog=true;
    $idn = getuid_nick($uid);
    echo "Logged in successfully as $uid

    ";
    echo "Bookmark THIS PAGE to avoid the login process in the future.

    ";

    $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));
    mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."' WHERE id='".$idn."'");
    mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='".$idn."'");
    }else{


    And replace this function: in core.php
    function addonline($uid,$place,$plclink)
    {
    /////delete inactive users
    $tm = time() ;
    $timeout = $tm - 420; //time out = 5 minutes
    $deloff = mysql_query("DELETE FROM ibwf_online WHERE actvtime <&#39;".$timeout."&#39;");
    ///now try to add user to online list
    $res = mysql_query("UPDATE ibwf_users SET lastact=&#39;".time()."&#39; WHERE id=&#39;".$uid."&#39;");
    $res = mysql_query("INSERT INTO ibwf_online SET userid=&#39;".$uid."&#39;, actvtime=&#39;".$tm."&#39;, place=&#39;".$place."&#39;, placedet=&#39;".$plclink."&#39;");
    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=&#39;".$tm."&#39;, place=&#39;".$place."&#39;, placedet=&#39;".$plclink."&#39; WHERE userid=&#39;".$uid."&#39;");


    }
    $maxmem=mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id=&#39;2&#39;"));

    $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=&#39;".$tnow."&#39;, value=&#39;".$result[0]."&#39; WHERE id=&#39;2&#39;");
    }
    $maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt=&#39;".date("d m y")."&#39;"));
    if($maxtoday[0]==0||$maxtoday=="")
    {
    mysql_query("INSERT INTO ibwf_mpot SET ddt=&#39;".date("d m y")."&#39;, ppl=&#39;1&#39;, dtm=&#39;".date("H:i:s")."&#39;");
    $maxtoday[0]=1;
    }
    if($result[0]>=$maxtoday[0])
    {
    mysql_query("UPDATE ibwf_mpot SET ppl=&#39;".$result[0]."&#39;, dtm=&#39;".date("H:i:s")."&#39; WHERE ddt=&#39;".date("d m y")."&#39;");
    }
    }
    With:
    function addonline($uid,$place,$plclink)
    {
    /////delete inactive users
    $tm = time() ;
    $timeout = $tm - 420; //time out = 5 minutes
    $deloff = mysql_query("DELETE FROM ibwf_online WHERE actvtime <&#39;".$timeout."&#39;");

    ///now try to add user to online list and add total time online


    $lastactive = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
    $tolsla = time() - $lastactive[0];
    $totaltimeonline = mysql_fetch_array(mysql_query("SELECT tottimeonl FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
    $totaltimeonline = $totaltimeonline[0] + $tolsla;
    $res = mysql_query("UPDATE ibwf_users SET tottimeonl=&#39;".$totaltimeonline."&#39; WHERE id=&#39;".$uid."&#39;");

    $ttime = time();
    $res = mysql_query("UPDATE ibwf_users SET lastact=&#39;".$ttime."&#39; WHERE id=&#39;".$uid."&#39;");
    $res = mysql_query("INSERT INTO ibwf_online SET userid=&#39;".$uid."&#39;, actvtime=&#39;".$ttime."&#39;, place=&#39;".$place."&#39;, placedet=&#39;".$plclink."&#39;");
    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=&#39;".$ttime."&#39;, place=&#39;".$place."&#39;, placedet=&#39;".$plclink."&#39; WHERE userid=&#39;".$uid."&#39;");


    }
    $maxmem=mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id=&#39;2&#39;"));

    $result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));

    if($result[0]>=$maxmem[0])
    {
    $tnow = date("D d M Y - H:i", time());
    mysql_query("UPDATE ibwf_settings set name=&#39;".$tnow."&#39;, value=&#39;".$result[0]."&#39; WHERE id=&#39;2&#39;");
    }
    $maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt=&#39;".date("d m y")."&#39;"));
    if($maxtoday[0]==0||$maxtoday=="")
    {
    mysql_query("INSERT INTO ibwf_mpot SET ddt=&#39;".date("d m y")."&#39;, ppl=&#39;1&#39;, dtm=&#39;".date("H:i:s")."&#39;");
    $maxtoday[0]=1;
    }
    if($result[0]>=$maxtoday[0])
    {
    mysql_query("UPDATE ibwf_mpot SET ppl=&#39;".$result[0]."&#39;, dtm=&#39;".date("H:i:s")."&#39; WHERE ddt=&#39;".date("d m y")."&#39;");
    }
    }


    Add this where ever you want to show the total time online:
    $totaltimeonline = mysql_fetch_array(mysql_query("SELECT tottimeonl FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
    $num = $totaltimeonline[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);

    echo "Time Online: ";
    if(($days==0) and ($hours==0) and ($mins==0)){
    echo "$secs seconds
    ";
    }else
    if(($days==0) and ($hours==0)){
    echo "$mins mins, ";
    echo "$secs seconds
    ";
    }else
    if(($days==0)){
    echo "$hours hours, ";
    echo "$mins mins, ";
    echo "$secs seconds
    ";
    }else{
    echo "$days days, ";
    echo "$hours hours, ";
    echo "$mins mins, ";
    echo "$secs seconds
    ";
    }


    And your done.

    #2
    OMG!! Thanx a zillion!! You are the one....
    :D:D

    Comment


      #3
      no problem

      Comment


        #4
        <div align="center">THNX methos.</div>

        Comment


          #5
          methos wap script lmfao its LAVALAIR script

          Comment


            #6
            well its not part of the origanal LAVALEIR script, is it? no. I coded it. The Total online code.

            Comment


              #7
              methos wap script lmfao its LAVALAIR script[/b]

              lavalair lavalair, lavalair everything is lavalair lol

              Comment


                #8
                indeed it is

                Comment


                  #9
                  indeed it is[/b]
                  http://mobilelife.tk

                  dis is lavalair. u gonna shut me down too ? :scared:

                  Comment


                    #10
                    http://mobilelife.tk

                    dis is lavalair. u gonna shut me down too ? :scared:[/b]
                    i havnt got a problem with you so no but hey **** can happen

                    Comment


                      #11
                      i havnt got a problem with you so no but hey **** can happen[/b]
                      lol yea rite **** can happen. not a soul can shut down my site sayin dat i&#39;m using their script or a copy of it. my script is coded 101% by me.
                      <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php

                      include_once("global.inc.php");

                      if( !isset( $_GET["a"] ) )
                      {
                      $a = "com";
                      }
                      $do = $_GET["do"];

                      if( $DB->connectdb() == false )
                      {
                      $Errors->DBerror();
                      }
                      switch( $a ) {

                      case com:
                      $Community->Community_page();
                      break;

                      case reg:
                      $Register->Register_page();
                      break;

                      case log:
                      $Login->Login_page();
                      break;

                      case frm:
                      switch( $do )
                      {
                      default:
                      $Forums->Forums_page();
                      break;
                      }
                      break;

                      case blg:
                      switch( $do )
                      {
                      default:
                      $Blogs->Blogs_page();
                      break;
                      }
                      break;

                      case grp:
                      switch( $do )
                      {
                      default:
                      $Groups->Groups_page();
                      break;
                      }
                      break;

                      case msg:
                      switch( $do )
                      {
                      default:
                      $Mail->Mail_page();
                      break;
                      }
                      break;

                      case mym:
                      switch( $do )
                      {
                      default:
                      $MyMenu->MyMenu_page();
                      break;
                      }
                      break;

                      case frn:
                      switch( $do )
                      {
                      default:
                      $Friends->Friends_page();
                      break;
                      }
                      break;

                      case usr:
                      switch( $do )
                      {
                      case vup:
                      $ViewUser->ViewUser_Page();
                      break;
                      default:
                      $User->User_page();
                      break;
                      }
                      break;

                      case cht:
                      switch( $do )
                      {
                      case vct:
                      $Chat->ViewChat_page();
                      break;
                      case wtc:
                      $Chat->WriteToChat_page();
                      break;
                      default:
                      $Chat->Chat_page();
                      break;
                      }
                      break;

                      default:
                      $Errors->Error_npg();
                      break;
                      }

                      ?></div>

                      i dnt have a problem with u either but i dnt like the way u tag every script as lavalair when everyone else already know.

                      Comment


                        #12
                        i dnt have a problem with u either but i dnt like the way u tag every script as lavalair when everyone else already know.[/b]
                        i dont come here to pussy foot around everyone the saying "i am what i am and i do what i do" comes to mind
                        and i hate ppl who think they can pass the script off as thier creation like this idiot methos does and a few other of a small minoritory site owners like arawap.net/pamod.net/forestfun.net/ list goes on.. who give me **** on my own site because of it but everyone else i have no problem at all with if i did why the hell am i sitting here as a mod watching ppl release/edit/sell/ and spam the script and do **** all about it?

                        if most ppl would show the script the respect it deserves since so many ppl use the dam thing id be less arrogant and more pro-active in sharing my versions and mods of it including the beta for the new script which i would share but im only willing to share the crap i used to work on since i have only a small amount of trust to a few ppl here

                        plus you would be so protective and what not if roles were reversed

                        anyways none of that matters to this thread does it?

                        Comment


                          #13
                          indeed it is[/b]
                          lol hehe

                          Comment


                            #14
                            Thanx 4 da c0ding..

                            Comment


                              #15
                              anybody can give me total online time for funmobile??thanks..

                              Comment

                              Working...
                              X