Utilities is a collection of inexpensive functions for pulling small amounts of data from core Drupal objects, nodes, users, files and comments. Sometimes you need to get a small piece of data, for example, the author id of a node, many times over in a page. Drupal's API provides node_load, which is great, but it can get a bit expensive if you have to call it hundreds of times.

Node Functions

simple_utilities_nodeProperty($nid, $field)
Returns a specified node field.
$nid = node ID.
$field = The field you want to return (Allowed values: title, uid, type, status, sticky, promote).

simple_utilities_nodeTaxonomy($nid)
Returns an indexed array of objects of node taxamony data with the following properties.
Parameter = node ID.

simple_utilities_nodeDates($nid)
Returns a node's last revision date and creation date as an object of timestamps.
Parameter = node ID.

simple_utilities_nodeLastCommentData($nid)
Returns an object with the following properties.
Parameter = node ID.

User Functions

simple_utilities_userField($arg)
Return the specified user field.
$arg = user ID (int) or the user email (string).
$field = The field you want to return (Allowed values: name, status, created, login, access)..

simple_utilities_userEmail($uid)
Returns the user email.
$uid = user ID (int).

simple_utilities_userID($mail)
Returns the user email.
$mail = user email (string).

simple_utilities_userPicture($arg)
Returns a user's picture data as an associative array.
Parameter = user ID or the user email.

simple_utilities_userRoles($arg)
Returns a user's roles as an associative array.
Parameter = user ID or the user email.

Comment Functions

simple_utilities_commentData($cid)
Returns data on a comment as an associative array.
Parameter = comment ID.

File Functions

function core_simple_utilities_fileData($fid)
Return data on a file as an associative array.
Parameter = file ID.

simple_utilities_fileUseCount($fid)
Returns an file's usage count.
Parameter = file ID.