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: Image Flicker plugin] [22 comments] [Permanent link]
Sam Wilson's Journal
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]
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]
Mr blazing
[permalink]
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]
You’re very welcome, and thanks for looking into it so soon! :-)
Cheers!
[permalink]
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]
Hmmm… don’t know. Your site seems to be working now. Is it? Hope so.
Kanpai!
[permalink]
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]
It would be so so so great if you could allow the ability to handle multiple different sideshows!
[permalink]
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]
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]
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]
Hi Sam,
same here: delay of first picture. Has anybody fixed it?
Regards
[permalink]
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]
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]
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]
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]
Ben,
Thanks for your fix, but it didn’t work for me. I ended up with no images showing, at all.
[permalink]
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]
Here is a zip file of my file:
http://www.cityofsinnersandsaints.com/ben/image-flicker.zip
[permalink]
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]
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]