1
serena
Usercount
  • 2006/2/14 13:05

  • serena

  • Just popping in

  • Posts: 6

  • Since: 2005/3/13


Hi!
I've searched XOOPS for a module to put on the frontpage that counts the number of users in different groups.

I'd like the module to look like this:

---

Usergroup 1: 50
Usergroup 2: 54
Usertotal: 104

New this week: 1
New this mount: 5
New this year: 30

---

This information would be in a block on the frontpage. And of course it would change automatically.

I don't know how to do this myself. I guess you can take this information from the database somehow?

It also would be a good idea to make different languages to this module, since my homepage is in swedish. But the default should of course be in english, so more people can use it.

Thanks!

2
hervet
Re: Usercount
  • 2006/2/16 15:05

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Here is a part of the answer, create a personalized bloc (type = Php) and paste this code :
$member_handler = & xoops_gethandler('member');
    
$group_list $member_handler->getGroupList();
    foreach(
$group_list as $group_id => $group_name) {
        
$users_count $member_handler->getUserCountByGroup($group_id);
        echo 
"
"
.$group_name." : ".$users_count;
    }

3
serena
Re: Usercount
  • 2006/2/17 10:51

  • serena

  • Just popping in

  • Posts: 6

  • Since: 2005/3/13


Thank you so much for the code, hervet! Is there any way I can modify the code so it's not counting all of the groups? Some of them are hidden.
Do you know how to get usertotal, new this week, and new this year? If you do, that would be great! :)

Login

Who's Online

327 user(s) are online (230 user(s) are browsing Support Forums)


Members: 0


Guests: 327


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