get_users
{get_users} is used to include your desired users into the array. You have handful of parameters at your disposal.
Usage
1
{get_users parameters}
Copied!
It can use following parameters
Parameter Name
Options
assign
Store the result(Array) to this variable
ban
Check user ban status:
  • yes
  • no
category
Specific category users. Multiple categories should be separated with comma ‘,’:
  • Category ID.
count_only
Set to true if you only want to count result:
  • true
  • false
date_span
Get users for specific time frame:
  • all_time
  • today
  • yesterday
  • this_week
  • last_week
  • this_month
  • last_month
  • this_year
  • last_year
email
Get user of provided email:
  • User Email
exclude
Exclude user from result:
  • User ID
featured
Get featured users:
  • yes
  • no
gender
Get users of specific gender:
  • female
  • male
level
Get users of specific level:
  • Level ID
limit
Number of results you want:
  • Numercial Figure
order
Sort your result. You also need to tell how to order your result. asc OR desc, e.g ‘username desc’
  • userid
  • username
  • usr_status
  • ban_status
  • sex
  • doj
  • profile_hits
  • subscribers
  • rating
  • total_videos
  • total_groups
  • featured_date
status
Check your user status:
  • Ok
  • ToActivate
userid
Get user of provided ID:
  • User ID
username
Get user of provided username:
  • Username

Examples

Example 1
1
{get_users assign=month_users date_span="this_month " status="Ok" order=" doj asc"}
Copied!
Above code will get users of current month but only those with status of “Ok” and order according to their date-of-joined from oldest to latest. Function returned an array which is stored in {$month_users} variable. Time to loop through array and display our users.
1
{section name=mon_urs from=$month_users}
2
{include file="$style_dir/blocks/user.html" user=$month_users[mon_usrs]}
3
{/section}
Copied!
[post_link id=”199″] and [post_link id=”237″]
Example 2
1
{get_users assign=featured_user limit=1 featured="yes" order=RAND()}
Copied!
This code will get 1 featured user randomly out of all featured users. To display see following code
1
{section name=feat_user from=$featured_user}
2
{include file="$style_dir/blocks/user.html" user=$featured_user[feat_user]}
3
{/section}
Copied!
Loading...
Last modified 12d ago
Copy link