ListUsers Module
nav_first.pngFirst: thread:131
HTML Block
Edited: 11 Oct 2012 12:06 by: James Kanjo
Comments: 0
Tags:
nav_prev.pngPrevious: thread:347
PerPage personal setting stored in cookie
Edited: 06 Apr 2010 06:37 by: leiger
Comments: 0
Tags:
Last: thread:112
Image Module
Edited: 12 Nov 2009 12:22 by: pieterh
Comments: 0
Tags:
nav_last.png
Next: thread:158
Automatic code replacement
Edited: 19 Mar 2010 11:23 by: leiger
Comments: 0
Tags:
nav_next.png

Steven HeynderickxSteven Heynderickx wrote on 10 Nov 2009 15:51

This is a design sketch for the ListUsers module, which provides a way to list the users who participate in some way in a site. It was based on James KanjoJames Kanjo's design.

The ListUsers module is a general-purpose tool that selects and display users who participate in a site.

To use ListUsers, you decide some or all of:

  • what users to select
  • how to order the results (ascending, descending)
  • how to break the output into blocks (pagination)
  • how to display the results as Wikidot text (templating)
  • how to export the results as an RSS feed

The general syntax for ListUsers is:

[[module ListUsers arguments...]]
template
[[/module]]

By default, ListUsers will show all participants in the site, from most recent to oldest.

Examples

Recent active users in a site

This example lists the users in the site, along with details of when their last activity:

[[module ListUsers separate="no" limit="1000"]]
%%title_linked%% - %%activity_at%%
[[/module]]

In action:

Currently only users="." is implemented.

Current user

This example tells you what your username and User ID number is. The output changes for each user that sees it.

[[module ListUsers users="."]]
Hello %%title%%, you are the %%number%%th user to join Wikidot!
[[/module]]

In action:

Naming conventions

Argument names are in_lower_case. Dates are always something_at and user names are always someone_by. Linked fields are always somefield_linked.

Selecting users

Specify one or more of these selectors to refine the set of users you select. Each selector adds additional constraints:

Argument Meaning
users Comma separated list of users to filter from
usertype Select by type of user
lastactivity Select by current presence
karma Select by karma level
scope Select by page scope
tags Select by page tags
parent Select by parent page
rating Select by rating
offset Select by offset

Users selector:

  • "*" meaning all users (default)
  • "." means current user (the one that views the page)
  • when naming certain users use their name written in lower case replacing spaces and other special characters with "-"

User type selector:

  • "*" means all participants in the site (default)
  • else, a list of space/comma delimited keywords:
    • "tourist" selects all non-member contributors to the site
    • "member" selects all ordinary members of the site
    • "moderator" selects all moderators of the site
    • "admin" selects all administrators of the site
    • "watcher" selects watchers within a certain scope
    • "editor" selects editors within a certain scope

Lastactivity selector:

  • 0 means all users (default)
  • "n" means selects only users who have been active in last "n" minutes

Karma level selector:

  • Relates to the karma level as outlined in the documentation
  • "n" means selects only users with that karma level
    • 0 - none
    • 1 - low
    • 2 - medium
    • 3 - high
    • 4 - very high
    • 5 - guru
  • ">n" means selects only users who have karma greater than level n
  • "<n" means selects only users who have karma less than level n

Page-related selectors:

The scope, tags, parent and rating selectors have a meaning when the usertype selector includes "editor" or "watcher". When you specify any of these selectors, it selects editors and/or watchers of the selected pages. These selectors have the same syntax as used in the ListPages module.

The scope selector takes the format 'category:' or 'category:page' or '.', meaning current page.

Offset selector:

  • "n" means do not show the first n users (default is 0)

Ordering users

To order the users, use:

Argument Meaning
order Specify order criteria

Order criteria:

  • "property" means "ascending by this property"
  • optionally followed by " desc" meaning "descending"
  • optionally followed by " desc desc" meaning "ascending", which makes "desc" safe to add after any sort order
  • default is "created_at desc"
Property Meaning
number Order by user number (default)
name Order by user name
edits Order by number of pages created or updated
comments Order by number of comments
activity Order by edits + comments
random Order randomly, cached for 60 seconds
karma Order by karma level

Note that "property asc" is not allowed and unknown order criteria give you the default order, which is "number".

Pagination

To control how many users will be shown in total, and how these are paginated, use any of:

Argument Meaning
limit Limit total users shown
perpage Limit number of users displayed per page
reverse Show users in reversed order

Total limit:

  • "number" - means limit the total number of selected users.
  • default and maximum is 250.

Pagination limit:

  • "number" - means limit the number of user items shown on per pagination.
  • default is 20.

Reversed display:

  • "yes" - means show users from last to first. This is equivalent to inverting the sort order (adding or removing 'desc' from the 'order' argument).

Header and Footer

ListUsers conforms/will conform to the Standard List Header and Footer specification.

Template properties

ListUsers conforms/will conform to the Standard Template Properties specification.

This module also supports the following additional template properties:

Property Meaning
title User name (overload ListPages' definition)
name User name
number User number
karma User karma level
edits Order by number of pages created or updated
comments Order by number of comments
activity Order by edits + comments

Advanced Use

This section describes additional functionality that will be useful for advanced users.

ListUsers supports the same mechanisms as ListPages for:

  • Exporting the results as an RSS feed
  • Passing arguments via URL
  • Using multiple modules in a single wiki page

Start a new sub-thread

What about counting users???? By Brunhilda 3 Comments 14 May 2010 08:58
This design is nonsense By James Kanjo 1 Comments 12 Mar 2010 23:45
Page Template with Profile By tsangk 2 Comments 05 Jan 2010 00:51
Not working through Live Template By leiger 6 Comments 01 Jan 2010 22:11
Listusers in profile:page By Steven Heynderickx 5 Comments 30 Dec 2009 13:55
Liveness Selector By Ed Johnson 4 Comments 22 Dec 2009 13:12
Documentation needs minor adjustment (closed) By Steven Heynderickx 1 Comments 05 Jan 2010 10:45
current="true", examples (closed) By Gabrys 14 Comments 21 Dec 2009 19:14
Design sketch rebuilt from ground up (closed) By pieterh 1 Comments 24 Nov 2009 12:39
Contributors vs. Users (closed) By pieterh 1 Comments 12 Nov 2009 13:35

We discourage direct comments on this thread: to discuss it, please start a sub-thread.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License