Try this :
1/ Replace the line begining with define('SITE_URL', ...
By
define('SITE_URL', get_settings('siteurl'));
2/ For the two lines begining with $new_src = "/wp-content/plugins ...
Add the site url this way :
$new_src = get_settings('siteurl')."/wp-content/plugins ...
Worked for me 😉
bbertrand,
Thank you for your reply. My wordpress is in a /wp directory.
But, get_settings(‘siteurl’) did not work for me with the $new_src
variables because of the ‘http:’ that it starts with.
Instead, I modified phpThumb.config.php. I changed these lines:
require_once(“../../../../wp-config.php”);
$PHPTHUMB_CONFIG[‘document_root’] = ABSPATH;
$PHPTHUMB_CONFIG[‘cache_directory’] = $PHPTHUMB_CONFIG[‘document_root’] . “wp-content/cache/com_resize”;
to this:
require_once(“../../../../../wp/wp-config.php”);
$PHPTHUMB_CONFIG[‘document_root’] = @$_SERVER[“DOCUMENT_ROOT”];
$PHPTHUMB_CONFIG[‘cache_directory’] = $PHPTHUMB_CONFIG[‘document_root’] . “/wp/wp-content/cache/com_resize”;
Robert DeBenedictis, PRX.org
Thanks debenedictis. I’ll try to fix it tonight so it works in both cases: in documentroot and in a subdirectory. Expect a 0.1.4 release this evening.
I did two updates. One for fixing some caching issues with a brand new installation.
The second update (0.1.5) would fix the mentioned problem here.
I think the real problems was when you have installed wordpress in a subdirectorie AND use an img src in the form of: /wordpress/images/test.jpg. images/test.jpg would have worked in that case.
Hi Leon,
For me 0.1.5 wasn’t working when WP was in /wp and img src was like:
http://example.org/shows/photo.jpg
That would generate a new link like this:
http://example.org/wp-content/plugins/com-resize/phpthumb/phpThumb.php?src=http%3A%2F%2F example.org%2Fshows%2Fphoto.jpg&w=80
But, my wp-content is in http://example.org/wp/wp-content.
To fix this I added these lines after you assign new_src when remote:
$url_parts = parse_url(get_bloginfo('wpurl'));
$new_src = trim($url_parts['path'],"/") . "/" . $new_src;
But, that’s just a work-around. I don’t think it’s the best fix.
Robert