Hi David,
I’m not familiar with this plugin at all nor with that error message but I do know that there was a recent TimThumb security risk so Amazon might be preventing you from doing anything to it.
I’m happy to post the solution!!
WHAT WAS WRONG: the issue is only when using multisite network configuration; this is why thumb.php used by the plugin identify as a ‘local file’ images that can be fetched only using a full URL, due to rewrite rules in multisite.
THE SOLUTION:
(unfortunatly) you need to edit the file plugins\advanced-recent-posts-widget\timthumb\thumb.php
in this way:
– line 34
if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', TRUE);
– comment out line 212:
//$this->src = preg_replace('/https?:\/\/(?:www\.)?' . $this->myHost . '/i', '', $this->src);
…or download modified file from here: http://coste.mypressonline.com/wp/other-wp-plugin-fixed/
NOTE: .zip extension is dummy; rename in thumb.php and copy over existing file in your (..)plugins\advanced-recent-posts-widget\timthumb\ directory
Please let me know if this solve the problem!!
thanks, I’ll give that a go now!
After studing a bit TimThumb web site, I found a better solution:
added a function in advanced-recent-posts-widget.php
if(!function_exists('get_image_path')):
/**
* for TimThumb script working with WordPress Multisite (formerly WordPress mu)
* http://www.binarymoon.co.uk/2009/10/timthumb-wordpress-mu/
*/
function get_image_path ($theImageSrc) {
if (isset($blog_id) && $blog_id > 0) {
$imageParts = explode('/files/', $theImageSrc);
if (isset($imageParts[1])) {
$theImageSrc = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
}
}
return $theImageSrc;
}
and call it adding this line:
$thumbnail[0] = get_image_path($thumbnail[0]);
before using thumbnail[0].
You can download modified plugin from here: http://coste.mypressonline.com/wp/other-wp-plugin-fixed/
I updated the code with this code and tim thumb isn’t working more… but this sorted out my issue
<img src=”<?php echo $thumbnail[0] ?>” alt=”<?php the_title_attribute(); ?>” width=”<?php echo $thumb_w; ?>” height=”<?php echo $thumb_h; ?>” />
You can set the image size in the widget.