![]() |
|
php code in Codeblocks doesn't work with 1.4.1 - 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: php code in Codeblocks doesn't work with 1.4.1 (/thread-8800.html) |
php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-04 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. with 1.4.1, It doesn't works : ` ` can you help me to solve this problem ? php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-04 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. php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-04 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/ php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-04 to see the problem, I uplicate the page. 'Test' page is the same as Accueil -> the image is shown php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-04 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. If running with that shows nothing then try instrumenting the getRandomImagesAlbum() function. Do a Also try with at normal album to see if somehow this is a dynamic album problem. php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-04
another thing : I notice that the value of $_zp_gallery_page is not the same between 1.4.0 and 1.4.1
maybe there is a lost of context ? php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-04 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. php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-05 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 but there is no display it seems Codeblock of the page are not displayed in all context... php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-05 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 There are other issues as well--specifically [edit] Ratings do fail since the rating plugin is not prepared to deal with the index.php page. We can fix that. php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-05 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";} This string is displayed as well on the page and the page is the homepage (index.php) php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-05 to be more precise, the behavior is very different between different themes: php code in Codeblocks doesn't work with 1.4.1 - acrylian - 2011-07-05 Not all themes have all codeblock implemented, the Zenpage theme has only no. 1 on Zenpage pages currently. php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-05 So maybe you should be running version 1.4.1.1? php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-05 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. php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-05 You are correct, PHP does not work in the gallery level codeblocks. I have no idea why, though. It appears that the PHP php code in Codeblocks doesn't work with 1.4.1 - vincent3569 - 2011-07-06 the only thing I can say to help you is that it worked fine with version 1.4.0.3 [6817]. 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 php code in Codeblocks doesn't work with 1.4.1 - sbillard - 2011-07-06 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.] |