zenphoto forums » Plugins

Upgrade to 1.4.3 has stopped album image statistics from working

(7 posts)
  • Started 10 months ago by annihilate
  • Latest reply from sbillard
  1. annihilate

    Apprentice
    Joined: Jul '12
    Posts: 3

    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?

    Posted 10 months ago #
  2. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,367

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

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  3. annihilate

    Apprentice
    Joined: Jul '12
    Posts: 3

    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']));

    Posted 10 months ago #
  4. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,770

    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.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  5. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,770

    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.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  6. annihilate

    Apprentice
    Joined: Jul '12
    Posts: 3

    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.

    Posted 10 months ago #
  7. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,770

    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?

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #

RSS feed for this topic

Reply

You must log in to post.