PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
get basic information on all users
array pnUserGetAll();
pnUserGetAll() obtains a set of basic information on all active users in the PostNuke system.
pnUserGetAll() is deprecated but still functional in this version of the PostNuke API. You shouldn't use it, since it'll be removed when PostNuke will reach the 1.0 version. Instead you are strongly encouraged to use the users module API getall function: $users = pnModAPIFunc('users', 'user', 'getall');
This function returns an array of associative arrays. The array elements are referenced by UID for quick access to information on a specific user. Each array corresponds to a particular user, and has the following array members:
The user name of the user
The user ID of the user
The full name of this user
The email address of this user
The URL of this user
The avatar of this user
Only the uname and uid fields of each array are guaranteed to be populated; the other items may be empty.
// Get all users
$allusers = pnUserGetAll();
// Display username and uid for each user
foreach ($allusers as $user) {
echo "User ID $user[uid] has user name $user[uname]\n";
}
// Display name for uid 5
echo "User ID 5 is called {$allusers[5]['name']}\n";
Previous |
Next |