<?php
/**
* TimThumb by Ben Gillbanks and Mark Maunder
* Based on work done 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/
*
* $Rev$
*/
/*
* --- TimThumb CONFIGURATION ---
* To edit the configs it is best to create a file called timthumb-config.php
* and define variables you want to customize in there. It will automatically be
* loaded by timthumb. This will save you having to re-edit these variables
* everytime you download a new version
*/
define ('VERSION', '2.8.13'); // Version of this script
//Load a config file if it exists. Otherwise, use the values below
if( file_exists(dirname(__FILE__) . '/timthumb-config.php')) require_once('timthumb-config.php');
if(! defined('DEBUG_ON') ) define ('DEBUG_ON', false); // Enable debug logging to web server error log (STDERR)
if(! defined('DEBUG_LEVEL') ) define ('DEBUG_LEVEL', 1); // Debug level 1 is less noisy and 3 is the most noisy
if(! defined('MEMORY_LIMIT') ) define ('MEMORY_LIMIT', '30M'); // Set PHP memory limit
if(! defined('BLOCK_EXTERNAL_LEECHERS') ) define ('BLOCK_EXTERNAL_LEECHERS', false); // If the image or webshot is being loaded on an external site, display a red "No Hotlinking" gif.
if(! defined('DISPLAY_ERROR_MESSAGES') ) define ('DISPLAY_ERROR_MESSAGES', true); // Display error messages. Set to false to turn off errors (good for production websites)
//Image fetching and caching
if(! defined('ALLOW_EXTERNAL') ) define ('ALLOW_EXTERNAL', TRUE); // Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false
if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', TRUE); // Less secure.
if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
if(! defined('FILE_CACHE_MAX_FILE_AGE') ) define ('FILE_CACHE_MAX_FILE_AGE', 86400); // How old does a file have to be to be deleted from the cache
if(! defined('FILE_CACHE_SUFFIX') ) define ('FILE_CACHE_SUFFIX', '.timthumb.txt'); // What to put at the end of all files in the cache directory so we can identify them
if(! defined('FILE_CACHE_PREFIX') ) define ('FILE_CACHE_PREFIX', 'timthumb'); // What to put at the beg of all files in the cache directory so we can identify them
if(! defined('FILE_CACHE_DIRECTORY') ) define ('FILE_CACHE_DIRECTORY', './cache'); // Directory where images are cached. Left blank it will use the system temporary directory (which is better for security)
if(! defined('MAX_FILE_SIZE') ) define ('MAX_FILE_SIZE', 10485760); // 10 Megs is 10485760. This is the max internal or external file size that we'll process.
if(! defined('CURL_TIMEOUT') ) define ('CURL_TIMEOUT', 20); // Timeout duration for Curl. This only applies if you have Curl installed and aren't using PHP's default URL fetching mechanism.
if(! defined('WAIT_BETWEEN_FETCH_ERRORS') ) define ('WAIT_BETWEEN_FETCH_ERRORS', 3600); // Time to wait between errors fetching remote file
//Browser caching
if(! defined('BROWSER_CACHE_MAX_AGE') ) define ('BROWSER_CACHE_MAX_AGE', 864000); // Time to cache in the browser
if(! defined('BROWSER_CACHE_DISABLE') ) define ('BROWSER_CACHE_DISABLE', false); // Use for testing if you want to disable all browser caching
//Image size and defaults
if(! defined('MAX_WIDTH') ) define ('MAX_WIDTH', 1500); // Maximum image width
if(! defined('MAX_HEIGHT') ) define ('MAX_HEIGHT', 1500); // Maximum image height
if(! defined('NOT_FOUND_IMAGE') ) define ('NOT_FOUND_IMAGE', ''); // Image to serve if any 404 occurs
if(! defined('ERROR_IMAGE') ) define ('ERROR_IMAGE', ''); // Image to serve if an error occurs instead of showing error message
if(! defined('PNG_IS_TRANSPARENT') ) define ('PNG_IS_TRANSPARENT', FALSE); // Define if a png image should have a transparent background color. Use False value if you want to display a custom coloured canvas_colour
if(! defined('DEFAULT_Q') ) define ('DEFAULT_Q', 90); // Default image quality. Allows overrid in timthumb-config.php
if(! defined('DEFAULT_ZC') ) define ('DEFAULT_ZC', 1); // Default zoom/crop setting. Allows overrid in timthumb-config.php
if(! defined('DEFAULT_F') ) define ('DEFAULT_F', ''); // Default image filters. Allows overrid in timthumb-config.php
if(! defined('DEFAULT_S') ) define ('DEFAULT_S', 0); // Default sharpen value. Allows overrid in timthumb-config.php
if(! defined('DEFAULT_CC') ) define ('DEFAULT_CC', 'ffffff'); // Default canvas colour. Allows overrid in timthumb-config.php
if(! defined('DEFAULT_WIDTH') ) define ('DEFAULT_WIDTH', 100); // Default thumbnail width. Allows overrid in timthumb-config.php
if(! defined('DEFAULT_HEIGHT') ) define ('DEFAULT_HEIGHT', 100); // Default thumbnail height. Allows overrid in timthumb-config.php
/**
* Additional Parameters:
* LOCAL_FILE_BASE_DIRECTORY = Override the DOCUMENT_ROOT. This is best used in timthumb-config.php
*/
//Image compression is enabled if either of these point to valid paths
//These are now disabled by default because the file sizes of PNGs (and GIFs) are much smaller than we used to generate.
//They only work for PNGs. GIFs and JPEGs are not affected.
if(! defined('OPTIPNG_ENABLED') ) define ('OPTIPNG_ENABLED', false);
if(! defined('OPTIPNG_PATH') ) define ('OPTIPNG_PATH', '/usr/bin/optipng'); //This will run first because it gives better compression than pngcrush.
if(! defined('PNGCRUSH_ENABLED') ) define ('PNGCRUSH_ENABLED', false);
if(! defined('PNGCRUSH_PATH') ) define ('PNGCRUSH_PATH', '/usr/bin/pngcrush'); //This will only run if OPTIPNG_PATH is not set or is not valid
/*
-------====Website Screenshots configuration - BETA====-------
If you just want image thumbnails and don't want website screenshots, you can safely leave this as is.
If you would like to get website screenshots set up, you will need root access to your own server.
Enable ALLOW_ALL_EXTERNAL_SITES so you can fetch any external web page. This is more secure now that we're using a non-web folder for cache.
Enable BLOCK_EXTERNAL_LEECHERS so that your site doesn't generate thumbnails for the whole Internet.
Instructions to get website screenshots enabled on Ubuntu Linux:
1. Install Xvfb with the following command: sudo apt-get install subversion libqt4-webkit libqt4-dev g++ xvfb
2. Go to a directory where you can download some code
3. Check-out the latest version of CutyCapt with the following command: svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt
4. Compile CutyCapt by doing: cd cutycapt/CutyCapt
5. qmake
6. make
7. cp CutyCapt /usr/local/bin/
8. Test it by running: xvfb-run --server-args="-screen 0, 1024x768x24" CutyCapt --url="http://markmaunder.com/" --out=test.png
9. If you get a file called test.png with something in it, it probably worked. Now test the script by accessing it as follows:
10. http://yoursite.com/path/to/timthumb.php?src=http://222.178.203.72:19005/whst/63/_lZqjlZtmcdqzbnl//&webshot=1
Notes on performance:
The first time a webshot loads, it will take a few seconds.
From then on it uses the regular timthumb caching mechanism with the configurable options above
and loading will be very fast.
--ADVANCED USERS ONLY--
If you'd like a slight speedup (about 25%) and you know Linux, you can run the following command which will keep Xvfb ru
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
极简响应式免费WordPress博客主题-Repay.zip (172个子文件)
bootstrap.min.css 141KB
style.css 86KB
cs-framework.css 40KB
font-awesome.css 37KB
cs-framework.min.css 33KB
font-awesome.min.css 30KB
font-awesome.min.css 30KB
balloon.min.css 16KB
modified-bootstrap.css 5KB
cs-framework-rtl.css 4KB
cs-framework-rtl.min.css 3KB
cs-framework-light.css 3KB
style.css 244B
fontawesome-webfont.eot 162KB
comload.gif 10KB
favicon.ico 1KB
9.jpg 92KB
0.jpg 59KB
6.jpg 55KB
3.jpg 55KB
1.jpg 51KB
7.jpg 49KB
4.jpg 40KB
5.jpg 36KB
2.jpg 27KB
8.jpg 27KB
visit-ava.jpg 3KB
jquery.min.js 91KB
cs-plugins.js 81KB
bootstrap.min.js 48KB
chosen.jquery.js 44KB
cs-framework.js 42KB
cs-plugins.min.js 40KB
popper.min.js 19KB
jquery.tooltip.js 17KB
jquery.interdependencies.js 17KB
cs-framework.min.js 17KB
general-scripts.js 11KB
app.js 10KB
baguetteBox.min.js 9KB
wow.min.js 8KB
jq-sticky-anything.min.js 7KB
jquery.actual.js 3KB
support.js 3KB
stickthis.js 726B
google-fonts.json 429KB
01-font-awesome.json 12KB
bn_BD.mo 4KB
fa_IR.mo 4KB
ar.mo 3KB
ro_RO.mo 3KB
pt_BR.mo 3KB
zh_CN.mo 3KB
tr_TR.mo 3KB
wp-clean-up-zh_CN.mo 2KB
FontAwesome.otf 132KB
timthumb.php 52KB
basics.php 33KB
ajax.php 17KB
framework.class.php 15KB
wp_clean_up_admin.php 14KB
framework.config.php 13KB
cs-framework-path.php 10KB
options.class.php 10KB
class-sitemap-settings.php 8KB
seo.php 8KB
metabox.class.php 7KB
class-do-sitemap.php 7KB
ajax-comments.php 7KB
meta-form.php 6KB
taxonomy.class.php 6KB
helpers.php 6KB
shortcode.class.php 5KB
header-ad.php 5KB
header-normal.php 5KB
widget-postlist.php 5KB
adminbar_menu.php 5KB
background.php 5KB
com-meta.php 4KB
comments.php 4KB
customize.class.php 4KB
header-centered.php 4KB
typography.php 4KB
cs-framework.php 4KB
group.php 3KB
related.php 3KB
nav_menus.php 3KB
list-1.php 3KB
list-6.php 3KB
sanitize.php 2KB
widget.php 2KB
actions.php 2KB
list-1.php 2KB
register.php 2KB
list-2.php 2KB
list-4.php 2KB
banner.php 2KB
single.php 2KB
list-5.php 2KB
list-3.php 2KB
共 172 条
- 1
- 2
资源评论
小徐博客
- 粉丝: 1977
- 资源: 5883
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (2025)计算机网络技术考试题库(含答案).doc
- (2025)监理工程师《合同管理》考试题库及答案.doc
- (2025)辐射安全与防护培训考试题库及答案.docx
- (2025)高压电工考试题库及答案.docx
- (2025)工业机器人技术题库及答案.docx
- (2025)工作票三种人资格工作许可人考试题库及答案.docx
- (2025)工业机器人系统操作员技术及理论知识竞赛试题库(附含答案).docx
- (2025)公司员工疫情防控知识考试题库及答案.docx
- (2025)公文写作基础知识试题库及答案.docx
- (2025)公文筐考试题库及答案.docx
- (2025)公务员结构化面试万能模板.docx
- (2025)公务员考试常用数学公式总结归纳.docx
- (2025)国家基层糖尿病防治管理指南认证考试试题及答案.docx
- (2025)国学经典知识竞赛题库及答案.docx
- (2025)汉字听写大会竞赛试题库及答案(通用版).docx
- (2025)过程气体事业部产品测试题及答案.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功