Пример #1
0
 }
 $attachments_data = presscore_get_attachment_post_data($media_items);
 $preview_style = get_post_meta($post->ID, '_dt_post_options_preview_style_gallery', true);
 $style = ' style="width: 100%;"';
 $class = array('alignnone');
 if (!in_array($layout, array('masonry', 'grid')) && 'normal' == $preview_mode) {
     $class = array('alignleft');
     $style = ' style="width: 270px;"';
 }
 switch ($preview_style) {
     case 'slideshow':
         $class[] = 'slider-simple';
         if ('masonry' == $layout) {
             $class[] = 'slider-masonry';
         }
         echo presscore_get_post_media_slider($attachments_data, array('class' => $class, 'style' => $style));
         break;
     case 'hovered_gallery':
         $class[] = 'rollover';
         $gallery_args = array('class' => $class, 'style' => $style);
         if ('list' != $layout) {
             if ('wide' == $preview_mode && !$config->get('all_the_same_width')) {
                 $target_image_width = $config->get('target_width') * 3;
                 $gallery_args['title_img_options'] = array('w' => round($target_image_width), 'z' => 0, 'hd_convert' => false);
             } else {
                 $target_image_width = $config->get('target_width') * 1.5;
                 $gallery_args['title_img_options'] = array('w' => round($target_image_width), 'z' => 0);
             }
         }
         echo presscore_get_images_gallery_hoovered($attachments_data, $gallery_args);
         break;
        foreach ($gallery['src'] as $image_src) {
            $attachments_data[] = array('full' => $image_src, 'width' => 150, 'height' => 150, 'alt' => '', 'title' => '', 'description' => '', 'ID' => false);
        }
    } else {
        $attachments_data = array();
    }
}
// var_dump( $attachments_data );
$class = array('alignnone');
$config = presscore_get_config();
if ('normal' == $config->get('post.preview.width')) {
    $class = array('alignleft');
}
switch ($config->get('post.preview.gallery.style')) {
    case 'slideshow':
        $class[] = 'slider-simple';
        echo '<div class="post-slider">';
        echo presscore_get_post_media_slider($attachments_data, array('class' => $class, 'style' => ' style="width: 100%;"', 'proportions' => $config->get('post.preview.gallery.sideshow.proportions')));
        echo '</div>';
        break;
    case 'hovered_gallery':
        $class[] = 'rollover';
        $gallery_args = array('class' => $class, 'style' => '');
        echo presscore_get_images_gallery_hoovered($attachments_data, $gallery_args);
        break;
    default:
        if ('normal' == $config->get('post.preview.width')) {
            $class[] = 'format-gallery-normal';
        }
        echo presscore_get_images_gallery_1($attachments_data, array('class' => $class, 'style' => ''));
}