这是我的网站,timthumb无法正常工作:“http://vitinh.cz/?page_id=8” 我尝试了很多解决方案,但没有......我还在你的网站上使用了你的提示(http://andrewroycarter.com/wordpress-2/using-timthumb-on-wordpress-multi-user/)。 但无论如何我无法让它发挥作用:(。你能帮我解决一下吗?谢谢。 我等着你的回答。
(Wordpress版本3.0.1)
答案 0 :(得分:3)
问题是您正在尝试使用timthumb.php来调整服务器上不存在的图像。
调整大小的图像的实际错误是:
远程主机“ongmat.cz”不允许 TimThumb版本:1.14
解决方案是编辑timthumb.php脚本并对第24行(或接近它)进行更改
// external domains that are allowed to be displayed on your website
$allowedSites = array (
'flickr.com',
'picasa.com',
'blogger.com',
'wordpress.com',
'img.youtube.com',
);
并添加要使用图像的域,例如将ongmat.cz添加到数组中,使其如下所示:
$allowedSites = array (
'flickr.com',
'picasa.com',
'blogger.com',
'wordpress.com',
'img.youtube.com',
'ongmat.cz',
);
或者您可以更改此选项(虽然不安全)
define ('ALLOW_EXTERNAL', FALSE); // allow external website (override security precaution)
并将FALSE更改为TRUE
前30行应如下所示:
/**
* TimThumb script created by Ben Gillbanks, originally created by Tim McDaniels and Darren Hoyt
* http://code.google.com/p/timthumb/
*
* GNU General Public License, version 2
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Examples and documentation available on the project homepage
* http://www.binarymoon.co.uk/projects/timthumb/
*/
define ('CACHE_SIZE', 250); // number of files to store before clearing cache
define ('CACHE_CLEAR', 5); // maximum number of files to delete on each cache clear
define ('CACHE_USE', FALSE); // use the cache files? (mostly for testing)
define ('VERSION', '1.16'); // version number (to force a cache refresh)
define ('DIRECTORY_CACHE', './cache'); // cache directory
define ('DIRECTORY_TEMP', './temp'); // temp directory
define ('MAX_WIDTH', 1000); // maximum image width
define ('MAX_HEIGHT', 1000); // maximum image height
define ('ALLOW_EXTERNAL', TRUE); // allow external website (override security precaution)
// external domains that are allowed to be displayed on your website
$allowedSites = array (
'flickr.com',
'picasa.com',
'blogger.com',
'wordpress.com',
'img.youtube.com',
'ongmat.cz',
);