You are here

function imagepicker_user_view_public in Image Picker 6.2

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_user_view_public()
  2. 7 imagepicker.user.inc \imagepicker_user_view_public()
1 call to imagepicker_user_view_public()
imagepicker_user_page in ./imagepicker.user.inc
@file my imagepicker in my account

File

./imagepicker.user.inc, line 117
my imagepicker in my account

Code

function imagepicker_user_view_public($img_id) {
  $img = _imagepicker_get_img($img_id, FALSE);
  if ($img) {
    $result = db_query("SELECT name FROM {users} WHERE uid=%d AND status=1", array(
      $img['uid'],
    ));
    $row = db_fetch_array($result);
    $img['name'] = $row['name'] ? $row['name'] : FALSE;
    $imgpath = imagepicker_get_image_path($img, 'full', array(
      'name' => $img['name'],
      'uid' => $img['uid'],
    ));
    $info = image_get_info(imagepicker_get_path(FALSE, array(
      'name' => $img['name'],
      'uid' => $img['uid'],
    )) . $img['img_name']);
    $content = theme('imagepicker_view', $img, $imgpath, $info);
  }
  else {
    drupal_set_message(t('Image not found.'), 'error');
    $content = '';
  }
  return $content;
}