Jump to content
MakeWebGames

[mccode] online/offline/total users


Tonka

Recommended Posts

  • 4 weeks later...

Re: online/offline/total users

 

how so?

It could cause lag, as its performing them queries every time someone stumbles upon your login.php, one of your most visited pages, plus this page is open to the public and could be constantly hit on to cause the database to go crazy.

Link to comment
Share on other sites

  • 1 month later...

Re: online/offline/total users

Can you mod this code for V1 lite? :mrgreen:

$sql = "SELECT COUNT(userid) FROM users";

$rs = mysql_query($sql);

$row = mysql_fetch_array($rs);

$total_users = $row[0];

$sql = sprintf("SELECT COUNT(userid) FROM users WHERE (laston > %u)", time() - 900);

$rs = mysql_query($sql);

$row = mysql_fetch_array($rs);

$users_online = $row[0];

$users_offline = $total_users - $users_online;

Link to comment
Share on other sites

  • 3 weeks later...

Re: online/offline/total users

Yes you can,

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add Below

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and then just add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

where every you want it to be displayed

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...