1
vinit
How to show the count of registered members on homepage?
  • 2004/9/19 19:03

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


Hi i want show the following details on homepage with help of a module.

1. Active members
2. Incactive members.
3. Total number of members visited on a given day.
4. Number of members not visited in last 30 days and many such information about members in a module. Do we have any such module available. if now can anyone tell me what queries we need to do to get those datas, i will try to add a module with those datas. Thanks in advance for all your help endevaoured in this regard.

2
wcrwcr
Re: How to show the count of registered members on homepage?
  • 2004/9/19 19:12

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Any of the stats modules don?t have any of these functions?

3
Bender
Re: How to show the count of registered members on homepage?
  • 2004/9/19 22:49

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Use the search and check only into threads not older than 3 weeks. I am pretty sure someone from the regular posters mentioned at least some of this being in one module.

If memory serves me well it was in a thread about the who´s online block. Not too sure though ...

4
vinit
Re: How to show the count of registered members on homepage?
  • 2004/9/21 7:18

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


searching for it hopefully will get it somewhere.. meanwhile if you get the link do post it back here or pm me thanks in in advance.

5
Mithrandir
Re: How to show the count of registered members on homepage?

$member_handler =& xoops_gethandler('member');
$total_active_users $member_handler->getUserCount(new Criteria('level'0'>'));
$total_inactive_users $member_handler->getUserCount(new Criteria('level'0'='));
$users_within_thirty_days $member_handler->getUserCount(new Criteria('last_login'time()-(30*24*3600), '>='));
$users_with_more_than_thirty_days $member_handler->getUserCount(new Criteria('last_login'time()-(30*24*3600), '<'));

6
iolai
Re: How to show the count of registered members on homepage?
  • 2004/9/21 10:53

  • iolai

  • Quite a regular

  • Posts: 206

  • Since: 2004/6/26


Could you provide more information about the "Criteria('level', 0, '>')" part? IE explain it...

7
solo71
Re: How to show the count of registered members on homepage?
  • 2004/9/21 11:54

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


Blockutils in the Wolf XOOPS Pack.


8
ackbarr
Re: How to show the count of registered members on homepage?

Criteria is an object provided by the core to specify which records to retrieve. It has a big brother in the CriteriaCompo object.
Most database handlers provided in XOOPS utilize these objects to provide a consistant mechanism of retrieving records from the db.
The code:
new Criteria('level'0'>')

creates a new criteria object and passes 'level', 0, and '>' as parameters to the object's constructor function.

Simply we are telling the database to return the number of user records WHERE level > 0. Those that have worked with SQL queries in the past will be familiar with this construct. XOOPS stores a value in the {your_prefix}_users table, level, with the following values:
0 - user has registered but not confirmed registration
1 - user has confirmed registration





9
iolai
Re: How to show the count of registered members on homepage?
  • 2004/9/21 14:17

  • iolai

  • Quite a regular

  • Posts: 206

  • Since: 2004/6/26


Ahh, thank you very much!

Another question. I want to make a table in which I show the following data:

User name | User rank

This code will retrieve all the active users:
$member_handler =& xoops_gethandler('member');
$total_active_users = $member_handler->getUserCount(new Criteria('level', 0, '>'));

How do I create and display the code that will display all the users?

10
ackbarr
Re: How to show the count of registered members on homepage?

well getUserCount only returns the count of users, but
$users =& $member_handler->getObjects(new Criteria('level'0'>'));

will return all the user objects for users that are active. Then you can loop through the returned users like so:
foreach($users as $user) {
  echo(
$user->getVar('uname') . ' | ' $user->getVar('rank') . '<br />');
}

Login

Who's Online

179 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 179


more...

Donat-O-Meter

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

Latest GitHub Commits