ZenphotoCMS Forum
Linking directly to a photo from Album thumbnail - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Linking directly to a photo from Album thumbnail (/thread-726.html)



Linking directly to a photo from Album thumbnail - bmiller - 2006-08-09

I am curious if it is possible to link directly to a photo from the main Album. This would skip opening the album to view all of it's thumbnails, then clicking on a thumbnail to view it.

This would force the user to use the previous/next buttons to view an album.

Any suggestions?




Linking directly to a photo from Album thumbnail - trisweb - 2006-08-10

Yep! If you want the album to link directly to the first image in the album, just call next_image() inside the while(next_album()) and call its printImageThumbnail (or whatever, I'm not looking at the code). You'll get thumbnails of the first image in each album linking directly to that image, bypassing the album page.




Linking directly to a photo from Album thumbnail - bmiller - 2006-08-10

That's great! Thank you!




Linking directly to a photo from Album thumbnail - malheiro - 2007-06-04

hey, tris

i got close to that solution, but i'm really not a php programmer and i'd much appreciate your (or anyone's) help.

so here's how i understood your instructions:

[list]

[*]" title="">

[/list]
and here's what i got:

[list]
[]
[
]
[]
[
]
[*]
[/list]
i surely missed something, but i can't figure out what.




Linking directly to a photo from Album thumbnail - malheiro - 2007-06-04

hey, tris

i got close to that solution, but i'm really not a php programmer and i'd much appreciate your (or anyone's) help.

so here's how i understood your instructions:

`[list]

[*]">

[/list]`

and here's what i got:

`[list]

[*][img]/arquivo/cache/single%20works/Afinidades%20Eletivas.jpg_60_cw60_ch60.jpg[/img]

[*][img]/arquivo/vulgo/image/thumb/[/img]

[*][img]/arquivo/serie%20mexicana/image/thumb/[/img]

[*][img]/arquivo/red%20series/image/thumb/[/img]

[*][img]/arquivo/corpo%20da%20alma/image/thumb/[/img]

[/list]`

i surely missed something, but i can't figure out what.




Linking directly to a photo from Album thumbnail - nocabt - 2008-02-28

I'm in need of the same functionality, and I couldn't get this to work either. Any suggestions?

Thanks.




Linking directly to a photo from Album thumbnail - trisweb - 2008-02-29

There are actually several ways to do this, but I'll give you one example.

In index.php, look for something like this (the album thumbnail):

">

You want to get the first image in the album, and then get the link to that, so do this instead:

`

`

I've just tested this and it works great. One other note - you'll probably also want to edit the image.php for your theme and remove the breadcrumb link to the album, in case you want to hide it completely.




Linking directly to a photo from Album thumbnail - BertSimons - 2008-02-29

I did something like this but with a different approach because for some albums i wanted to go straight to the first image and for some albums just go to the album page.

eg on http://www.bertsimons.nl/zenphoto/ 'paper sculptures' goes to the album page and 'furniture' goes straight to the first image on the image page.

did this like this. in the customdatafield for the albums I insert 'noalbumpage' to define this album as a noalbumpage album cq go straight to the first image.

then on album php at the top I wrote this, actually just a conditional redirect to the first image;

`

ps the breadcrumb stays intact!




Linking directly to a photo from Album thumbnail - trisweb - 2008-02-29

Nice use of the custom data field! I like that solution...




Linking directly to a photo from Album thumbnail - nocabt - 2008-03-05

thanks trisweb, it worked great. Appreciate the help.




Linking directly to a photo from Album thumbnail - lenaluna - 2008-03-12

This is almost what I would like. The only thing I would like extra is not to get the first image by ID, but the manually sorted first image in the album. is this possible? and would someone know how to accomplish that?

thanx much!




Linking directly to a photo from Album thumbnail - harootun - 2009-03-14

I'm a ZenPhoto newbie, and I am DYING to get BertSimons solution to work, but I'm having problems getting it to work.

First off, is this designed to work with mod_rewrite on or off? When it's on (which I don't want for my set-up), it almost works, but adds an extra "/" between the host and the path. When mod_rewrite is off, it doesn't return any image information in the link, just the album ID.

Any advice appreciated!!!!




Linking directly to a photo from Album thumbnail - harootun - 2009-03-14

Hmmm... got it working with mod_rewrite on by taking out the forward slash "/" between $host and $path in the third line from the bottom

header( "Location:http://$host/$path" );
to
header( "Location:http://$host$path" );

but can't get it working with mod_rewrite off. Once again, any advice appreciated!




Linking directly to a photo from Album thumbnail - harootun - 2009-03-14

Got it working with mod_rewrite turned off. At least it's working on localhost on my own machine. Haven't tested it out on my server yet. In any case, here's the revised code that seems to be working:

'

'