Closed GoogleCodeExporter closed 9 years ago
After reviewing the code and the site, I doubt this is a valid bug. It appears
that several themes that have ended up on our wordpress installation have
botched patching the function in question in several different ways. The only
halfway decent solution I can think of would be defining some variable to
override the document root path or appending some prefix to the LocalImagePath
returned by the function in question. Ill keep digging around and see if I
cant get a patch together to help stop the insanity.
Original comment by a...@1stleg.com
on 11 Sep 2013 at 10:32
Ok this is even easier than I thought... Please document
LOCAL_FILE_BASE_DIRECTORY at the top with the rest of the configuration options
;)
Original comment by a...@1stleg.com
on 11 Sep 2013 at 10:45
[deleted comment]
Here is a very small file that should be used to configure this script to work
with wordpress instead of patching. This should work for most installs, just
place the timthumb-config.php file in the same location as the timthumb.php
file.
[root@titan avenue]# cat timthumb-config.php
<?php
if ( !defined('ABSPATH') ) {
/** Set up WordPress environment */
require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');
}
define ('LOCAL_FILE_BASE_DIRECTORY', realpath(ABSPATH .
get_option('upload_path') . '/..'));
define ('FILE_CACHE_DIRECTORY', LOCAL_FILE_BASE_DIRECTORY . '/cache');
Original comment by a...@1stleg.com
on 11 Sep 2013 at 11:27
Hi - TimThumb is not part of WordPress. It does not know WordPress exists and
does not use any of WordPresses functions. As such it can not make use of
WordPress functionality. If you want to add features to timthumb-config you can
(that's why it's there) but this is not something that will be added to the
TimThumb core.
That said I shall add a note to the top of timthumb about
LOCAL_FILE_BASE_DIRECTORY :)
Original comment by BinaryMoon
on 27 Sep 2013 at 8:57
Original issue reported on code.google.com by
a...@1stleg.com
on 10 Sep 2013 at 6:46