You are here

function photos_comment_view in Album Photos 7.3

Implements hook_comment_view().

File

./photos.module, line 914
Implementation of photos.module.

Code

function photos_comment_view($comment, $view_mode, $langcode) {
  if ($comment->node_type == 'comment_node_photos' && arg(0) != 'photos') {
    $fid = db_select('photos_comment', 'v')
      ->fields('v', array(
      'fid',
    ))
      ->condition('v.cid', $comment->cid)
      ->execute()
      ->fetchField();
    if (!empty($fid)) {
      $comment->content['links']['comment']['#links']['photos-image'] = array(
        'title' => t('view image'),
        'href' => 'photos/image/' . $fid,
        'fragment' => 'comment-' . $comment->cid,
      );
    }
  }
}