I was happy to see the update announced and installed right away because the plugin stopped working after update to Zenphoto 1.2.6. Now I have installed version 1.6 of the plugin, WordPress 2.8.4 and Zenphoto 1.2.6 and it still doesn't work. :-(
I already updated the plugin settings, but I still get an empty dropdown menu with no listed albums and the widget doesn't work either. Debug mode does show the messages already stated here but does not really help. My WP plugins folder is not password protected. I double checked the path to the zp-data folder and it is the right one. Please give me a hint what information I should provide to track down this error.
Ok, here we go:
`
ZenphotoPress Messages
INFO
PHP Version: 5.2.0-8+etch15
INFO
Current working directory: /var/www/www.lespocky.de/blog/_wordpress_XXXX/wp-content/plugins/zenphotopress/tinymce
INFO
POST:
INFO
GET: Array ( [tinyMCE] => 0 )
INFO
ZenphotoProxy method: cURL
INFO
ZenphotoProxy call: http://www.lespocky.de/blog/_wordpress_XXXX/wp-content/plugins/zenphotopress/zenphoto_bridge.php?function=get_nested_albums&data_path=/var/www/www.lespocky.de/fotos/zp-data
`
The address of the blog is www.lespocky.de/blog and the address of the fotos is www.lespocky.de/fotos. As you can see above both applications are installed in different subfolders but on the same domain. As you can see WordPress is installed in a subfolder as suggested here. (I changed the real foldernames above to [i]XXXX[/i].)
I get:
Quote:[b]Fatal error:[/b] Call to undefined function mysql_set_charset() in [b]/var/www/www.lespocky.de/blog/_wordpress_XXXX/wp-content/plugins/zenphotopress/zenphoto_bridge.php[/b] on line [b]436[/b]
According to PHP Manual the function [i]mysql_set_charset[/i] was introduced in PHP 5.2.3 but we still use the patched 5.2.0 from Debian Etch. A [i]grep[/i] in the blog sources showed WordPress itself does a test on this function in [i]wp-includes/wp-db.php[/i] line 360 (WordPress 2.8.4) so perhaps you can do something similar in the plugin?
Thanks for the help micheall and thanks for the update Simbul.
Can someone help me with another issue? I'm trying to use lightbox with zenphotopress. When I click on the picture for zp it gives me this code.
a href="http://www.phoubar.com/zp/random/RockClimbing38.jpg">
Quote:@LeSpocky: nice debugging. It should be fixed in the development version, give it a run.
I had to search a little for the development version but finally found it on the plugin page on wordpress.org by clicking other versions. I installed this version and the plugin works again as it should. New photos are displayed in the widget and I can use the editor component as before with Zenphoto 1.2.5 and Zenphotopress 1.5.x.
Thank you very much for the quick bugfix. :-)
Hey Simbul,
As others have said, thank you for the plugin!
I have encountered a small error though: the default link to image option enters a URL to the image page, not the image itself. Meaning, it will put the following link:
http://photography.outonabender.com//nature/looking-up/IMG_1973-Large.jpg
instead of
http://photography.outonabender.com/albums/nature/looking-up/IMG_1973-Large.jpg
going to the first URL results in .php being added to the end and the image page loading.
it looks like zenphotopress is trying to put 'albums' between .com and nature, but then it doesn't? after inserting the thumbnails, I change the link to include 'albums' and everything works fine. Without doing this, I get the a lightbox square with a spinning icon - probably because it loaded the image page instead of the image itself.
I'm using the latest ZP, ZPP and WP - just upgraded them all last night. If you can give me a hand (is it a ZP setting?) I'd appreciate it. Not that it's a huge issue - like I said, changing the link to work isn't difficult, it's just an extra step.
Thanks!
Looks like things are working fine zetetic, I assume you have the lightbox 2 plugin for wordpress running? Cause what you assumed is correct. Lightbox is just trying to load the image.php page. You could set it for a custom link via the zenphotopress.
In the long run I ended up just skinning my zen & wordpress to a similar theme and turned off lightbox.
Actually, it's meant to be a link to the page (not the image itself): it is a plugin to integrate with Zenphoto, after all
Anyway, support for Lightbox and the likes has been in my todo list for a reeeeally long time. I hope to bring it to the "completed features" soon
I've been trying to get this plugin working on my local Windows box and running into problems. WP 2.8.4, ZP 1.2.6, ZPP 1.6.
First problem was that no albums were appearing in the dropdown. I found that the ZenphotoPressAlbum.to_hash method in zenphoto_bridge.php was referencing $this->parentid when I think it should have been using $this->p_id? Anyway, changing this made the error go away.
Next problem I haven't been able to resolve. Its occurring during retrieval of images. The URL is:
And the error that gets returned is:
Notice: Undefined index: parentid in C:\programs\wamp\www\wordpress\wp-content\plugins\zenphotopress\zenphoto_bridge.php on line 305
Line numbers may not match up with the released version cause I've been messing with the file a bit, but it's the line in album_protected_recursive that reads:
if ($query['parentid']) { return album_protected_recursive($query['parentid']);
Any help much appreciated, thanks!
Not sure myself.. it worked just fine on my install... though if you've changed the first parentid to p_id, you'd have to change the second though as the error you're getting is saying that parentid isn't defined. The bigger question you should be looking at is why you had to change the parentid to p_id. Did you make other coding changes requiring it?
Nope didn't make any other coding changes requiring it. FYI here's the unmodified code straight from the ZPP zip I downloaded:
`
class ZenphotoPressAlbum {
var $id;
var $name;
var $children;
var $p_id;
/**
* Class constructor. Create a new album from a has of values.
* @param $hash Hash of values
*/
function ZenphotoPressAlbum($hash) {
$this->id = $hash['value'];
$this->name = $hash['name'];
$this->p_id = $hash['parentid'];
$this->children = $hash['children'];
}
/**
* Add an album as a child to this album.
* @param $child A ZenphotoPressAlbum instance
*/
function add_child($child) {
$this->children[$child->id] = $child;
}
/**
* Return a hash representation for this album.
* This method is the dual of the class constructor.
* @return A hash representing the album
*/
function to_hash() {
$out = array();
$out['value'] = $this->id;
$out['name'] = $this->name;
$out['parentid'] = $this->parentid;
$out['children'] = NULL;
if ($this->children != NULL) {
foreach($this->children as $id => $child) {
$out['children'][$id] = $child->to_hash();
}
}
return $out;
}
}
`
Note the declaration of the variable as p_id at the top and the use of "$this->parentid" at the bottom in to_hash (this was the line that was causing me problems).
I can't understand why nobody else is getting this problem though. Maybe I'm using a bogus download.
Hmm, just downloaded ZPP again from the wordpress plugin site - the code I posted above is definitely what's on there. I'm not a PHP coder, so I can't really say for certain, but that code sure looks suspicious to me. Is there a dev version I can download from somewhere?
Update: This problem (using parentid instead of p_id) is fixed in the development version. Maybe nobody else is seeing it because they're not using nested albums? Anyway FWIW version 1.6 appears to be broken for certain use cases (nested albums?).
I'm still left with the problem retrieving images however, as I described above.
Maybe I'll try without nested albums and see if that's any better.
Update2: Still no good without nested albums.
Sorry for the forum spam. I found the problem - there's a bug(?) in the ZPP code in album_protected_recursive (zenphoto_bridge.php). The code reads like this at present:
`
$sql = "SELECT id, parentid
FROM db_albums_table AS a
WHERE a.password='' AND a.show=1 AND a.id=$albumid";
$query = $zp_db->queryArray($sql);
if (count($query) == 0) {
return true;
} else {
if ($query['parentid']) {
return album_protected_recursive($query['parentid']);
}
}
`
Trouble is the query (in my environment at least) returns an array of arrays ([[id,parentid]]), so when you try to dereference the results it with just $query['parentid'] it returns an error. I change this to $query[0]['parentid'] and it worked.
I had a cursory glance at the code and it seems you are right. It appears that, when I tested the latest version, I was actually never executing the else clause.
Thanks for finding the bug.
By the way, how is your gallery structured (albums/subalbums)? It seems I never took it into the due consideration.