Methos Total Time Online

Started on the old forum in November 2007 · view the original in the archive · old links redirect here

24 replies · 1,892 views · started 19 years ago · 1 min read

6 participants
methos1 #1

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 <'".$timeout."'"); ///now try to add user to online list $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")."'");
      }

} 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 <'".$timeout."'");

///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='".$uid."'")); $tolsla = time() - $lastactive[0]; $totaltimeonline = mysql_fetch_array(mysql_query("SELECT tottimeonl FROM ibwf_users WHERE id='".$uid."'"));
$totaltimeonline = $totaltimeonline[0] + $tolsla; $res = mysql_query("UPDATE ibwf_users SET tottimeonl='".$totaltimeonline."' WHERE id='".$uid."'");

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

}

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='".$who."'")); $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.

methos1 #3

no problem

Guest #4

THNX methos.

amylee Principal · 1,092 posts #5

methos wap script lmfao its LAVALAIR script

methos1 #6

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

amylee Principal · 1,092 posts #8

indeed it is

amylee Principal · 1,092 posts #10

http://mobilelife.tk

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

i havnt got a problem with you so no but hey shit can happen

wizard Senior · 493 posts #11

i havnt got a problem with you so no but hey shit can happen

lol yea rite shit can happen. not a soul can shut down my site sayin dat i'm using their script or a copy of it. my script is coded 101% by me. CODE<?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;
}

?>

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.

amylee Principal · 1,092 posts #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.

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 shit 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 fuck 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?

Guest #13

indeed it is

lol hehe:)

Guest #14

Thanx 4 da c0ding..

alexism Developer · 136 posts #15

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

alesh Lead · 604 posts #16

btw 2 those who has a validation on the site... add this lastact='".time()."' to the core.php , function register

otherwise new users will have 13000, and more, days online time lol

eeeeerrr....

ori Lead · 512 posts #18

well i can truely say i wouldnt know as much as i do bout php if it werent 4 the lavalair scripting and i now have my own ways of coding php and am so glad 2 be away from perl/cgi as it used 2 shit me off stupid 500 errors lol if so many ppl havnt had the script i would used the lavalair rather then making my own alot ppl think mine is lavalair but all i took was ideas but hey each to there own i hav legit copyright and i ca bet 90% the ppl out there classing the lavalair edits as there script would hav no real copyright at all but copyright only reali is there to protect a script and if any1 wants 2 hack me go ahead cos i protected my script i wnt say how bt it cant be used on any other server then mine ;o)

alesh Lead · 604 posts #19

well i can truely say i wouldnt know as much as i do bout php if it werent 4 the lavalair scripting and i now have my own ways of coding php and am so glad 2 be away from perl/cgi as it used 2 shit me off stupid 500 errors lol if so many ppl havnt had the script i would used the lavalair rather then making my own alot ppl think mine is lavalair but all i took was ideas but hey each to there own i hav legit copyright and i ca bet 90% the ppl out there classing the lavalair edits as there script would hav no real copyright at all but copyright only reali is there to protect a script and if any1 wants 2 hack me go ahead cos i protected my script i wnt say how bt it cant be used on any other server then mine ;o)

WTF?

and whts tht has 2 do with this topic?????

eeeeerrr....

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