ZenphotoCMS Forum
printRandomImages fails after update to 1.4.3 - 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: printRandomImages fails after update to 1.4.3 (/thread-10201.html)



printRandomImages fails after update to 1.4.3 - mowgli597 - 2012-07-15

Following an upgrade to 1.4.3, printRandomImages fails.

I have traced it to a malformed definition for the images. Page source for the failing webpage shows the following for the thumbnails:




printRandomImages fails after update to 1.4.3 - acrylian - 2012-07-15

I am sorry, I cannot reproduce it on my local install. All works as expected for me.




printRandomImages fails after update to 1.4.3 - mowgli597 - 2012-07-15

Oh dear. I'm also having trouble with "printLatestComments" where once again the link to the image page which contains the comment also seems to be malformed.

So again if I look at the page source of a "failing" page I see:

Quote:a href="/zenphoto/divisions-and-regiments/8-signal-regiment.php"
On a "working" page (1.4.2.4 [10045] (Official Build)) the links look like:

Quote:a href="/zenphoto/divisions-and-regiments/8-signal-regiment/3 TR.jpg.php"
What's missing is the image name - in the working example above "/3 TR.jpg"

I can make "printLatestComments" work by replacing the 1.4.3 code with the definition of the function from the 1.4.2.4 [10045] (Official Build) release.

I'm using Zenphoto version 1.4.3 [10461] (Official build)

Michael




printRandomImages fails after update to 1.4.3 - sbillard - 2012-07-15

For the first issue, please help us understand hot you got an image link with "http:\" in it. None of the printRandomImages() paths seem to return anything but the relative link.

The second problem is indeed an error in that function. It will be corrected in the nightly build




printRandomImages fails after update to 1.4.3 - mowgli597 - 2012-07-15

It's related to the problem I experienced with ticket #2203 (using template-functions.php in non-Zenphoto webpages).

The theme page "PageTop.php" includes the following code:

`




printRandomImages fails after update to 1.4.3 - sbillard - 2012-07-15

Got it. We will have to update the functions to accomodate those URLs. It was not expecting the HTTP://domain part.

Are you interested in testig? And can you run a copy of the DEV build in test somewhere for that purpose?




printRandomImages fails after update to 1.4.3 - sbillard - 2012-07-16

BTW, I am not sure if having the http part in WEBPATH won't cause other problems. Zenphoto has two defines it uses:
WEBPATH for typically a relative web link and FULLWEBPATH that is used when the full server protocol is needed.

What you have done will make FULLWEBPATH incorrect as it is based on WEBPATH




printRandomImages fails after update to 1.4.3 - mowgli597 - 2012-07-16

Ah! I thought that might be it.

I'm afraid my php skills are those of an enthusiastic amateur of the Google and "copy and paste" variety. However I would certainly try to assist in whatever way I can.

I have a sub-domain of my site, which is loaded in a sub-directory off the main site root. It contains a full copy of the main site and its own Zenphoto installation so in that sense I hope it mimics to some degree my live environment.

The reason why I had to define WEBPATH using http://domain was that the way it is set up in the standard release also includes the server root folder name, and this causes problems when trying to access data in the Zenphoto installation.

Thus I get the following results using the standard setup:

SERVERPATH: /home/username/public_html/zenphoto
WEBPATH: /public_html/zenphoto
FULLWEBPATH: http://domain/public_html/zenphoto

With this setup, using printRandomImages in a non-Zenphoto site page, I get the following page source created for each list element:

`
[img]/public_html/zenphoto/zp-core/i.php?a=divisions-and-regiments/7-signal-regiment&i=4sqn_7sr_1977_1980_0016.jpg&w=115&h=115&c=1&cw=115&ch=115&q=75&t=1&wmk=![/img]

`
with the additional "/public_html/" construct giving me a page not found error.

The same happens with printLatestComments where the source code for each list element shows:

`




printRandomImages fails after update to 1.4.3 - sbillard - 2012-07-16

Can you add a couple of echo statements to your them so we can get some details.

echo ' WEBPATH:'.WEBPATH; echo ' SERVERPATH:'.SERVERPATH'

visit your site through your normal link to the site (not via the external scripts) and see what is shown for these values. That is what should be in your defines.




printRandomImages fails after update to 1.4.3 - mowgli597 - 2012-07-16

Adding those lines within the Zenphoto installation theme files gives:

WEBPATH:/zenphoto
SERVERPATH:/home/username/public_html/zenphoto




printRandomImages fails after update to 1.4.3 - sbillard - 2012-07-16

Then your defines in the external path should be
define(WEBPATH', '/zenphoto');
define('SERVERPATH,'/home/username/public_html/zenphoto');




printRandomImages fails after update to 1.4.3 - mowgli597 - 2012-07-17

That's fixed it!

Many thanks for your patience and help.

And just to confirm that the file template-functions.php from zenphoto-2012-07-16-trunk has cured the printLatestComments problem for me.

Again my thanks.

Michael




printRandomImages fails after update to 1.4.3 - sbillard - 2012-07-17

Thanks for the update