hi
there is something I don't understand with 1.4.1.
with 1.4.0, I wrote the following code in a Codeblocks of a page. It shows a random image of a dynamic album.
This page is selected as homepage of zenpage theme.
-> everything works fine
with 1.4.1, It doesn't works :
-> when I choose Index page (who is my page), random image is not displayed wether I'm connected or not.
-> if I'm connected and if I choose the page in page menu, the random image is well displayed.
`
`
can you help me to solve this problem ?
thanks in advance
Comments
BTW, I don't think it is the issue, but you should not be calling the makeImageCurrent() function unless you know the image is valid--That is put it inside your test.
nothing is displayed when I am login : the image is placed in the empty space in the page.
you could see the result here : http://vincent.bourganel.free.fr/zenphoto_t2/
'Accueil' page is selected as homepage (called 'Home' in english) -> the image is not shown
'Test' page is the same as Accueil -> the image is shown
in functions-basic up near the beginning make sure that full error reporting is set. `error_reporting(E_ALL | E_STRICT);` if you have PHP5.
If running with that shows nothing then try instrumenting the getRandomImagesAlbum() function. Do a `var_dump($images);` right after where the $images variable is set to the dynamic album's images. See if the result is the same for both cases.
Also try with at normal album to see if somehow this is a dynamic album problem.
- I add "var_dump($images);" , but the problem is still the same
- The problem is still the same with a non dynamic album
another thing :
I notice that the value of $_zp_gallery_page is not the same between 1.4.0 and 1.4.1
- with 1.4.1
when you are on 'home', $_zp_gallery_page = index.php
when you are on 'test', $_zp_gallery_page = page.php
- with 1.4.0, $_zp_gallery_page = page.php in the 2 cases.
maybe there is a lost of context ?
As to the errors, you really need to find out where to look--ask your provider. Error reports are critical for debugging issues.
I doubt that the value of $_zp_gallery_page is the issue, but in anycase, the proper value for the index page should be index.php. Not sure how 1.4.0 got it wrong. The code you showed is not context sensitive to the page.
Given the problem is the same for dynamic/not dynamic albums the most likely cause is a PHP error somewhere. Id you can't find the error log you can do a step by step debug. Start with simple text in the code block and see if it shows up. Then slowly add things until they fail.
on home page, I try with
-<div id="daily-image" style="float: left;">test</div>
-and <?php echo 'test' ?>
in Codeblock 1
but there is no display
it seems Codeblock of the page are not displayed in all context...
Where it has `printCodeblock(1);` It will need to have `printCodeblock(1,$_zp_current_zenpage_page);`
There are other issues as well--specifically `printCommentForm()` There are no comments on the index page. Fortunately this seems to just do nothing rather than generate a fault. Not sure what else might be wrong as well. But the problem is that the page itself is somewhat out of context.
[edit] Ratings do fail since the rating plugin is not prepared to deal with the index.php page. We can fix that.
if I put the following code in page.php:
<? php printCodeblock (1, $ _zp_current_zenpage_page)?>
The following string is displayed a: 3: {i: 1; s: 6: "test 1"; i: 2; s: 6: "test 2"; i: 3; s: 6: "test 3";}
"test 1", "test 2", "test 3" is the content of codeblocks 1, 2 and 3.
This string is displayed as well on the page and the page is the homepage (index.php)
zenpage: the test page, only shows BockCode 1, the index page is blank
garland: the test page, displays BockCode 1 and 2 and there is no index page
zpardoise : the string a: 3: {i: 1; s: 6: "test 1"; i: 2; s: 6: "test 2"; i: 3; s: 6: "test 3";} is displayed.
Be sure that there is an issue : BlockCodes are not displayed on a page choosen for homepage.
But why that happens at the gallery level and not elsewhere is a mystery. Probably should file a ticket on this, but how to fix is not known.
You can see the result on my website here http://vincent.bourganel.free.fr/zenphoto/.
the image is provided by the php code described in my first post and written in BlockCode(1) of my page called Accueil and choosen to be the homepage of my website.
the only difference I found is that the value of $_zp_gallery_page is not the same between 1.4.0 and 1.4.1 as describe above.
I have create a ticket http://www.zenphoto.org/trac/ticket/1934
Added some context to the next_news loop so that we can tell that we should be using the news codeblock and not some other.
Similarly for pages, if we are in page context use the page codeblock.
There still may be some confusion depending on what a theme does. The priority of use is: news, page, image, album, gallery. It will use the first of these where the context is correct.
[Note: on 1.4.0 there were no codeblocks for images, albums, or the gallery, so no possibility of confusig among them.]