You are here

function userpoints_preprocess_author_pane in Author Pane 6

Same name and namespace in other branches
  1. 5 modules/userpoints.author-pane.inc \userpoints_preprocess_author_pane()
  2. 6.2 modules/userpoints.author-pane.inc \userpoints_preprocess_author_pane()
  3. 7.2 modules/userpoints.author-pane.inc \userpoints_preprocess_author_pane()

Implementation of hook_preprocess_author_pane().

File

modules/userpoints.author-pane.inc, line 11
Provides a preprocess function on behalf of the userpoints module.

Code

function userpoints_preprocess_author_pane(&$variables) {
  $account_id = $variables['account']->uid;
  if ($account_id != 0) {
    $variables['userpoints_points'] = userpoints_get_current_points($account_id, 'all');
    $variables['userpoints_categories'] = array();
    $categories = userpoints_get_categories();
    foreach ($categories as $tid => $category) {
      $variables['userpoints_categories'][$category] = userpoints_get_current_points($account_id, $tid);
    }
  }
}