WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Image Widget] Image button doesn't work until I reload the page (18 posts)

  1. smurkas
    Member
    Posted 4 years ago #

    Man I've been waiting on this kind of functionality for so long!

    The plugin is an awesome initiative but I am having an issue with the Add image-link not working until I reload the page. I'm guessing that this is javascript-related and that the event is bound on page load.

    Looking at the thickbox init function it only binds once on document ready so when more links get added with the thickbox-class they aren't affected.

    I'll see what I can do about it.

    http://wordpress.org/extend/plugins/image-widget/

  2. smurkas
    Member
    Posted 4 years ago #

    Ok I did the following to fix this.

    1. Changed the class of the Add image-link to image-widget so thickbox doesn't touch it on its own.
    2. Add some jQuery event delegation.

    jQuery(document).ready(function() {
    	jQuery("body").click(function(event) {
    		if (jQuery(event.target).is('a.image-widget')) {
    			tb_show("Add an Image", event.target.href, false);
    		}
    	});
    });

    As you can see here, we're binding an event to the body (ugly I know) and looking for when an a-tag with the image-widget class is clicked. We then call tb_show directly since we know what options we want to pass.

    I've tried it out and it seems to work. Let me know if there are any issues or if you don't have the problem I describe above at all. I'm running WordPress 2.8.4.

  3. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    smurkas! this is great! Where did you add the javascript? in the js file?

  4. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    Just tried it and it totally works!!!!
    I love it! Thank you! releasing a new version now...

  5. Sammyed
    Member
    Posted 4 years ago #

    Hello guys,

    Passing by to say that all my images dissapeared once I hit the automatic update to version 3.0.4, then I headed back to my widgets in order to return those images in place but I'm having a problem...

    The "add an image" link is not taking me nowhere, after clicking nothing is going on...just stays still. I can't upload images from my CPU like I used to do.

    I'm not sure if the new version inserted a new folder for images in my root that I would have to CHMOD it or something like that?

    Excellent plugin. Everything was running smooth and nice, until the update.

    WP 2.8.4

    Cheers.

  6. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    Thanks Sammyed.

    Have you tried adding a new image widget to your sidebar? maybe the old ones have been corrupted in the update.

  7. Sammyed
    Member
    Posted 4 years ago #

    Hello Peter,

    Well, I don't know how to explain this but it's working now :)

    Before the update, I used to have 2 actives "image widgets" at sidebar and 1 "image widget" in my -available widgets menu-.

    After the update, all were gone except for just one available in the menu. Moving that one to side bar, I tried to upload an image using the "Add an Image" link...as I said...nothing happened. Then I posted my problem here, logged out from my WP, and...until now I'm back having 1 active "image widget" at sidebar with no image (the one I was trying to create earlier) and also 1 extra "image widget" in my -available widgets menu-...and I'm pretty sure that this one, was not there when I logged out.

    I don't know...but it's working wonderfully! Excellent functionality!

    Thanks and I'm sorry for posting my problem so early...I should have waited a little bit.

    Keep it up!

  8. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    Thanks Sammyed!

    I'm thinking that for some reason upgrading is corrupting the widgets. Anyone else reading this: If your widgets stop working after upgrading, remove them and then re-add them.

    Sorry for the inconvenience.

  9. massimopaolini
    Member
    Posted 4 years ago #

    I run WP 2.8.5 with the Thesis theme 1.6. When I upgraded to the new version of Image-Widget, I received this error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/mpaolini/public_html/scottgree/wp-content/plugins/image-widget/image-widget.php on line 89

    Any ideas?

  10. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    and it was working fine before?

  11. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    just to check, what version image widget are we talking about?

  12. natashaelaine
    Member
    Posted 4 years ago #

    I just received the same fatal error above yesterday after I upgraded Image-Widget. I run WP 2.8.4 & Atahualpa 3.3.3.

    Upon activating the plugin, I received this fatal error:
    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /wp-content/plugins/image-widget/image-widget.php on line 89

    I have tried uninstalling and re-installing the plugin, but no success. I keep getting the same error. Even worse, I cannot install any other image widget plugin because I get errors for all of them.

    Any advice?

  13. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    looks like it was a php4 bug. i've just done another release to fix. let me know if that works for you.

  14. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    BTW, thanks for the reports.

  15. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    Oh, and if it does work, can you do me a favor and click the green button on the plugin page?

    http://wordpress.org/extend/plugins/image-widget/

    Thanks!

  16. nickrita
    Member
    Posted 4 years ago #

    Great plugin, but on wpmu the widget is only shown on the main blog, not on the user-Blogs, although I activated the plugin sitewide.

    I would be very grateful for a solution.

  17. Peter Chester
    Modern Tribe
    Posted 4 years ago #

    Interesting... that's not something i had observed before. Can you tell me more about the MU configuration? Is it subdomain? folder? or domain? What version MU?

  18. nickrita
    Member
    Posted 4 years ago #

    Hi Peter, mu is 2.8.4a with buddypress 1.1.2, User's blogs are folders
    http://www.mysite.de/userblog

    I would be very glad to get the widget run. I also want to use it as a profile-widget for the sidebar.

Topic Closed

This topic has been closed to new replies.

About this Topic