Company | Newzulu Platform | Developer

Developer Template Documentation v4.12.4.15

fm:UserPrevious


Makes information about the previous user from a user list available.

Example

<fm:UserPrevious groupId="123"> <fm:Loop> <h1>Previous user:</h1> <a href="/profile/{$$user.id}?{$$user.filterString}">{$$user.user}</a><br /> </fm:Loop> <fm:NoResults> <h1>At start of user list</h1> </fm:NoResults> </fm:UserList>

This component is intended to be used within a template arrived at from a user list component. It will accept the same filters and sorting options as a user list and make available details about the previous user in that list.

All attributes from the fm:UserList component are supported with the exception of "pageSize" and "startPage". These supported attributes may also be set via GET variables (the query string). Any values filters or sorting set via attributes will override the same parameters within GET variables. This allows the developer to have this component only show the previous user matching specific filters without allowing the end user to bypass the filtering.

Supported attributes

NameRequiredDefaultDescription
accounttypeOptionalFilters based on the account type
activeOptionalnoneFilters the results based on whether the users are active or not.
Supported values are either 'true' (users with active accounts) or 'false' (users with non-active accounts). Leave out to get users with active and non-active accounts
assignmentNotificationOptionalnoneFilters based on the notifications enabled, either 0 or 1
cityOptionalFilters based on the city
countryOptionalFilters based on the country
deviceGeoCenterOptionalnoneLatitude,Longitude center point to be used with deviceGeoDistance
deviceGeoDistanceOptionalnoneDistance in meters user can be from the deviceGeoCenter location
disabledOptionalnoneFilters the results based on whether the users have their accounts disabled or not.
Supported values are either 'true' (users with disabled accounts) or 'false' (users with non-disabled accounts). Leave out to get users with disabled and non-disabled accounts
emailOptionalFilters based on the email address
evenClassOptionalThe contents of this attribute will be placed in the 'loop.evenClass' template variable, only for even row-numbers. This allows you to give every even row a specific css class
fieldsOptionalSee belowComma-separated list of fields you'd like to use. See below for a list of supported fields
firstnameOptionalFilters based on the first name
genderOptionalFilters based on the gender
groupIdOptionalnoneOnly return users in the specified group
lastnameOptionalFilters based on the last name
occupationOptionalFilters based on the occupation
oddClassOptionalThe contents of this attribute will be placed in the 'loop.oddClass' template variable, only for odd row-numbers. This allows you to give every odd row a specific css class
schoolOptionalFilters based on the school
sortOptionalcreated DESCSortfield. You can currently sort on id, user, firstname, lastname, friends, publicfiles, nickname, city, country, gender, email, unmoderatedfiles, approvedfiles, deniedfiles, active, lastlogin and created. By default this component will sort Descending, to sort Ascending use for example 'friends ASC'
stateOptionalFilters based on the state
userOptionalFilters based on the username

The following fields for the 'fields' attribute are supported:

Template variables

NameDescription
loop.hasResultsThe contents of this variable will be either 0 or 1, depending on if there are items in the list.
loop.oddClassThe contents of this variable will reflect the "oddClass" attribute. This will only be set for odd rownumbers.
loop.evenClassThe contents of this variable will reflect the "evenClass" attribute. This will only be set for even rownumbers.
loop.indexThe 0-based index of the item in the loop. (Will contain 0,1,2,3,4, etc.)
loop.countThe count of the current item in the loop. (Will contain 1,2,3,4,5 etc.)
loop.currentPageIf a pager is involved in this loop, this will contain the current page number (0-based index). If page information is not available, this will be 0.
loop.currentPage1This value is currentPage + 1. This number can be useful to display the current page number to use user. (people generally count from 1, not 0).
loop.totalPagesTotal number of pages avaiable in this loop. This will be 0 if the loop does not support paging.
loop.totalItemsTotal number of individual items. This will be 0 if the loop does not support paging.
loop.pageSizeTotal number of items on 1 single page. This will be 0 if the loop does not support paging.
user.userThe username
user.emailUser's email address
user.firstnameUser's given name
user.lastnameUser's family name
user.address1Address line 1
user.address2Address line 2
user.cellphoneUser's cellphone number
user.phoneUser's homephone number
user.cityUser's city
user.countryUser's 2-letter country code
user.createdCreated date and time
user.friendsNumber of friends
user.geo_latitudeThe user's latitude
user.geo_longitudeThe user's longitude
user.idThe user's unique id
user.metaThe user's meta-data (an array). Its values are configurable in the user profile page. Because the user's metadata is configurable, its variables differ for each user.
Sample user_metadata variables for the templates are:
  • {$$user.meta.lang} - the user's metadata language
  • {$$user.meta.twitterUserName} - the user's metadata twitter username
  • {$$user.meta.rules} - the user's rules
