Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2020-05-13 08:55:15

g0dz
Member
Registered: 2018-04-09
Posts: 18

Website login counter every 24 hours.

I want to display stats for admins, stats like "Website logins 24H"
So every 24h it resets the value with how many people logged in that day
Would that be possible to outright just add into the code or easier with a plugin maybe?


Not too experienced, but if anyone could help me out with this simple request, i'd appriciate it alot.

Regards, g0dz.

Offline

#2 2020-05-13 09:08:28

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,383
Website

Re: Website login counter every 24 hours.

your.forum.link/admin_users.php?last_visit_after=-24+hours&order_by=last_visit&direction=DESC&find_user=1

Last edited by Visman (2020-05-13 09:08:48)

Offline

#3 2020-05-13 09:12:09

g0dz
Member
Registered: 2018-04-09
Posts: 18

Re: Website login counter every 24 hours.

Visman wrote:
your.forum.link/admin_users.php?last_visit_after=-24+hours&order_by=last_visit&direction=DESC&find_user=1

I want to display it for admins under "Logged in as admin"


Like this:


Website logins 24H: (AMOUNT)


Thanks.

Offline

#4 2020-05-13 09:52:14

g0dz
Member
Registered: 2018-04-09
Posts: 18

Re: Website login counter every 24 hours.

Visman wrote:
your.forum.link/admin_users.php?last_visit_after=-24+hours&order_by=last_visit&direction=DESC&find_user=1

Wouldnt it be possible to use the link you provided in php? Then count the row results of how many users and update the number and set a timer for it, 24 hours maybe.

Offline

#5 2020-05-14 03:45:27

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,383
Website

Re: Website login counter every 24 hours.

$result = $db->query('SELECT COUNT(u.id) FROM '.$db->prefix.'users AS u WHERE u.id>1 AND u.last_visit>'.(time()-86400)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);

Offline

Board footer

Powered by FluxBB