Following an upgrade to 1.4.3, printRandomImages fails.
I have traced it to a malformed <img_src> definition for the images. Page source for the failing webpage shows the following for the thumbnails:
<img src="http%3A//......
If I replace "pathurlencode" with "html_encode" in the printRandomImages function definition in template-functions.php, lines 3383, 3386, 3389 the images display correctly.
Would appreciate guidance.
Michael
Comments
So again if I look at the page source of a "failing" page I see: On a "working" page (1.4.2.4 [10045] (Official Build)) the links look like: 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
The second problem is indeed an error in that function. It will be corrected in the nightly build
The theme page "PageTop.php" includes the following code:
`
<?php
//generic top and sidebar of pages
/*
* This script is an example of how to use Zenphoto content from a Non-Zenphoto WEB page.
* You must define SERVERPATH and WEBPATH to correctly point at the Zenphoto installation.
* Here we are presuming that the running script is in the root of the WEBsite and the
* Zenphoto installation is in a folder named "zenphoto" within that root folder.
* Required to display comments and random thumbnails at the bottom of pages
*/
define('SERVERPATH',str_replace('\\','/',dirname(__FILE__)).'/zenphoto');
define('WEBPATH','http://domainname/zenphoto');
/*
* Now we "include" the Zenphoto template functions. This will instantiate the Zenphoto installation
* and make all theme functions available to us.
*/
require_once(SERVERPATH.'/zp-core/template-functions.php');
charset=' . getOption('charset'));
?>
`
The page used to display random thumbnails on each page is "PageBottom.php". It simply uses:
`
<?php
PrintRandomImages(4,null,'all',null,115,115,true,false);
?>
`
I'm guessing from your comment that it may be related to my use of
`define('WEBPATH','http://domainname/zenphoto');`
Michael
Are you interested in testig? And can you run a copy of the DEV build in test somewhere for that purpose?
`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`
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:
`
`
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:
`<a href="/public_html/zenphoto/brigades-and-squadrons/229 Signal Squadron/Berlin62.jpg.php" ....`
(The latter having been amended to eliminate the second of my problems outlined above).
I hope this is clear, and please let me know how I can help with the DEV build.
Michael
`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.
WEBPATH:/zenphoto
SERVERPATH:/home/username/public_html/zenphoto
`define(`WEBPATH', '/zenphoto');
define('SERVERPATH`,'/home/username/public_html/zenphoto');`
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