1
marcv
Module/block which displays how many users were online today
  • 2008/9/6 9:34

  • marcv

  • Just popping in

  • Posts: 13

  • Since: 2006/5/18


Good day,

I am looking for a module which is able to display how many users were online today in a block.

Does anyone know?


Greetings,


Marc

2
marcv
Re: Module/block which displays how many users were online today
  • 2008/9/7 21:18

  • marcv

  • Just popping in

  • Posts: 13

  • Since: 2006/5/18


Nobody?

3
dslchart
Re: Module/block which displays how many users were online today
  • 2008/9/7 21:26

  • dslchart

  • Not too shy to talk

  • Posts: 112

  • Since: 2008/9/7 1


the XOOPS module logcounterx can display online users today.

4
ghia
Re: Module/block which displays how many users were online today
  • 2008/9/8 10:15

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


For registered users you can do this:
Make a custom block and select PHP code and use:
include_once XOOPS_ROOT_PATH.'/include/functions.php';
global 
$xoopsConfig;
$db =& Database::getInstance();
$bresult $db->query("SELECT COUNT(*) FROM ".$db->prefix("users")." WHERE last_login >= UNIX_TIMESTAMP(CURDATE())");
list (
$numrows) = $db->fetchRow($bresult);
if ( 
$numrows >= 
{
  echo 
"Already '.$numrows.' visitors today.";
}
else
{
  echo 
"No users today";
}

5
trabis
Re: Module/block which displays how many users were online today
  • 2008/9/8 11:32

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


You can also use XOOPS api:

$member_handler =& xoops_gethandler('member');
$days 1;
$time time() - (60 60 24 $days);
$criteria = new Criteria('last_login'$time'>');
$total $member_handler->getUserCount($criteria);
if ( 
$total >= 
{
  echo 
"Already ".$total." visitors today.";
}
else
{
  echo 
"No users today";
}

6
marcv
Re: Module/block which displays how many users were online today
  • 2008/9/8 17:46

  • marcv

  • Just popping in

  • Posts: 13

  • Since: 2006/5/18


Wow, that's perfect guys! The code is exactly what I need, I am very happy with it! The code will give me even more possibilities to show other data now I know how it is (basicly) build. I have to learn, but I already know some php code.

I will also try the logcounterx module.

Many thanks and greetings from Holland!


Marc

7
KrisSwe
Re: Module/block which displays how many users were online today
  • 2008/9/8 18:56

  • KrisSwe

  • Just popping in

  • Posts: 4

  • Since: 2008/1/3 5


This was cool indeed.
can i make a little suggest and that is to have all membernames in the block who have visit too..

Best regards Chris

8
KrisSwe
Re: Module/block which displays how many users were online today
  • 2008/9/8 19:00

  • KrisSwe

  • Just popping in

  • Posts: 4

  • Since: 2008/1/3 5


This was cool indeed.
can i make a little suggest and that is to have all membernames in the block who have visit too..

Best regards Chris

9
demian
Re: Module/block which displays how many users were online today
  • 2009/2/1 1:36

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


Bump

Quote:
This was cool indeed.
can i make a little suggest and that is to have all membernames in the block who have visit too..



would be cool to have this...list of members online today

if i'm not mistaken arabxoops.com have this feature..

mowaffak can you share this ?

10
hipoonios
Re: Module/block which displays how many users were online today
  • 2009/2/1 10:52

  • hipoonios

  • Friend of XOOPS

  • Posts: 298

  • Since: 2005/9/24


Quote:
can i make a little suggest and that is to have all membernames in the block who have visit too..


+1
I love Xoops!

Login

Who's Online

390 user(s) are online (273 user(s) are browsing Support Forums)


Members: 0


Guests: 390


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits