Member
Member
thestormtrooper   2009-10-15, 22:12
#1

Hi,

I'm wanting to make my image page go to the next image when you click the image... then when at the last image in the sequence when you click it for it to go back to the first in the album? loop back round basically.

I've had a search and all I could find was this:

http://www.zenphoto.org/support/topic.php?id=2886#post-17289

and this:

http://www.zenphoto.org/support/topic.php?id=1225#post-6896

I've had a try and failed, I'm not the best at this stuff so totally lost as to the code I should put in??

Any help is greatly appreciated.
Thanks.

Member
Member
kagutsuchi   2009-10-16, 02:16
#2

The first link you posted gives you the code necessary for what you're asking. All you need to do is to put the code in your theme page, image.php to be exact. However, it would probably be best that you create your own custom theme with this change (if you haven't already), otherwise your changes will disappear after updating zenphoto.

You might want to read the theming tutorial if you're having trouble with adding the code to your theme file. It gives explanations and insight into how themes in zenphoto work. http://www.zenphoto.org/2009/03/theming-tutorial/

Member
Member
thestormtrooper   2009-10-17, 14:18
#3

Thanks for the response...

I've tried putting the code in to my theme within the image.php page in the image div and no matter which version I choose or how I alter it I still can't get it working? I can get it working in the original way to see thickbox, or full size image, or no link at all, but just can't seem to get it to go to the next image then loop back!?

The first link above the guy seemed to have figured it out, but there is so many variations then slight confusion at the end as to whether it was solved in the end or not?

If anyone could help me out I would appreciate it. Almost reaching my final design :-)

Thanks again.

Member
Member
kagutsuchi   2009-10-17, 16:21
#4

In the first link, the code in the responses all build off of the last, so the code you want will be the last posted:

`

else { ?>

However, the code exactly how it is is still not completely correct; it needs to have the change posted by acrylian to work (else { ?>` needs to be ``).

There is also one other minor change that should be made - printCustomSizedImageMaxHeight is considered deprecated, so you should replace printCustomSizedImageMaxHeight with printCustomSizedImageMaxSpace (see http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomSizedImageMaxHeight in the functions guide for details).

Member
Member
thestormtrooper   2009-10-17, 18:20
#5

Mmmm...

I've got:

`

`
and... it doesn't work? I'm sure it's an error someone who knows about php more than me will be able to spot instantly?

Returns: Parse error: syntax error, unexpected '}' in C:\Inetpub\vhosts... etc

Thanks again.

Member
Member
thestormtrooper   2009-10-17, 19:25
#6

If I remove the last `` it then works but the original full size image is displayed...

My working code before was as follows:

`

    [url=

] title="">

`
I basically want to get that code working with the click image to go to the next image and loop back round function?!

Hope that all sounds clear??

Member
Member
thestormtrooper   2009-10-17, 19:39
#7

I've been trying and trying different methods...

`

`
That code seems to work but my comments only show up in the last picture of any album? other than that it all seems to work? well except for the fact I've not figured out how to incluce the image alt tag again yet... Light at the end of the tunnel though :-)

Member
Member
thestormtrooper   2009-10-17, 23:47
#8

Sorted... Just in case anyone looks at this in the future... this is the code that I got working, not sure if it's correct or not but it works!

`

`

Junior Member
Junior Member
cb0gus   2012-01-14, 01:30
#9

Sorry for reviving an older thread - but I really needed this feature. This is how I've done it - not sure if this is a safe or even sane thing to do though. Works with ZP 1.4.1.5:

--- themes/zenpage/image.php.bak 2012-01-12 05:58:03.810204278 +0100
+++ themes/zenpage/image.php 2012-01-14 01:15:57.890243727 +0100
@@ -75,7 +75,7 @@

Member
Member
micheall   2012-01-14, 08:03
#10

You should upgrade from 1.4.1.5 to at least 1.4.1.6, if not to the 1.4.2 release candidate. 1.4.1.5 still had security vulnerabilities.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.