Member
Member
vincent3569   2011-07-04, 19:29
#1

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

Member
Member
sbillard   2011-07-04, 21:02
#2

Sorry, what do you mean by "connected"? What is displayed when the random image does not display?

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.

Member
Member
vincent3569   2011-07-04, 21:46
#3

sorry, I would mean login rather connected.

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/

Member
Member
vincent3569   2011-07-04, 22:13
#4

to see the problem, I uplicate the page.
'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

Member
Member
sbillard   2011-07-04, 23:09
#5

I do not really have any idea what is wrong. But some suggestions for finding out.

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.

Member
Member
vincent3569   2011-07-04, 23:28
#6
  • The full error reprting is set, but I don't know where the errors are reported.

  • 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 ?

Member
Member
sbillard   2011-07-04, 23:50
#7

The idea behind the var_dump is that you would look at what it shows. Does it show the same thing in both cases?

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.

Member
Member
vincent3569   2011-07-05, 00:23
#8

if you have a look on http://vincent.bourganel.free.fr/zenphoto_t2/index.php?p=pages&title=test, you will the result of var_dump(image).

on home page, I try with
-test
-and
in Codeblock 1

but there is no display

it seems Codeblock of the page are not displayed in all context...

Member
Member
sbillard   2011-07-05, 01:21
#9

Ok, I have found the problem. This use of pages for the home page leaves a little to be desired. There is a codeblock for the index.php page, so that is what is getting used. The code for the theme pages.php that does the printCodeblock() will need to supply the object to get the codeblock from rather than using the default for the "gallery page".

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.

Member
Member
vincent3569   2011-07-05, 06:28
#10

we progress in resolving the problem ... but it is not yet resolved

if I put the following code in page.php:

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)

Member
Member
vincent3569   2011-07-05, 06:48
#11

to be more precise, the behavior is very different between different themes:
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.

Administrator
Administrator
acrylian   2011-07-05, 09:16
#12

Not all themes have all codeblock implemented, the Zenpage theme has only no. 1 on Zenpage pages currently.

Member
Member
sbillard   2011-07-05, 16:15
#13

So maybe you should be running version 1.4.1.1?

Member
Member
vincent3569   2011-07-05, 19:58
#14

I am with 1.4.1.1 (night build 7645).

Be sure that there is an issue : BlockCodes are not displayed on a page choosen for homepage.

Member
Member
sbillard   2011-07-05, 21:55
#15

You are correct, PHP does not work in the gallery level codeblocks. I have no idea why, though. It appears that the PHP eval() function is not recognizing the `

Member
Member
vincent3569   2011-07-06, 21:22
#16

the only thing I can say to help you is that it worked fine with version 1.4.0.3 [6817].
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

Member
Member
sbillard   2011-07-06, 21:45
#17

Maybe you can give the nighty DEV branch a try. I have been working on this problem of what codeblock to invoke.

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.]

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