Forums › Forums › Slimbox2 plugin › Autoload feature not working
- This topic has 9 replies, 2 voices, and was last updated 15 years, 7 months ago by
malcalevak.
-
AuthorPosts
-
January 29, 2009 at 7:02 pm #595
Anonymous
MemberFirst things first–thank you for taking the time to make slimbox2 into a WP plugin! Your hard work is evident. I almost have this thing working! I’m trying to replace my slimbox1 plugin, which worked great except for one problem: the autoload function counted all images on the entire page, rather than just within a single post. This is why I’ve decided to try your slimbox2 plugin–so the ‘gallery’ feature you’ve programmed will only show/count the images in a specific post.
That being said, I get the plugin to work well when I have the autoload option DISABLED and I hand-code ‘ rel="lightbox-…" ‘ into every photo link. However, when I try to ENABLE the autoload feature, the pictures open in a blank window when clicked (the WP default action). I’ve noticed several others having similar problems, but I haven’t seen a consistent solution. I’ve toyed with the slimbox2_autoload.js.php file, to no avail. Finally I deactivated then deleted/reinstalled the plugin after deactivating all other plugins, to no avail. Any suggestions? The slimbox1 plugin worked flawlessly, other than not restricting the image count to a specific post.
Here’s an example, in which I have autoload ENABLED. I’ll probably be switching back to the working slimbox1 plugin in a day or two if I can’t find a resolution…
January 29, 2009 at 8:29 pm #5094malcalevak
ModeratorPhillip, thanks for the kind words. Slimbox1 and Slimbox2 were both written by the same author, though at the prompting of others I revised the autoloading code to do the by post/page groups (and at least two people provided code suggestions as well).
I find it strange that the slimbox1 plugin didn’t have the same issues mine is having, though it’s possible he tweaked the loading code himself.
I believe I know what’s causing the problem, though I’m not sure I know how to fix it. If you’ll notice, all your image links appear to have custom sizing addendums to them (ie IMG_4385.jpg&h=500 the bit after the .jpg). When I cut that out of the link, the images worked just fine, except they loaded at the incredibly massive size, which is obviously not what’s wanted. I believe/hope this is a relatively easy fix, and it just requires someone who knows how to modify the jQuery code, but I guess we’ll see.
In the meantime, if there’s another way to easily post images at a reasonable size, I’d recommend that instead, but I’m still going to try and diagnose this issue. I’m still personally a fan of using rel=’lightbox’ links as it’d give more direct flexibility in setting exactly what you want, but I understand that’s time consuming in cases where the gallery implementation being used doesn’t add them.
I’ll keep you posted.
January 29, 2009 at 10:38 pm #5095Anonymous
MemberSorry I forgot to include that tidbit of info for you! I pass the sizes because I’m incorporating ZenPhotoPress plug-in as well as a slightly-modified version of slimbox1, and I didn’t want my wife to have to upload both the full-res photo (for folks to order) and a scaled-down version as well. This setup I concocted was working just fine with slimbox1 for some reason. Just in case it will help you diagnose, I’ve reverted to slimbox1 so you can see how it functions:
Thanks again for your help. I can’t wait to get this working properly!!
January 29, 2009 at 10:41 pm #5096Anonymous
MemberForgot to include one thing in the last post:
When you visit my site utilizing slimbox1/ZenPhotoPress, you’ll notice the photo count says ~32 images, which is the total count on the page (not including the flash movies). Basically, all I’m really wanting for improvement is to limit the count/display to only the images in that particular post.
January 29, 2009 at 11:44 pm #5097malcalevak
ModeratorThat’s interesting, it appears the plugin your using is parsing the entire post and manually inserting the rel=’lightbox[roadtrip]’ on each image link. This seems like it would be horribly inefficient to me, but I could be mistaken.
Regardless, it’s not an option I’d consider for my plugin – BUT – I think it is possible to adjust the filter, though I’ll need some time to mess around with it myself. Ultimately I might ask Christophe, the Slimbox creator, if he could adjust the script to compensate, but I’d like to give it a shot myself first. Unfortunately, that means it might take more than a few days.
On the plus side, unless I’m wrong, and it can’t be done without a massive code rewrite or something on the php level, once it is done it’ll slim down your frontpage (it appears to be the only plugin using the mootools framework, where as several others already use jQuery) and provide you with a more enhanced slimbox interface.
Check back, or if you come up with something on your own feel free to share it.
January 29, 2009 at 11:57 pm #5098Anonymous
MemberYou’re correct, the plugin I’m using (slimbox plugin 1.3 by Peppe Argento) seems to parse every link and preg_replace with the rel="lightbox" code. Maybe that’s why I couldn’t find where to add the same line to your plugin, since it evidently works differently (i.e. more efficiently)!
Just in case it’s unclear to you, when I add a photo to WP (via ZenPhotoPress), my image code looks like this:
It’s telling the i.php file to dynamically-resize IMG_4210 to a height of 500 (to play nicely with the slimbox plugin, which can’t automatically-resize images). This is why I need the autoload feature to look for links ending in either ".jpg&h=500" OR ".jpg&w=500" rather than simply ".jpg" or ".png" It seems like it would be quite easy to do with your plugin. Hopefully this clears up very concisely what my problem is and what solution is needed…
January 30, 2009 at 1:14 am #5099malcalevak
ModeratorYeah, I got that, but i don’t want to look exclusively for .jpg&w=500 or h=500, or whatever, I need to figure out the regular expression for .jpg and additional stuff before the close bracket. Unfortunately I’m not especially good with regular expressions, so I want to make sure I come up with a proper solution, as opposed to just an adequate solution.
That’s why it might take me a little while, unless I get some assistance.
February 2, 2009 at 12:16 am #5100malcalevak
ModeratorJust thought I’d update that I think I’ll have an acceptable modification for you to use for this tonight, though the official release might be a few more days as I iron out my regular expression.
February 2, 2009 at 1:34 am #5101malcalevak
ModeratorThis feature has now been implemented in the development version available at: http://downloads.wordpress.org/plugin/wp-slimbox2.zip
On the off chance your reading this and 15 minutes hasn’t past since posting, the version may not have refreshed, but it will shortly.
Let me know how it works out.
February 2, 2009 at 2:23 am #5102malcalevak
ModeratorActually, I think I’m gonna go ahead and do another release. I’ve added a number of new, if somewhat minor, features/tweaks to warrant one.
-
AuthorPosts
- You must be logged in to reply to this topic.