![]() |
|
Zenpage - Create albumobject from albumname in codeblock - 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: Zenpage - Create albumobject from albumname in codeblock (/thread-9627.html) Pages:
1
2
|
Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-12 On a Zenpage page I'm tying to get a random image from a specific album.
I just can't figure out what's wrong :-( Zenpage - Create albumobject from albumname in codeblock - acrylian - 2012-02-12 Sure the value get from getCodeblock is correct? Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-12 Let's say the input in the codeblock is for example [i]testalbum[/i] Zenpage - Create albumobject from albumname in codeblock - acrylian - 2012-02-12 That's weird then and does not really make sense... No idea right now, that should actually work.. Zenpage - Create albumobject from albumname in codeblock - sbillard - 2012-02-13 You should have got an error if the album was not created. Did it provide any clues? Did you look at the page html of the echo? You cannot really trust what the browser shows, there might be markup or such included. Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-13 The posted code does work (without errors) but it shows random images from the entire gallery. Only if I hardcode an [i]albumname[/i] does it show random images from that specific album. Zenpage - Create albumobject from albumname in codeblock - acrylian - 2012-02-13 Hm, for the function it is really meaningless where the value comes from. I will try later as well. Before that, just to be sure you are not confusing yourself: the option defines the root album so that means all sub albums are used as well. Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-13 Thanks. Zenpage - Create albumobject from albumname in codeblock - acrylian - 2012-02-13 I just tried with trunk and Zenpage theme. I used a top-level album with 3 images and reloaded the page dozens of times. I always got only images from it. So I am sadly not able to reproduce it using the whole gallery as there are 8 albums and 3 dynamic ones additionally. Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-13 Much appreciated! I'll investigate further. Zenpage - Create albumobject from albumname in codeblock - sbillard - 2012-02-13 You did say that the album object was created only if you hardcoded then name. Is that the case, or is an object being created? Similar question for the image object. Is one created? My speculation is that the answere to both these is that the object is not created. If Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-13 If change this: I also checked if an albumobject and an imageobject were created by using: I now see different results on different installs: On another it does not work with the Nightly Trunk. Zenpage - Create albumobject from albumname in codeblock - sbillard - 2012-02-13 So, I guess the next test is as follows: first make a test Then check to see if the two versions both fail on the PC that has the Nightly Trunk. But I suspect so. If you are using todays' SVN Trunc and last night's Trunk nightly then there is only one change to the Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-13 Well, the first test allready failed.
EDIT: That is on the PC with the Nightly Trunk Zenpage - Create albumobject from albumname in codeblock - sbillard - 2012-02-14 So the codeblock does not contain the string Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-14
Zenpage - Create albumobject from albumname in codeblock - acrylian - 2012-02-14 That's weird, why does it work for me out of the box? Zenpage - Create albumobject from albumname in codeblock - sbillard - 2012-02-14 Well, there seems some difference otherwise the equal test would come up true. As to what, I really do not know. But if $albumname is really not equal to "testalbum" then that does explain why the rest does not work. Zenpage - Create albumobject from albumname in codeblock - fretzl - 2012-02-16 If I put the albumname in another codeblock it suddenly works! Now this might be something: Zenpage - Create albumobject from albumname in codeblock - acrylian - 2012-02-16 Maybe funny cache tricks again? Yes, if you don't set a root album it uses the whole gallery. We once had a php issue with NULL vs empty, so on some servers it triggered wrong somehow. Try adding a check if the code block is empty so it is not used. |