Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter istandbyyou

    (@istandbyyou)

    PS: If anybody decides to use this ugly code, they have to adapt $optimisedimagesize to their own max image width (I have changed default wordpress max image thumbnail size from 150px to 160px, introduced optimum-size 480px and changed default large image size from something over 640x to 960px). BTW, both these files might be overwritten with new plugin upgrade…

    If you didn’t change default media file size then use this code at your own risk.))

    /views/SlideshowPluginSlideshowSlide/frontend_attachement.php
    1. Add $imageoptimiseflag = false; (after line $imageAvailable = true;) at line 94
    2. Add $imageoptimiseflag = true; (after line $imageHeight = $image[2];) at line 117
    3. Add line 120 (after $imageoptimiseflag = true; } }) :
    if (($imageoptimiseflag == true)&&(isset($GLOBALS[‘slideshowpluginmaximumwidth’]))) {
    $optimisedimagesize = ‘full’;
    $slideshowpluginmaximumwidth = $GLOBALS[‘slideshowpluginmaximumwidth’];
    if ($slideshowpluginmaximumwidth <=640) { $optimisedimagesize = ‘large’; }
    if ($slideshowpluginmaximumwidth <=300) { $optimisedimagesize = ‘medium’; }
    if ($slideshowpluginmaximumwidth <=150) { $optimisedimagesize = ‘thumbnail’; }
    $image = wp_get_attachment_image_src($attachment->ID, $optimisedimagesize);
    $imageSrc=”;
    $imageSrc = $image[0];
    $imageWidth = $image[1];
    $imageHeight = $image[2];
    }
    4. slideshow-jquery-image-gallery/views/SlideshowPlugin/slideshow.php
    Add at line 1: <?php if (isset($settings[‘maxWidth’]) && $settings[‘maxWidth’] > 0) {
    $GLOBALS[‘slideshowpluginmaximumwidth’] = $settings[‘maxWidth’];
    } ?>

    Good luck.

    Thread Starter istandbyyou

    (@istandbyyou)

    Hi mbrsolution! I have done it in the most dirties way I could((
    I have created a global variable at slidshow.php and amended output image compared to max-width parameter.

    /views/SlideshowPluginSlideshowSlide/frontend_attachement.php
    1. Add $imageoptimiseflag = false; at line 94
    2. Add $imageoptimiseflag = true; at line 117
    3. Add line 120:
    if (($imageoptimiseflag == true)&&(isset($GLOBALS[‘slideshowpluginmaximumwidth’]))) {
    $optimisedimagesize = ‘full’;
    $slideshowpluginmaximumwidth = $GLOBALS[‘slideshowpluginmaximumwidth’];
    if ($slideshowpluginmaximumwidth <=960) { $optimisedimagesize = ‘large’; }
    if ($slideshowpluginmaximumwidth <=480) { $optimisedimagesize = ‘optimum-size’; }
    if ($slideshowpluginmaximumwidth <=300) { $optimisedimagesize = ‘medium’; }
    if ($slideshowpluginmaximumwidth <=160) { $optimisedimagesize = ‘thumbnail’; }
    $image = wp_get_attachment_image_src($attachment->ID, $optimisedimagesize);
    $imageSrc=”;
    $imageSrc = $image[0];
    $imageWidth = $image[1];
    $imageHeight = $image[2];
    }
    4. slideshow-jquery-image-gallery/views/SlideshowPlugin/slideshow.php
    Add line 2: <?php if (isset($settings[‘maxWidth’]) && $settings[‘maxWidth’] > 0) {
    $GLOBALS[‘slideshowpluginmaximumwidth’] = $settings[‘maxWidth’];
    } ?>

    Ugly… but does the job.

    Thread Starter istandbyyou

    (@istandbyyou)

    Hi mbrsolution! Sorry for late reply. You have confused me a bit.
    I’m trying to create an option of using thumbnail/medium source images when creating a slideshow rather than original(i.e. use thumbnail for a 150×150 widget slideshow rather original 5000×5000)
    .
    When you upload an image to wordpress, it creates a few smaller images automatically which are available as ‘medium’ ‘thumbnail’. If you upload a file.jpg 5000×5000, wordpress creates 2-3 different sizes of the original file ‘medium’, ‘thumbnail’ (file-150×150.jpg, file-300×300.jpg). I would like to create an option of using a slideshow using ‘thumbnail’ image files rather than original file.

    I have located one of the files which needs altering. If I change ‘full’ to ‘thumbnail’, slidshow plugin will start using smaller source image files. The problem is it will start using it permanently though I would like to have an option of using original image source files. Therefore, it requires a dropdown menu with options (original, medium, thumbnail) on admin ‘create slideshow’ page when you have selected images for a slideshow.

    line 89: $image = wp_get_attachment_image_src($attachment->ID, ‘full’);
    /views/SlideshowPluginSlideshowSlide/frontend_attachement.php

    The progress stopped there…))

Viewing 3 replies - 1 through 3 (of 3 total)