Exemple #1
0
 /**
  * LazyestFrontendFolder::thumb_image()
  * 
  * @since 1.1.0
  * @param LazyestThumb $image
  * @return string code for thumbnail image
  */
 function thumb_image($image)
 {
     global $post, $lg_gallery;
     $onclick = $image->on_click();
     $rel = '' != $onclick['rel'] ? 'rel="' . $onclick['rel'] . '"' : '';
     $class = 'thumb';
     if ('TRUE' != $lg_gallery->get_option('enable_cache') || 'TRUE' == $lg_gallery->get_option('async_cache') && !file_exists($image->loc())) {
         $class .= ' lg_ajax';
     }
     $postid = is_object($post) ? $post->ID : $lg_gallery->get_option('gallery_id');
     $anchor_1 = $anchor_2 = '';
     if ('nothing' != $lg_gallery->get_option('on_thumb_click')) {
         $anchor_1 = sprintf('<a id="%s_%s" href="%s" class="%s" %s title="%s" >', $onclick['id'], $postid, $onclick['href'], $onclick['class'], $rel, $onclick['title']);
         $anchor_2 = '</a>';
     }
     return sprintf('<div class="lg_thumb_image">%s<img class="%s" src="%s" alt="%s" />%s</div>', $anchor_1, $class, $image->src(), $image->alt(), $anchor_2);
 }