Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#673 2011-01-23 11:15:55
Re: smd_slimbox
johnpeat wrote:
I think using ?id for both article and image ids is daft – surely they should be different to avoid this sort of cockup?
I’m not sure why ?id
resolves that way under TXP 4.3.0 in violation of the documentation (perhaps it always did use the image ID and the docs are wrong!).
In fact the plugin needs some love because there are some deprecated functions in there. But if you want to use the atricle ID, try ?thisid
instead.
Last edited by Bloke (2011-01-23 11:16:38)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#674 2011-01-23 19:14:32
- johnpeat
- New Member
- Registered: 2011-01-22
- Posts: 5
Re: smd_slimbox
Cheers – I’ll try that ASAP :)
Offline
#675 2011-01-29 15:07:03
- johnpeat
- New Member
- Registered: 2011-01-22
- Posts: 5
Re: smd_slimbox
Thanks for that – works like a charm! :)
Offline
#676 2011-02-09 04:04:28
- akurei77
- New Member
- Registered: 2011-02-04
- Posts: 4
Re: smd_slimbox
I’m having some trouble getting the thumbnail options to work correctly. My first clue was a page long error message, the highlight of which is:
Notice: Undefined offset: 8192 in C:\Users\Jon\xampp\htdocs\moap\textpattern\lib\txplib_misc.php on line 587
This is followed by a smaller line reading
Tag error: <txp:smd_slimbox imageid="?article_image" thumb="0" thumbsize="600px,150px" /> -> : Function ereg_replace() is deprecated on line 280
And after that it lists a bunch of function call addresses. The whole thing is repeated a few times with varying line numbers.
This error only occurs when I add thumbsize="600px, 150px"
to my tag, which otherwise is <txp:smd_slimbox imageid="?article_image" />
A more subtle issue is that the thumb="0"
option doesn’t seem to be doing anything when it is added. My site’s default thumbnails are 150px square, while I’d like certain sections to use large “thumbnails” for image posts. I was attempting to do this by turning thumbnails off and dynamically resizing the image to fit within the content area, until a user clicks it and brings up the full sized image in a lightbox (well, slimbox2). I should note that thumb="1"
works exactly as described. The thumbnail size here works (with the errors listed above), but it stretches my 150x thumbnail which I was hoping to avoid.
I should probably mention that I am using the smd_thumbnail plugin to create the default thumbnail for use on the admin side (though I just disabled it, uploaded a new image with thumbnail using the standard dashboard, and got the same result). I’m also using bot_image_upload to allow management of images from the write tab, but it doesn’t seem like that should conflict. Also, slimbox is working, so it looks like the install is at least halfway correct.
Any thoughts on what I might have done wrong? Worst case scenario I can just turn off debugging and forget about the error message, but I’d like to figure out how I’m supposed to override the default thumbnail to get something a little more presentable.
Thanks.
Offline
#677 2011-02-09 09:55:52
Re: smd_slimbox
akurei77 wrote:
Function ereg_replace() is deprecated on line 280@
Oops, yes, that’s a problem with the code when you run PHP 5.3+. It’s nothing to worry about (yet) but if you want to fix it yourself, go into the plugin code and find all occurrences of ereg_replace
and swap them for preg_replace
. Then, on each line that you did that, look at the first argument to the preg_replace functions, which’ll look something like this "[0-9]"
or this "[^0-9]"
. Just put forward slashes around the outside of the square brackets so, for example, they now read something like:
"/[^0-9]/"
That should make the warnings go away at least.
the
thumb="0"
option doesn’t seem to be doing anything when it is added
Another bug that I was recently alerted to in both smd_gallery and this plugin. Dunno how that one slipped through, as it’s a bit of a schoolboy error. Two things you can do. The first is to specify thumb="0:0"
as an attribute. Secondly, fix the plugin by changing line 109 from:
$thumbmod = "t";
to:
$thumbmod = ($thumbOpts[0] == 1) ? "t" : "";
I’ll fix both of those things in the next version. Not convinced it’ll entirely solve your second problem because the nature of smd_slimbox is that thumbnails can’t be “turned off” as such. You can just swap them from large to small (well, you can once the code’s fixed or you use the 0:0
syntax!)
If you really want more control over the gallery and its thumbnails then you can try smd_gallery. Or, perhaps better since you’re running 4.3.0, the new core image tags should give you the control you need because you can build the anchor links exactly how you want, putting in calls to smd_thumbnail where you need them to display the proper sized thumbnail. This also has the benefit that you could potentially remove two plugins: smd_slimbox and smd_lib!
Hope some of that helps. If you want some pointers on using the core image tags to replace smd_slimbox functionality, just ask and I’ll do what I can.
Last edited by Bloke (2011-02-09 09:57:49)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#678 2011-02-09 11:32:50
Re: smd_slimbox
Maintenance release v0.34 that just fixes the two gotchas spotted by akurei77. Namely:
- PHP 5.3+ compatibility fix (preg_replace now used instead of the deprecated ereg_replace)
- Fix for the
thumb
attribute when using single digitthumb="0"
I also took the opportunity to spruce up the help a little, removing old links and bit of general tightening here and there. Hope that makes it easier to use.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#679 2011-02-10 08:47:47
- akurei77
- New Member
- Registered: 2011-02-04
- Posts: 4
Re: smd_slimbox
Bloke wrote:
I’ll fix both of those things in the next version. Not convinced it’ll entirely solve your second problem because the nature of smd_slimbox is that thumbnails can’t be “turned off” as such. You can just swap them from large to small (well, you can once the code’s fixed or you use the 0:0 syntax!)
If you really want more control over the gallery and its thumbnails then you can try smd_gallery.
Thank you! I installed the updated version, and it worked exactly as I imagined. Setting thumb="0"
told it to grab the full sized image as a thumbnail, then thumbsize
shrunk the thumbs down to fit into the content area. It looks pretty nice, actually, at least for the images sizes I’m working with.
You made me realize, though, that I do need more control over the galleries. Maybe you can point me in the right direction as far as choosing between smd_gallery and the core abilities? I’d like to form a gallery based on each image, matching one particular image category. Just because I keep thinking that sentence sounds a bit ambiguous, I’ll give an example:
Start with an image where author="akurei77"
and category1="comic"
and category2="strip_name"
. Return a gallery with all images of category=strip_name
. But don’t just return all images with “comic” as a category, and the “strip_name” category name would be pulled from the image so it doesn’t have to be hardcoded.
Any thoughts on whether smd_gallery would be the best way to achieve this?
Thanks again.
Offline
#680 2011-02-10 14:10:49
Re: smd_slimbox
akurei77 wrote:
Thank you! I installed the updated version, and it worked exactly as I imagined.
Excellent, you’re welcome. Thanks for spotting the bugs.
Start with an image where
author="akurei77"
andcategory1="comic"
andcategory2="strip_name"
Can I just stop you there, please? Images in TXP can only have one category (Articles have two), so before I can help you figure this out, would you be able to just think through the logic again and present a case with that in mind? smd_gallery will definitely be able to be bent into whatever shape you wish, but depending on what your vision is for the interaction of each image, what the user clicks to view what, how many images you expect to see per page, and so on, the core tags might well be able to handle it with ease.
For inspiration, btw, I suggest looking through Jeff’s fantastic image demo which shows you the sort of things that the core tags can do. If any of those fit your use case then you’re away!
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#681 2011-03-22 19:52:01
- RabbitMountain
- New Member
- Registered: 2011-03-22
- Posts: 5
Re: smd_slimbox
Hey — does this plugin still work? I have .34 installed with TXP 4.3 and I can’t get it to do anything. The lightbox functionality works fine, but I cannot get the images to group as anything except everything all together.
I am trying to create a separate little gallery for each article on the articles list page. The big mystery: how on earth do you tell slimbox which images go with which articles?
Under deadline, please help. Thanks in advance.
—Paula
Offline
#682 2011-03-22 20:27:13
Re: smd_slimbox
RabbitMountain wrote:
does this plugin still work?
Yes.
I am trying to create a separate little gallery for each article on the articles list page.
Then you’ll need to try the groupname
attribute and give it something that is unique to each article but common to everything inside that article so that all images in an article get the same value but they are all distinct from other articles. A good candidate here might be the article ID: groupname="?id"
. Try that and see what happens.
If that doesn’t work it’ll depend how you’ve set your galleries up. Do you list the images by ID in the Article Image field? Or are they all categorised so each article has its own image category (and where do you indicate this in your article fields?) Are you putting the smd_gallery tag in a Form or is it in the article itself? And so on.
In the event the ?id
doesn’t work if you can supply a link to the site or some more info about how you’ve set it up it’ll help me to help you faster.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#683 2011-03-22 20:41:07
- RabbitMountain
- New Member
- Registered: 2011-03-22
- Posts: 5
Re: smd_slimbox
Thanks so much for the quick response. I did try the groupname and got no results.
The page in question is here: http://tricklesaac.com/inventory
My slimbox code right now looks like this: <txp:smd_slimbox groupname=”?id” />
I have the image ID #‘s listed in their respective articles’ article-image field. What am I missing here?
Last edited by RabbitMountain (2011-03-22 20:46:49)
Offline
#684 2011-03-22 20:53:52
Re: smd_slimbox
RabbitMountain wrote:
The page in question is here: http://tricklesaac.com/inventory
*headscratch*
On your inventory landing page you have two articles, right? Namely 2000 BOURGET BIKE WORKS FAT DADDY
and 2000 Test Harley
? But both articles have the same images listed in their article image field? Or are they Sections? They’re behaving like sections.
If you look at the source code you’ll see that the anchors, images and thumbnails are identical in both ‘Test harley’ and ‘Bourget bike’. So I can’t quite figure out how you want this to behave. With identical images, the plugin is going to struggle to do what you want.
Please would you just clarify what the various elements are? i.e. what sections you have, what some of your inventory articles are called, where you smd_slimbox tag is (in the default Form?) and what exactly you are trying to achieve. It’s behaving as if each single thumbnail is a separate article and you’re repeating the same articles in two different Sections but somehow listing those on the Inventory page. It’s proabbly just late and my brain’s getting tired but I can’t figure out what’s going on.
Thanks for any pointers to kickstart my head.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online