list_members
Usage: array list_members ([array options])
Purpose: Lists the board's members.
Availability: IPB SDK 1.0
Purpose: Lists the board's members.
Availability: IPB SDK 1.0
Returns an array with details on members following the options given in the options array. The options array accepts:
- group - Groups to return members from (Should be * for all groups or an array of groups)
- start - Record to start at (Default: 0)
- limit - Records to return (Default: 30)
- orderby - What to order records by ("id", "name", "posts", or "joined")
- order - asc or desc for ascending and descending.
User Contributed Notes
CODE |
// Start and Limit if ((int)$options['start'] > 0 && (int)$options['limit'] > 0) { $filter = 'LIMIT ' . intval($options['start']) . ',' . intval($options['limit']); } else { $filter = ''; } |
CirTap
Pita
whatever you do, make sure that you remember that 'groups' needs to be an array (or "*"), even if you only want one group
Documentation Generated at Sat, 16 Apr 2005 07:36:35 -0700
Find the latest version at http://ipbsdk.sourceforge.net
ossipetz
limit - Records to return (Default: 30)
this isnt that clever since there is no list_all_members function. one would have to determine the number of users first to set good value here (beside using 100000000 or something)
CirTap
the aim of this function is to create prev/next pages with only a certain amount of members on each.
presuming the mainscript gets the &limit as an URL argument it would just need to call the function like this in order to provide a next/prev links:
$limit = 20;
$start = (isset($_GET['page'])) ? (int)$_GET['page'] * $limit: 0;
call list_members() with $start and $limit in the options.
to get the max number of members in order to have a "all members" page, you can still do a
SELECT count(id) from ibf_members
and use the result for $limit.
You may also patch the function and add a little condition to the start/limit parameters, e.g. use -1 for both to ommit the LIMIT directive in the SQL: