llocally / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Work with subdomain #253

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
 Hi,
please modify timthumb so it can work with subdomain when use anti-leecher 
feature. For example:
 + I use mydomain.com as my main website.
 + and subdomain1.mydomain.com/subdomain2.mydomain.com as thumb storage.

Currenty timthumb display a 'No hotlinking' image if use thumb from subdomain 
on main website.

Original issue reported on code.google.com by trad...@gmail.com on 3 Sep 2011 at 10:32

GoogleCodeExporter commented 9 years ago
I have the same issue :(

Original comment by abhishek...@gmail.com on 11 Nov 2011 at 3:16

GoogleCodeExporter commented 9 years ago
I think the best solution would be to set up the hotlinking similar to the 
external image fetchers. In other words, have an $ALLOWED_HOTLINKING_SITES 
array(); in addition to the $ALLOWED_SITES = array ();

Example:
//Image Hotlinking
define ( 'ALLOW_EXTERNAL_HOTLINKING', TRUE ); // Allow image hotlinking from 
external websites. Will check against ALLOWED_HOTLINKING_SITES if 
ALLOW_ALL_EXTERNAL_LINKING is FALSE
define ( 'ALLOW_ALL_EXTERNAL_HOTLINKING', FALSE ); // If the image or webshot 
is being loaded on an external site, display a red "No Hotlinking" gif.

//Image fetching and caching
define ( 'ALLOW_EXTERNAL', TRUE ); // Allow image fetching from external 
websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is FALSE
define ( 'ALLOW_ALL_EXTERNAL_SITES', FALSE ); // Less secure. 

// If ALLOW_EXTERNAL_HOTLINKING is TRUE and ALLOW_ALL_EXTERNAL_HOTLINKING is 
FALSE, then external images will only be fetched from these domains and their 
subdomains. 
$ALLOWED_HOTLINKING_SITES = array (
    'anothersite.com',
    'mybestfriendssite.com'
);

// If ALLOW_EXTERNAL is TRUE and ALLOW_ALL_EXTERNAL_SITES is FALSE, then 
external images will only be fetched from these domains and their subdomains. 
$ALLOWED_SITES = array (
    'flickr.com',
    'staticflickr.com',
    'picasa.com',
    'img.youtube.com',
    'blogger.com',
    'vimeo.com',
    'b.vimeocdn.com'
);

Original comment by bu...@butchewing.com on 16 Dec 2011 at 5:19

GoogleCodeExporter commented 9 years ago
This is especially pertinent when you try to use timthumb with a translation 
plugin with a "one domain per language" option. It is getting common on 
Wordpress these days ...
It's sad this good idea received no attention ...   :o(   ...   ;o)

Original comment by saboural...@gmail.com on 11 Apr 2014 at 1:03