"Download this image" doesnt work

Forums Forums Slimbox2 plugin "Download this image" doesnt work

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #1777
    Anonymous
    Member

    Hi,

    I found this code in the FAQ of Slimbox2

    // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
    jQuery(function($) {
            $("a[rel^=’lightbox’]").slimbox({/* Put custom options here */}, function(el) {
                    return [el.href, el.title + ‘<br /><a href="’ + el.href + ‘">Download this image</a>’];
            }, function(el) {
                    return (this == el) || ((this.rel.length > <img decoding=” title=”Cool” /> && (this.rel == el.rel));
            });
    });

    I added in "slimbox2_autoload.js" Got it working for a while but it stopped all the sudden.. Maybe there was an Update?

    #9336
    malcalevak
    Moderator

    It actually sounds like you’re not using the WordPress plugin, but running Slimbox by itself.
    Are you running WordPress?
    Can you provide a link to your website?

    #9337
    Anonymous
    Member

    I am using WP-Slimbox2

    http://www.wearepixelated.com click on Pictures and select an album:

    It kinda worked now. But now the CSS Settings are ignored (i changed my overlay to blue. But as you can see. It’s black)

    #9338
    malcalevak
    Moderator

    I see a blue overlay…perhaps you have some sort of caching issue?
    From what I can see, everything looks fine, though it appears you’ve made some of the background colors around the image black.

    #9339
    Anonymous
    Member

    Sorry i already changed it. I’m now back from scratch. The code i got from the FAQ isn’t working. The reason why i mentioned that i KINDA worked in my prev. Post is that for some reason the autoload.js was a little different from the original…

    So i downloaded a new copy and started over again… Now it works but the Download code from FAQ isn’t..

    Is there an alternative or am i doing someting wrong.. Here is what i did:

    added:

    // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
    jQuery(function($) {
            $("a[rel^=’lightbox’]").slimbox({/* Put custom options here */}, function(el) {
                    return [el.href, el.title + ‘<a href="wp-content/downloadpicture.php?filename=’ + el.href + ‘" target="_blank"><img src="http://wearepixelated.com/images/download.jpg&quot; border="0"></a>’];
            }, function(el) {
                    return (this == el) || ((this.rel.length > <img decoding=” title=”Cool” /> && (this.rel == el.rel));
            });
    });

    to: wp-slimbox2/javascript/slimbox2_autoload.js

    This adds nothing at all… This should add my download link…

    Any thoughts?

    #9340
    malcalevak
    Moderator

    What is this FAQ you’re referring to? That bit of code isn’t tied to the plugin (just the original Slimbox). To add the download link all you need to do is check the box in the settings panel.

    #9341
    Anonymous
    Member

    The FAQ of slimbox: http://code.google.com/p/slimbox/wiki/FAQ

    I know this plugin has that feature. But your downloading option is based on Captions or 4 other ref’s.

    I made my own download link which i used with Lightbox. That if you click the link you get the picture Directly downloaded to your computer.

    So i need to modify where the link is going to. And i want the text "download this image" in the caption…

    How do i do this with your plugin??

    – Need to modify the Caption link.
    – With one link text like "download this image" for all images…

    My this where i need my links to go to:
    wp-content/downloadpicture.php?filename=’ + el.href + ‘

    thanks

    #9342
    malcalevak
    Moderator

    Just to make sure I’m understanding you correctly, you don’t want the download link to be like:
    http://www.wearepixelated.com/wp-conten … g_6061.jpg

    You actually want it to run through that downloadpicture.php deal?

    #9343
    Anonymous
    Member

    That’s correct! And the text link needs to be the same. you think you can help me out?

    #9345
    malcalevak
    Moderator

    Well, getting the text link is easy, you’d just put that as the alt-text. The trouble is more tied to your downloadpicture.php, what exactly is it doing?

    The next release does allow you to put custom URLs in with the captions, however you’d need to put that in the alt-text as well.

    If you insist on changing the javascript, you likely should move to the next release (which I can post here for you), as the changes you’d need to make are drastically different between versions.

    #9346
    Anonymous
    Member

    Text link… does that mean i have to copy’n’paste the text i want over and over again for each image?

    Yes custom URLs would be very usefull! I think i’ll take my chance and try to change the JS if you’re willing to post the Next Release for me…

    But just an side thought.. Isn’t there any way to make that code i got from the FAQ work with your Plugin?? Would save a lot of work i think.. or i just could be wrong.

    Thanks.

    #9347
    malcalevak
    Moderator

    Well, it all really comes down to what features of the plugin you actually want to use vs the changes you want to make.

    Change:
    [code:2ju594ca]
    if (el.href.match(/^http://picasaweb.google./)!=null) {
    var href = el.firstChild.src.replace(//sd+(?:-c)?/([^/]+)$/, "/s640/$2");
    } else if (el.href.match(/^http://www.flickr.com/photos//)!=null) {
    var href = el.firstChild.src.replace(/_[mts].(w+)$/, ".$1");
    } else var href = el.href;
    return parseForURL(href,eval(slimbox2_options[’caption’]));
    [/code:2ju594ca]

    to your changed code (this will remove picasa and flickr support).

    #9348
    Anonymous
    Member

    thanks alot! im going to work on this now… I will keep you updated!

    #9349
    Anonymous
    Member

    i got it working! You never guess how <img decoding=” title=”Tongue” />

    I added that FAQ code right above the code you told me to change… so in a way i didn’t changed anything… only added something!

    take a look now http://wearepixelated.com/?page_id=101

    if you like this way of downloading images off slimbox, i could send you the php file i created…

    Thank you so much for your help!

    #9350
    malcalevak
    Moderator

    I’m glad you were able to get it working, but placing the code there actually alters several things for people who don’t choose to run with autoload on, but in your case it should do fine.

    I’m curious as to what exactly that php file is doing as it’s still quite easy to download images the way it is.

    Anyway, glad I could help.

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.