user.json_metaThe User's meta-data represented as a json object.
user.descriptionThe user's description
user.genderThe user's gender
user.websiteThe user's website
user.occupationThe user's occupation
user.nicknameThe user's displayname/nickname
user.accounttypeThe user's account type. Numeric field (integer) Its value can range from 0 to 262144 (2^18). Its value is held in the variable {$$loggedinuser.accounttype}. Most likely values are 10, which stands for voter, and 11 which denotes entrant. The value can be set by template developers, who can set the value of the intergs to have any meaning that is necessary.
Examples of filetypes:
1 = Administrator
2 = User
10 = Voter
11 = Entrant
user.postalcodeThe user's postalcode
user.approvedfilesThe number of approved media items this user has
user.deniedfilesThe number of denied media items this user has
user.unmoderatedfilesThe number of unmoderated media items this user has
user.publicfilesThe number of uploads this user did
user.state2-letter state code
user.externalidsArray of external ids from various providers the user may have. Eg. user.externalids.0.external_id_provider, user.externalids.0.external_id, user.externalids.0.external_id_sub_provider
user.deviceinfoAn array of the user's devices, returned only when fields[deviceinfo] is set. The values returned are as follows: (with i being the iterator of the user's devices, should the user have more than one)

  • {$$user.deviceinfo.i.id} - (Integer) The id of the device. ie: 54321
  • {$$user.deviceinfo.i.uid} - (Integer) The id of the user.
  • {$$user.deviceinfo.i.vhost} - (Integer) The id of the vhost.
  • {$$user.deviceinfo.i.device_id} - (String) The string id of the device.
  • {$$user.deviceinfo.i.latitude} - (FLoat) The latitude of the device. Ie: 43.635609
  • {$$user.deviceinfo.i.longitude} - (FLoat) The longitude of the device. Ie: -79.424858
  • {$$user.deviceinfo.i.lastupdatetime} - (Datetime) The datestamp of the last occurance that the device was used to connect to the application. Ie: 2012-12-07 11:40:56
  • {$$user.deviceinfo.i.commentnotification} - (Integer) Indicates whether the user enabled their comment notifications or not. Values: 1 (yes) or 0 (no)
  • {$$user.deviceinfo.i.assignmentnotification} - (Integer) Indicates whether the user enabled their assignment notifications or not. Values: 1 (yes) or 0 (no)
  • {$$user.deviceinfo.i.settings} - a serialized string with the user's settings: ie: a:1:{s:22:"notificationBadgeCount";s:1:"0";}
user.offset0-based offset from start of list. Example: the fourth user on the second page, where pages are 50 users long, has offset 53.
user.filterstringProvides a string to be used in conjunction with the fm:UserNext and fm:UserPrevious components. This string will contain all filters and sorting that was applied to this user list. Use this in a link as "<a href='/profile/{$$user.id}?{$$user.filterString}'>{$$user.user}</a>".
user.disable_media_notificationsThe user's setting for Media notifications - an integer: (0 for allow notifications, 1 for disable notifications)
user.disable_thread_notificationsThe user's setting for Thread notifications - an integer: (0 for allow notifications, 1 for disable notifications)

See also

<< 3.2.73 fm:UserNext 3.2.75 fm:UserInfo >>