ZenphotoCMS Forum
Upgrade to 1.4.3 has stopped album image statistics from working - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html)
+--- Thread: Upgrade to 1.4.3 has stopped album image statistics from working (/thread-10132.html)



Upgrade to 1.4.3 has stopped album image statistics from working - annihilate - 02-07-2012

Hi

I have just upgraded to 1.4.3 and now my use of album image statistics plugin has stopped working. I have a page completely seperate from zenphoto on my site where I had the following includes of zenphoto files.
`

include DOCUMENT_ROOT.'/gallery/zp-core/template-functions.php';

include DOCUMENT_ROOT.'/gallery/zp-core/zp-extensions/image_album_statistics.php';

$latest_images = getImageStatistic(9, 'latest', '', false);

`
However, when I go to this page, I get zenphoto saying it has detected a change in myinstallation and to reupload all the setup files. I have done this twice now and still the same issue every time. Access to my gallery works perfectly fine, so this is only happening on this one page. I have commented out the last two lines so it just does an include of template-functions.php and still the error occurs.

Any ideas on why this isn't working? Is there another file I need to be including?




Upgrade to 1.4.3 has stopped album image statistics from working - acrylian - 02-07-2012

Sorry, I have no idea as we do not test or investigate any usage outside of Zenphoto. MAybe try including "functions.php" as well.




Upgrade to 1.4.3 has stopped album image statistics from working - annihilate - 02-07-2012

Ok. Thanks for your response. I've worked out what the issue is and basically the changes made in 1.4.3 to functions-basic.php have made it impossible to now include that file from a standalone page outside of the main zenphoto folder.

Is there a reason why the way the paths are worked out was changed from this:
`

dirname(dirname(FILE)) . '/' . DATA_FOLDER . "/zenphoto.cfg"

`

to this:
`

$const_serverpath.'/'.DATA_FOLDER."/zenphoto.cfg"

`

where $const_serverpath is worked out using the script filename, which is the filename of the script that does the include.
`

$const_serverpath = str_replace('\','/',dirname($_SERVER['SCRIPT_FILENAME']));

`




Upgrade to 1.4.3 has stopped album image statistics from working - sbillard - 02-07-2012

These changes were made to support cloning installs via symlinks. The script itself now does not necessarily reside in the same folder as the install now.




Upgrade to 1.4.3 has stopped album image statistics from working - sbillard - 02-07-2012

There is a change in tonight's nightly build which should re-enable the outside of zenphoto use of zenphoto functions.

You will have to add a define for SERVERPATH to your code, though. define('SERVERPATH',DOCUMENT_ROOT.'/gallery'); should probably be correct.




Upgrade to 1.4.3 has stopped album image statistics from working - annihilate - 03-07-2012

Thanks for that. I have added the following to functions-basic and it now works perfectly if I define the SERVERPATH before the include.
`

if (defined('SERVERPATH')) {

$const_serverpath = SERVERPATH;

}

`
I also needed to define the OFFSET_PATH before doing the include as line 20 in functions_basic.php does an if (OFFSET_PATH) and this generates stuff in the error logs about undefined constant if it hasn't been defined. I set it to zero and it seems to work, but I'm not to sure what it should be.

Thanks for your help.




Upgrade to 1.4.3 has stopped album image statistics from working - sbillard - 03-07-2012

The lines you added are what I committed to the nightly. Zero for OFFSET_PATH is good. That is the value for "front-end" access.

I guess we need to make an article about how to do this now. Maybe you could post a draft of what you needed to do?