You are here

function uc_wishlist_user_view in UC Wish List 7

Implements hook_user_view().

File

./uc_wishlist.module, line 315
Allows users to create public shopping/wish lists.

Code

function uc_wishlist_user_view($account, $view_mode) {
  $res = db_query("SELECT * FROM {uc_wishlists} WHERE uid = :uid", array(
    ':uid' => $account->uid,
  ));
  $items = array();
  foreach ($res as $obj) {
    $items['wishlist_' . $obj->wid] = array(
      'value' => l($obj->title, "wishlist/{$obj->wid}"),
    );
  }
  if (count($items) > 0) {
    return array(
      t('Wish lists') => $items,
    );
  }
}