1 (edited by JustinCase5454 2015-02-23 07:51:53)

Topic: Config xml not found in latest version of wordpress plugin

When you combine the latest juicebox plugin - version 1.4.3.0 - with the latest nextgen gallery - version 2.0.74 - the juicebox plugin cannot find the xml config file. However if I revert back to version 1.2.0 of the juicebox plugin (with the same nextgen version) everything works fine. Why is this?

When I step through the code I get an error in the config.php file on this line:
$image_url = $Juicebox->encode_url($base_url . $image_basename);
The error say "encode_url" function does not exist. The $Juicebox variable is set to global scope so either 1) config.php is not seeing this instance of Juicebox class or more likely 2) the encode_url function does not exist in that class. I think #2 is correct because I cannot find that function in that class.

I have not tried the newest Juicebox wordpress plugin by itself, so it might work like that, nor have I tried it with any other gallery type like picasa. Given the popluarlity of nextgen I hope this is fixed soon so I can use the latest Juicebox.

Re: Config xml not found in latest version of wordpress plugin

Thank you for reporting this problem.
A quick fix would be to open WP-Juicebox's 'config.php' file in a plain text editor and change lines 77 - 78 from:

$image_url = $Juicebox->encode_url($base_url . $image_basename);
$thumb_url = $Juicebox->encode_url($base_url . 'thumbs/thumbs_' . $image_basename);

... to:

$image_url = $base_url . $image_basename;
$thumb_url = $base_url . 'thumbs/thumbs_' . $image_basename;

As long as your image filenames contain only web-safe (alpha-numeric) characters and not reserved characters, then everything should work OK.

However, I will investigate this problem further and will post back with my findings.

Re: Config xml not found in latest version of wordpress plugin

The 'encode_url' function is, indeed, missing from the 'wp-juicebox.php' file. It will be reinstated in the next version.
In the meantime, my workaround above should work fine.
I cannot actually find an instance where the current version of NextGEN Gallery (v2.0.74) produces a URL which needs to be encoded. I'm pretty sure the 'encode_url' function is required only for backwards compatibility with older versions of NextGEN Gallery.