WordPress.org

Ready to get started?Download WordPress

Forums

Make Zenphotopress work with Zenphoto beta 1.4.2+ (9 posts)

  1. ZEPsikopat
    Member
    Posted 2 years ago #

    The most recent version of zenphoto does not use the zp-config.php configuration file, and its content is not plain-execurable php either.

    If you face this issue, you must edit /plugins/zenphotopress/zenphoto_bridge.php and replace the require_once line (around line 74) with

    global $_zp_conf_vars;
    		if (!file_exists($zp_data_path.'/zenphoto.cfg')) {
    			ZenphotoBridge::error('Cannot read Zenphoto configuration file');
    			return;
    		}
    		eval(file_get_contents($zp_data_path.'/zenphoto.cfg'));
    		$conf = $_zp_conf_vars;
  2. ZEPsikopat
    Member
    Posted 2 years ago #

    I'm replying to myself, but this previous change was expecting the zenphoto installation to always be of the new type. If you plan a deployment on a mixed environment, replace the line 73 require_once() with

    // Fallback for old configuration file
    if (file_exists($zp_data_path.'/zp-config.php'))
    	require_once($zp_data_path.'/zp-config.php');
    // Load new version of the configuration file
    else if (file_exists($zp_data_path.'/zenphoto.cfg'))
    	eval(file_get_contents($zp_data_path.'/zenphoto.cfg'));
    else {
    	ZenphotoBridge::error('Cannot read Zenphoto configuration file');
    	return;
    }
  3. Simbul
    Member
    Posted 2 years ago #

    Thanks for the contribution, it has been included in ZenphotoPress 1.7.5 :)

  4. tibonihoo
    Member
    Posted 2 years ago #

    Hi after upgrading to both zenphoto v1.4.2 and the new version of the plugin ZenphotoPress 1.7.5, it seems the plugin cannot fnid the images anymore.

    Symptoms are as follow:

    - I had a zenphotopress widget on my sidebar (that has been working ok for a few years) but it does not show any image (the widget's enclosing html tags are still here, but images "listed" in it)

    - when I try to include images from my zenphoto gallery in a wordpress article, the zenphotopress dialog finds the good list of albums, but, whichever album is selected, no images are shown in the selection area.

    I tried to investigate a little by activating the INFO mode (in classes.php as explained in another post) but the info displayed seems ok: good urls for requests, good guess for mod_rewrite and that's about it...

    I guess the plugin is able to connect to zenphoto's db since it gets the right list of album, but maybe the SQL request to get images has changed on zenphoto's side ?

    I don't remember changing any option before the problem came up, but just in case is there an option in zenphoto that would be incompatible with zenphotopress ?

    Btw: thanks for this plugin, maybe not the best time to say it, but it has been really helpful and a nice addition to my blog so far :)

    Note: I also tried to install zenphotopressv1.7.4 and edit it with the above hack to get the cfg file instead of the php one, but the symptoms where the same.

  5. ZEPsikopat
    Member
    Posted 2 years ago #

    I tried on my setup and I was able to display the images on the wordpress page...

    Some investigation tracks :
    - is the "Zenphoto gallery URL" field correct ? the Zenphotopress plugin does not read the image through the filesystem, but includes a link to the zenphoto domain directly.
    - have you set up some specific thumbnail options ? As the function list of thumbnail resizing has evolved since 1.4.2, it may cause some trouble now (haven't checked as i'm not resizing them)
    - if you're not on the same domain, I think you need to deactivate the "prevent hotlinking" option. (and configure it more specifically in your zenphoto .htaccess to allow only linking from your wordpress domain for example)

    Can you confirm the zenphotopress plugin is including a source image url looking like <your zenphoto domain>/zp-core/i.php?a=<album path>&i=<img name>&s=thumb ?

  6. tibonihoo
    Member
    Posted 2 years ago #

    Some of your questions relate to things I already tested, but that's a good occasion to check it again :)

    About my setup: wordpress and zenphoto are on the same domain:
    http://www.tibonihoo.net/blog/ (this is wp)
    http://www.tibonihoo.net/photos (this is zenphoto)

    - The Zenphoto gallery URL is set to: http://www.tibonihoo.net/photos

    It's always been configured like that I think and seems ok to me anyway.

    - yes I ask for thumbnailing but I've just tried the 3 options: Default/Full size/Custom with no specific effect :(

    - hotlinking: I've unchecked the related option in zenphoto, but I've still to check if there' something to chantge in the .htaccess

    Also I'm not sure about your last question (are you asking about the php sources of the plugin or the requests it does ?). Looking at the zenphoto_bridge code, I had the impression that images were retrieved via a SQL query, probably a misunderstanding on my behalf (?)

    In any case when I activate "all" logging, I see the following GET request where, I think, the problem starts:

    http:// [my site url] /blog/wp-content/plugins/zenphotopress/zenphoto_bridge.php?albumid=52&function=count_images&data_path=/correct/path/to/photos/zp-data

    (/correct/path/to/photos/zp-data replaces here the "real" path in the URL, but I've checked that this was the good one)

    The result of this GET request is:

    i:0;

    and its the same for all album ids.

    The weird thing is that info is correctly retrieved for other stuff of the album for instance this other GET request I've found in the logs:

    http:// [my site url] /blog/wp-content/plugins/zenphotopress/zenphoto_bridge.php?albumid=52&function=get_album&data_path=/correct/path/to/photos/zp-data

    returns:

    a:3:{s:4:"name";s:10:"catacombes";s:3:"url";s:10:"catacombes";s:8:"parentid";N;}

  7. Simbul
    Member
    Posted 2 years ago #

    I just visited your gallery, but I can't view any image inside the albums.

    Check whether both albums and images are marked as "published" in the admin interface.
    I suspect something changed in the Zenphoto publishing policy with version 1.4.2, so that images are not published by default anymore.

  8. tibonihoo
    Member
    Posted 2 years ago #

    Oh... That was it !

    For the record this is related to a bug in zenphoto 1.4.2:

    http://www.zenphoto.org/news/publish-content-utility

    http://www.zenphoto.org/support/topic.php?id=10304

    Thanks for checking the album and sorry for the wrong report. Next time I'll first log out my zenphoto site before checking if my images are displayed correctly.

    And thanks again for the great plugin.

  9. Simbul
    Member
    Posted 2 years ago #

    No worries. That puzzled me as well for a bit while I was working on 1.7.5 ;)

Topic Closed

This topic has been closed to new replies.

About this Topic