Firefox PHP

Module: Top Users

Posted by Steve Healy 
All files from this thread

File Name File Size   Posted by Date  
topusers-2.0.3.tar.gz 4.9 KB open | download Steve Healy 02/05/2008 Read message
topusers-2.0.3.zip 7.7 KB open | download Steve Healy 02/05/2008 Read message
turkish.php 501 bytes open | download scabboy 02/07/2008 Read message
czech.php 592 bytes open | download timqui 07/22/2009 Read message
danish.php 519 bytes open | download sif4ever 09/09/2010 Read message
italian.php 506 bytes open | download Nicola 06/20/2011 Read message
Module: Top Users
February 01, 2008 12:50AM
This module implements an addon page, which displays a list of user statistics which can be ordered in various ways.

Created by Thomas Seifert, Amilcar do Carmo Lucas (update), and Steve Healy (rewrite)

Language files needed: If you want to help out here, then please create your language file of choice with the strings from english.php and upload the new file in this thread.

(This is my first stab at a module, re-writing the old add-on and borrowing heavily from Maurice's work! I'm standing on the shoulders of giants.)
Changelog:
----------

2008-02-05 v2.0.3

    - The HTML title is now set to "Top Users" when the user is browsing
      the recent messages. Thanks to Phorum user "hcgtv" for the suggestion.

2008-02-04 v2.0.2

    - Changed the user_id search to retrieve only those users we need,
      to improve performance

    - Added paging functionality so you can browse the entire user list,
      regardless of size

    - Added the missing short_time variable to the language file

      *thanks to Maurice Makaay for all these suggestions*

    - Added language files for German, Dutch, and Dutch informal,
      thanks to Hiiri and Maurice Makaay

2008-01-31 v2.0.1

    - Fixed the column heading links in topusers.tpl to sort properly

2008-01-31 v2.0.0

    - Initial release.  Rewrite of old quasi-module and add-on page.

    - Added new sort options by name, date added, and date last active

    - Added storage of user preferences borrowed from Recent Messages Module

...
Steve Healy, Phorum hacker, currently on: (version 5.2.19)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)




Edited 4 time(s). Last edit at 02/05/2008 10:20AM by mmakaay.
Attachments:
open | download - topusers-2.0.3.tar.gz (4.9 KB)
open | download - topusers-2.0.3.zip (7.7 KB)
Re: Module: Top Users
February 01, 2008 10:07AM
I attached a translation into german.
(updated)

mmakaay: Removed the language file from the message, since it's now in the module distribution.



Edited 2 time(s). Last edit at 02/04/2008 09:12PM by mmakaay.
Re: Module: Top Users
February 01, 2008 11:29AM
Cool! A lot of admins will find this a useful module.

Included you find some language files. Two Dutch ones and a fixed english.php. An updated English one, because the "short_time" variable is not defined by Phorum. In the recent messages module, it is defined in the language files too. You have that module enabled as well, causing the variable to be available to your module. The updated english.php has the "short_time" variable in it.

Some additional remarks:

- PercentOfPosts is in the language file, but it is not used in the code.

- You retrieve a full list of users and do processing on that one. While this works for forums without a lot of users, this will hurt big forums. We have seen this with the user admin as well, which sometimes would hit the PHP memory limits on some systems (this has been fixed). For more performance and scalability, I'd like to advice you to look into the $sort, $offset and $length parameters of the phorum_api_user_search() API function. I think that by using those, you can retrieve only the users that you will display on the page.

- Once you use the $offset functionality, you could also enable page browsing like I did in the recent messages module. The method I use there is to retrieve (number of items to show + 1) items from the database. If I have retrieved that number of items, then it means that there is at least one more page to show and I present an "Older messages" link at the bottom of the page.

Removed the language pack, since it's now in the module package.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 1 time(s). Last edit at 02/04/2008 09:11PM by mmakaay.
Re: Module: Top Users
February 01, 2008 05:10PM
Quote
mmakaay
Cool! A lot of admins will find this a useful module.

Included you find some language files. Two Dutch ones and a fixed english.php. An updated English one, because the "short_time" variable is not defined by Phorum. In the recent messages module, it is defined in the language files too. You have that module enabled as well, causing the variable to be available to your module. The updated english.php has the "short_time" variable in it.

Thanks. Looks like you forgot to attach them though.

Quote

Some additional remarks:

- PercentOfPosts is in the language file, but it is not used in the code.

Ah yes. I left out that column. I felt that it was unnecessary and would require additional processing. It could be added back in if there was demand for it. Maybe if I was really ambitious I could even add an options page with selectable columns to display. *grin*

Quote

- You retrieve a full list of users and do processing on that one. While this works for forums without a lot of users, this will hurt big forums. We have seen this with the user admin as well, which sometimes would hit the PHP memory limits on some systems (this has been fixed). For more performance and scalability, I'd like to advice you to look into the $sort, $offset and $length parameters of the phorum_api_user_search() API function. I think that by using those, you can retrieve only the users that you will display on the page.

- Once you use the $offset functionality, you could also enable page browsing like I did in the recent messages module. The method I use there is to retrieve (number of items to show + 1) items from the database. If I have retrieved that number of items, then it means that there is at least one more page to show and I present an "Older messages" link at the bottom of the page.

Thanks for the feedback and advice. I will look into it next week.

...
Steve Healy, Phorum hacker, currently on: (version 5.2.19)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
Re: Module: Top Users
February 01, 2008 05:30PM
Quote
stevehealy
Thanks. Looks like you forgot to attach them though.

Heh, too-busy-with-regular-work-error.
I attached the pack to my previous message.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Top Users
February 01, 2008 09:02PM
I attached a "fixed" german translation to my previous post too.
Re: Module: Top Users
February 04, 2008 08:12PM
I've uploaded a new version, incorporating all suggestions and contributions to-date.

Enjoy!

...
Steve Healy, Phorum hacker, currently on: (version 5.2.19)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
Re: Module: Top Users
February 04, 2008 09:16PM
Damn, this means I got nothing left to complain about ...
Well done Steve! :-)


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Top Users
February 04, 2008 10:51PM
Ok i got one for ya...could this be adapted for a 'top threads' module?
Re: Module: Top Users
February 04, 2008 11:23PM
That would more likely be an extension or adaption of the Recent Threads module than the Top Users module, since that one has all the functionality on board for displaying messages in a list.

BTW: Do you really want a list of top threads? They are often the most sucky ones in my experience. I have "hot threads" on my own website, which is more useful in most cases. Especially for new users to see what is the current chat status of the forum. Feel free to discuss further on this in the recent messages module thread.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login