Monogram Sam Wilson's Journal

Squiggle News Squiggle Archives Squiggle

 «   »

I have finally gotten around to fixing the most major bug that’s been festering in the Image Flicker documentation. Sorry for my laxity in this. To make up for being slow, I’ve added a widget, to make it easier to use the thing. Isn’t that jolly exciting?

Leave comments, bugs, and feature requests below.

[Keywords: ] [22 comments] [Permanent link]

Comments:

  1. On April 8th, 2008 at 5:16PM, Dan said:

    Hi Sam!

    I’ve downloaded your Image-Flicker plugin for my WP-site but I’m having a bit of trouble to get it going. I would like to rotate some banner ads, these are uploaded and URLs copied into the control panel of the plugin. However, the banners don’t show up, using the (div id=”image-flicker”)…..(/div) in the header.

    What am I doing wrong here, or have I completely misunderstood something?

    [permalink]

  2. On April 8th, 2008 at 5:55PM, Dan said:

    Taken from one of the comments under ver. 0.2:

    Disregard my comments. In the javascript, the element calls for id “image_flicker” while in the HTML it’s id “image-flicker”

    image_flicker, not image-flicker.

    However, another problem: There seems to be a lag before the script is running and that lag corresponds to the chosen interval (in seconds) between the next image – is there any way to change that and/or remove the initial lag?

    And thanks for the plugin!

    Regards,
    Dan

    [permalink]

  3. On April 9th, 2008 at 1:48AM, bouquillon said:

    Mr blazing

    [permalink]

  4. On April 9th, 2008 at 10:59AM, Sam Wilson said:

    Thanks for the feedback, Dan (and bouquillon, although I’m not quite sure what you’re getting at). I think perhaps you downloaded the plugin or read the documentation just before I updated Image-Flicker yesterday; the new version has this issue of the wrong HTML element ID all sorted out.

    As for stopping the initial load time, thank you for bringing this to my attention; I’ll get on to it immediately.

    [permalink]

  5. On April 10th, 2008 at 6:15PM, Dan said:

    You’re very welcome, and thanks for looking into it so soon! :-)

    Cheers!

    [permalink]

  6. On April 11th, 2008 at 6:23PM, Dan said:

    Hi Sam!

    I’ve run into trouble: I had 8 banners rotating until yesterday, or so, and suddenly 7 of them just stopped showing. It’s really odd, as the image links work if I paste them in my browser; also they don’t show up on the control page upon pressing save – do you have any suggestion to what the problem might be?

    I have tried to remove the faulty ones and then expand from the one working but in vain. Oddly enough, when I set the value on 2 images, the old links from the faulty banners are still there…

    Cheers! (or ‘skål’ in Danish)
    Dan

    [permalink]

  7. On April 13th, 2008 at 5:28PM, Sam Wilson said:

    Hmmm… don’t know. Your site seems to be working now. Is it? Hope so.

    Kanpai!

    [permalink]

  8. On April 13th, 2008 at 10:55PM, Dan said:

    Yes, I got it going, simply by changing the folder name of the ad-folder… weird! The Roskilde Festival banner is being fetched from a separate folder, so I figured that the placement or some permissions must have gone haywire on way or the other.

    [permalink]

  9. On April 17th, 2008 at 6:15AM, Self Exile said:

    It would be so so so great if you could allow the ability to handle multiple different sideshows!

    [permalink]

  10. On November 12th, 2008 at 1:05PM, Michael said:

    Love it, love it, love it — but I have the same type of lag that Dan speaks of, and the show starts with my second image, not the first. (It’s like the first image is not shown, but the second image appears in the proper sequence and time lapse.)

    [permalink]

  11. On November 23rd, 2008 at 10:31PM, Ari said:

    Hi Sam,

    Thanks for this GREAT plugin. It was EXACTLY what I needed. Simple but does exactly what I want!

    (well, only wish left might be a randomizer, so it doesn’t always start at image #2. but maybe i can hack that in myself)

    [permalink]

  12. On November 26th, 2008 at 5:47AM, Josh said:

    Hi Sam

    This plugin does exactly what I need I too am getting the time lag before the first image loads. The delay seems to be exactly the length of frame delay set in the plugin management page in WP admin. How do we get round that?
    Also is there any plans in future versions to include transitions(fades etc) between the changing images?

    Cheers

    [permalink]

  13. On December 15th, 2008 at 1:03AM, Pit said:

    Hi Sam,

    same here: delay of first picture. Has anybody fixed it?

    Regards

    [permalink]

  14. On December 24th, 2008 at 9:27PM, Sam Wilson said:

    Hi all,

    Sorry about my slackness with this plugin. I intend to fix the bugs, just as soon as I get a spare moment when I’m not preoccupied with building furniture (art must take precedence in life, I feel — not that coding isn’t art: code is poetry an’ all that!).

    Thanks for all your feedback; bear with me, and all shall be fixed (I promise! I just don’t give a timeline…).

    [permalink]

  15. On January 1st, 2009 at 3:11AM, Judy said:

    Hi, I don’t see a sample of this plug in on your site. I just downloaded it. Can you direct me to someone else who’s using it?
    Thanks, Happy New Year!

    [permalink]

  16. On January 1st, 2009 at 7:38AM, Michael said:

    I’m using it at http://www.sewppa.org. It’s in the colum on the right side between the small photo at the top of the column and the navigation menu list. Seems to work fine, except, again, for the delay we’ve been talking about — and now it once in a while “vanishes”, making the menu list jump up to fill the gap.

    [permalink]

  17. On January 7th, 2009 at 4:51AM, Ben Woodhead said:

    Hello,

    I quickly hacked a solution to fix the delayed load and it starting at the wrong image.

    replace (at the end of the file):
    gImageCapableBrowser = canManipulateImages();
    gCurrentImage = 0;
    setInterval(“nextSlide()”, gSlideshowInterval*1000);

    with:

    function init() {
    gImageCapableBrowser = canManipulateImages();
    gCurrentImage = 0;
    nextSlide();
    setInterval(“nextSlide()”, gSlideshowInterval*1000);
    }

    window.onload = init;

    [permalink]

  18. On January 28th, 2009 at 11:59AM, Bill said:

    Ben,

    Thanks for your fix, but it didn’t work for me. I ended up with no images showing, at all.

    [permalink]

  19. On January 28th, 2009 at 10:25PM, Ben Woodhead said:

    Hmm. Here is the complete source I used, try it and see if that works:

    $val) {
    // All of the wanted form fields are prefixed with ‘image_flicker’.
    if (strpos($key,’image_flicker’) === 0) {
    update_option($key, $val);
    }
    }
    echo ‘Changes saved.‘;
    }

    // Get these again, in case they just got changed. (I’m sure there’s a prettier way to do this.)
    $num_images = get_option(‘image_flicker_num_images’);

    print ‘
    Number of images:

    Delay between frames:

    (in seconds)’;

    for ($img=1; $img<=$num_images; $img++) {
    $src_tag = “image_flicker_src_$img”;
    $desc_tag = “image_flicker_desc_$img”;
    $link_tag = “image_flicker_link_$img”;
    print “Image $img

    Image URL:

    Description:

    Link URL:

    “;

    } // end for ($img=1; $img<=$num_images; $img++) loop
    print ”

    “;

    } // image_flicker_add_management_page()

    add_action(‘widgets_init’, ‘widget_image_flicker_init’);
    function widget_image_flicker_init() {
    if ( !function_exists(‘register_sidebar_widget’) ) {
    return;
    }
    function widget_image_flicker($args) {
    extract($args);
    echo “$before_widget$after_widget”;
    }
    register_sidebar_widget(‘Image Flicker’, ‘widget_image_flicker’);
    }

    add_action(‘wp_head’, ‘image_flicker_wp_head’);
    function image_flicker_wp_head() {

    $num_images = get_option(‘image_flicker_num_images’);
    $delay = get_option(‘image_flicker_delay’);

    $out = ‘

    <!–

    // Courtesy of SimplytheBest.net – http://simplythebest.net/scripts/
    // Modified by Sam Wilson http://samwilson.id.au October 2007.

    gSlideshowInterval = ‘.$delay.’;
    gNumberOfImages = ‘.$num_images.’;

    gTheRotations = new Array(gNumberOfImages);

    ‘;

    for ($i=1; $i<=$num_images; $i++) {
    $out .= “\ngTheRotations[$i] = ‘“.
    “”.
    get_option(‘image_flicker_desc_’.$i).”
    ‘;\n”;
    }

    $out .= ‘
    function canManipulateImages() {
    if (document.images)
    return true;
    else
    return false;
    }

    function loadSlide(slideHtml) {
    if (gImageCapableBrowser) {
    document.getElementById(“image_flicker”).innerHTML = slideHtml;
    return false;
    }
    else {
    return true;
    }
    }

    function nextSlide() {
    gCurrentImage = (gCurrentImage % gNumberOfImages) + 1;
    loadSlide(gTheRotations[gCurrentImage]);
    }

    function init() {
    gImageCapableBrowser = canManipulateImages();
    gCurrentImage = 0;
    nextSlide();
    setInterval(“nextSlide()”, gSlideshowInterval*1000);
    }

    window.onload = init;

    // –>
    ‘;

    echo $out;

    }

    ?>

    [permalink]

  20. On January 28th, 2009 at 10:30PM, Ben Woodhead said:

    [permalink]

  21. On January 29th, 2009 at 1:19AM, Bill said:

    Thanks, Ben. Replacing the original file with yours did the trick. I’m still not sure simply editing the original didn’t work, though.

    [permalink]

  22. On March 16th, 2009 at 6:51PM, Sam Wilson said:

    Hullo everyone…

    So, when I said I’d get onto fixing the bugs… well. Yes. Anyway. What’s a few months between friends, eh?!

    Anyway: I’ve added Ben’s fix (as above), and things seem to be working good. But tell me if they’re not, won’t you? :-)

    Good then.

    [permalink]

  23. Comments are closed for this post.

« »