Advanced Recent Posts Widget
Tim Thumb and AWS S3 (6 posts)

  1. David Henry
    Posted 3 years ago #

    HI Guys,

    A great plugin that I use lots but in this case I need it to pull the thumbs from Amazon, this is causing a problem. The error is...

    You may not fetch images from that site. To enable this site in timthumb, you can either add it to $ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.

    But where would I set $ALLOWED_SITES, I'm no programmer so am baffled.

    Any help greatly appriciated.



  2. Patrick Rauland
    Posted 3 years ago #

    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.

  3. faina09
    Posted 3 years ago #

    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.

    (unfortunatly) you need to edit the file plugins\advanced-recent-posts-widget\timthumb\thumb.php
    in this way:
    - line 34
    - 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!!

  4. David Henry
    Posted 3 years ago #

    thanks, I'll give that a go now!

  5. faina09
    Posted 3 years ago #

    After studing a bit TimThumb web site, I found a better solution:
    added a function in advanced-recent-posts-widget.php

     * 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/

  6. cybentizen
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Recent Posts Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic