Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-03-15 13:09:48

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

what if there are linked images on the page you don’t want FancyZoom to touch?

From the Fancy Zoom page:

“If you explicitly don’t want an image to zoom, add a rel=“nozoom” tag to your href.”

Last edited by jstubbs (2008-03-15 13:10:15)

Offline

#14 2008-03-15 15:21:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_gallery: super-flexible gallery generator

jstubbs wrote:

I turned the smd_lib and smd_slimbox off, and all works fine.

Cool, I’d still like to know why in your case it caused a problem. If I was a betting man I’d say it was either execution order on the page or plugin load order. I’ll do some testing to find out and offer a fix in smd_lib for those that want to run both. Thanks for bringing it to my attention; I’d probably never have spotted this otherwise.

If you have any other improvements or better defaults/docs/examples you think the plugin should have, feel free to share them.

for a quick peek. Looks good to me so far

Hey, nice. Glad it worked out for you.

I’m not sure why sometimes the fullsize images don’t appear — I just get the ‘x’ in the middle of the screen — but by clicking the thumbnail again the pic zooms in properly. I think it’s a problem with FancyZoom itself (or my Firefox/Win) because it does it to me on the demo page as well. Only occasionally, and seemingly randomly.

Y’know, looking at it more closely I can’t believe he coded all that by hand. Kudos to the guy, but it’d be about 1/10th of the size with jQuery instead of around 1000 lines of code, and the cross-browser parts would be handled automatically! I looked to see if anyone’s ported it yet and found one but it’s not finished (no IE support), nor could I get it to work properly :-( I did find this magnifier too, in a different bracket but still useful for product sites I guess.

If you explicitly don’t want an image to zoom, add a rel=“nozoom” tag to your href.

Ah, gotcha. Didn’t see that, thanks for the info. I’d have done it the other way round (rel=“zoom” to enable it) but that’s just me.


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

Offline

#15 2008-03-15 16:04:02

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: smd_gallery: super-flexible gallery generator

Bloke wrote:

I’m not sure why sometimes the fullsize images don’t appear — I just get the ‘x’ in the middle of the screen — but by clicking the thumbnail again the pic zooms in properly. I think it’s a problem with FancyZoom itself (or my Firefox/Win) because it does it to me on the demo page as well. Only occasionally, and seemingly randomly.

One of those is caused by at pageload:

As far I can see, the plugin uses onLoad. So it doesn’t wait or doesn’t act like it should – it just loads onLoad. It should load corretly not like it loads currently: incorrectly. It can be easily fixed by using jquery ($(document).ready(function()) or by fixing the loading.

Second one is possibly caused by almost same kind of thing. The script doesn’t preload (wait for) images before the efects come up – the efect is just stoned – or it can be that i have missed something… but it looks like that.

Last edited by Gocom (2008-03-15 16:12:20)

Offline

#16 2008-03-17 13:37:04

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Are there any examples for reading images from a directory? I’m receiving this error…

Tag error: <txp:smd_gallery directory="/images/gwar" match="JPG" form="gallery2" thumbsize="128," debug ="4" /> ->  Notice: Undefined variable: randsort  on line 205

Offline

#17 2008-03-17 15:18:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_gallery: super-flexible gallery generator

secundar wrote:

Are there any examples for reading images from a directory?

Err, currently no, sorry. But that error is just a warning due to me forgetting to set something in directory mode. When you put your site to Live it’ll disappear, but I will fix it in the next release. Thanks for letting me know.

My guess at the reason your directory version isn’t working is because of the way directories work in web land. If you specified the full server path to your images it’d work (e.g. /home/secundar/www/my_site/images/gwar). If your host has allowed fopen_url support you should also be able to specify the directory with the full URL as http://my_site.com/images/gwar. Unfortunately I am unable to test this because my hoster doesn’t allow it. Grrrr.

If you have asy_wondertag installed you may also be able to wrap it round smd_gallery and use: directory="<txp:site_url />images/gwar".

I’d be very interested in your experiences and whether it works because it’s almost totally untested at the moment. I threw it in the code because I thought it might be useful one day.

Sorry I can’t be of much more help right now but if you have any more problems with it, please let me know the details and I’ll try and fix the code based on your error messages and feedback. If you do get it working and would like to let me know how you got it going (tag/form etc) I can add it to the help file as an example too.

btw, is that ‘gwar’ as in the mad thrash metal band of the late 80s? ROCK :-)


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

Offline

#18 2008-03-17 16:13:47

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Thanks Stef,

I changed the site to Live and here’s what i get:

Fatal error: Call to undefined function smd_split() in /var/www/textpattern/lib/txplib_misc.php(574) : eval()'d code on line 258

Yes, it is the Gwar you speak of! I’ve got quite a few images I need to get up in a gallery so it looks like I’ll have to get them into the image tab to move forward today… And thanks for your plugin — very nice, and I’ll look forward to being able to use directories.

Cheers!

Offline

#19 2008-03-17 16:44:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_gallery: super-flexible gallery generator

secundar wrote:

Call to undefined function smd_split()

D’oh! Missed that one. Fix for that and the other warning is in v0.32 [ compressed ]

It’s just occurred to me looking through the code that I have not implemented sorting in directory mode either yet. I’ve added it to the ToDo list and when I get some feedback on how well (or not) the facility works I’ll expand its features. Thanks for being patient in these early stages.

Yes, it is the Gwar you speak of!

Sweeeeet. All hail the mighty GWAR and their unique brand of screaming vocals. And flinging dubious things into the crowd. Never made it to a gig but my friend at school said they were great.


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

Offline

#20 2008-03-17 17:57:58

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Ok, I gave it one last try with asy_wondertag as you recommended:

<txp:asy_wondertag><txp:smd_gallery directory="<txp:site_url />images/gwar"  form="gallery2" pageform="gallerypage"  limit="20" thumbsize="128," /></txp:asy_wondertag>

But it does not render the gallery images, nor does it give an error. The tag simply doesn’t like directory=“http://…” or directory=”/images/…”. Using the complete path on the server rendered the proper html but my server will not display images referenced like so: /var/www/images/gwar/…

I can continue testing if you can give me some tips but I’ll also need to continue setting up my pagination using the images I’ve added to the images tab. EDIT: I guess I didn’t quite understand pagination from the start: What I want to do is present the thumbnail index, then, clicking on a thumbnail will bring up a page (no popup) with the full-size image, with next and previous navigation below.

I hope I’m making sense. I don’t do much web design these days so I’m a little rusty.

Last edited by secundar (2008-03-17 18:11:20)

Offline

#21 2008-03-17 20:30:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_gallery: super-flexible gallery generator

secundar wrote:

Ok, I gave it one last try with asy_wondertag as you recommended… But it does not render the gallery images,

Ah yeah, bogus info again, sorry I’m half asleep. I wonder if the <img> or <a> tags will render full server images if given file:// as a prefix. I have no idea, but you can try it if you like.

The tag simply doesn’t like directory=“http://…”

That may be your server setting. A number of hosters disable fopen_url and it’s equivalents in an effort to try and thwart security attacks. Often misguidedly, imo, but that’s another story.

Sounds like, until I get my act together with the directory option (i.e. find a host who has fopen_url enabled, or just ditch support for directories), the images tab is the easiest way to manage pics in this case. Set up a category called ‘gwar’ and dump all your pics in there.

What I want to do is present the thumbnail index, then, clicking on a thumbnail will bring up a page (no popup) with the full-size image, with next and previous navigation below.

Hmmm, you mean, like this, but with thumbnails instead of text links ? (that site’s not currently made in TXP unfortunately).

I’m not sure any gallery script will handle that because it spans two pages. I messed about with conditionals and offsets and passing URLs around; I came close (very close) with smd_gallery but couldn’t quite get it to work (in fact I think I’ve uncovered some strangeness in the offset calculation but I’m not sure yet – if I find it’s a bug and fixing it helps in this case I’ll post this example as an extreme case of how mad you can get with smd_gallery!)

So I think if you want that sort of gallery you’ll probably have to resort to some PHP, pass the URL (or ID) of the image you want to display to the address bar, read it in and display it. Navigation will probably have to be done by hand as well, but that’s just my gut reaction. Someone else might be able to come up with a good way of doing it.

I’d suggest saving yourself some hassle and using a lightbox or similar gallery to “keep it all on one page” and navigate within the lightbox. Since you only want next/prev then it’s ideal, plus the thumbnails are always a click away behind the main image so your prospective visitors can jump around in the gallery as well.

Sorry it’s not exactly the answer you’d like. If I find a way of doing it neatly I’ll yell. In the meantime I’ll rebadge the smd_gallery description as something less glamorous so people don’t get their hopes up in future on the back of my half-assed coding! :-)

Last edited by Bloke (2008-03-17 20:30:31)


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

Offline

#22 2008-03-17 22:31:30

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: smd_gallery: super-flexible gallery generator

Hey Stef, thanks so much for your thoughts…Yes, just like you have it on your site but I’m going to take your advice and try one of the pop-up options — hopefully something lightweight. I’ll update this thread when it’s up so you can see a couple shots of Gwar.

Some nice photos on your site BTW. I had a laugh, thanks!

Offline

#23 2008-03-21 03:47:25

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: smd_gallery: super-flexible gallery generator

great work bloke

any chance of a <txp:smd_gallery id="?custom_field" ... />

tried using asy_wondertag to wrap around tag & injected txp:custom_field tag into the ID attribute – but no success immediately

Offline

#24 2008-03-21 15:32:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_gallery: super-flexible gallery generator

nardo wrote:

any chance of a <txp:smd_gallery id="?custom_field" ... />

D’oh! It was working up until the mod to v0.31 where I messed up the SQL query. Give 0.33 a go instead [ compressed ].

Sorry about that, thanks for spotting the bug.


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

Offline

Board footer

Powered by FluxBB