fm:UserDevices


This component displays the devices for all the users in an application, or for one user in an application.
You can currently sort devices on device id, uid and lastupdatetime.
By default this component will sort by lastupdatetime Descending

Example

The following code lists the devices for an application sorted by device id ascending, with a pagesize of 20.

<fm:UserDevices sort="id ASC" startPage="0" pageSize="20" > <fm:Loop> deviceInfo.id {$deviceInfo.id} - deviceInfo.uid {$deviceInfo.uid} - deviceInfo.latitude {$$deviceInfo.latitude} - deviceInfo.longitude {$$deviceInfo.longitude} </BR> </fm:Loop> <fm:NoResults> No devices have been found. </fm:NoResults> </fm:UserDevices>

In this example, the avatar for user with ID '1' will be returned as HTML with a width attribute: <img src="/static/1/images/global/male11.png" width="50" alt="Firsty McLastname"/>

Supported attributes

NameRequiredDefaultDescription
fieldsOptionalid, uid, lastupdatetimeComma-separated list of fields you would like to use. See the 'Template variables' section for a list of supported fields
pageSizeOptional100The number of items per page
sortOptionalcreated DESCSortfield. You can currently sort devices on device id, uid and lastupdatetime. By default this component will sort by lastupdatetime Descending; to sort Ascending use for example 'uid ASC'
startPageOptional0The starting page. This is a 0-based index

Template variables

NameDescription
deviceInfo.idThe id of the device
deviceInfo.uidThe id of the user
deviceInfo.vhostThe id of the application
deviceInfo.latitudeThe latitude of the device. Ie: 43.635609
deviceInfo.longitudeThe longitude of the device. Ie: -79.424858
deviceInfo.lastupdatetimeThe datestamp of the last occurance that the device was used to connect to the application. Ie: 2012-12-07 11:40:56
deviceInfo.commentnotificationIndicates whether the user enabled their comment notifications or not. Values: 1 (yes) or 0 (no)
deviceInfo.assignmentnotificationIndicates whether the user enabled their assignment notifications or not. Values: 1 (yes) or 0 (no
deviceInfo.settingsA serialized string with the user's settings: ie: a:1:{s:22:"notificationBadgeCount";s:1:"0";}

See also

More examples

Example 2

The following code lists the devices for the user with id 1928796, and sorts the results by the device lastupdatetime descending, with a pagesize of 10.

<fm:UserDevices sort="lastupdatetime DESC" uid="1928796" startPage="0" pageSize="10" > <fm:Loop> deviceInfo.id {$deviceInfo.id} - deviceInfo.uid {$deviceInfo.uid} - deviceInfo.lastupdatetime {$$deviceInfo.lastupdatetime} </BR> </fm:Loop> <fm:NoResults> No devices have been found. </fm:NoResults> </fm:UserDevices>