当前位置: 首页>>代码示例>>PHP>>正文


PHP phpthumb_functions::filedate_remote方法代码示例

本文整理汇总了PHP中phpthumb_functions::filedate_remote方法的典型用法代码示例。如果您正苦于以下问题:PHP phpthumb_functions::filedate_remote方法的具体用法?PHP phpthumb_functions::filedate_remote怎么用?PHP phpthumb_functions::filedate_remote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpthumb_functions的用法示例。


在下文中一共展示了phpthumb_functions::filedate_remote方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: SetCacheFilename

 function SetCacheFilename()
 {
     if (!is_null($this->cache_filename)) {
         $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
         return true;
     }
     $this->setOutputFormat();
     $this->setCacheDirectory();
     if (!$this->config_cache_directory) {
         $this->DebugMessage('SetCacheFilename() failed because $this->config_cache_directory is empty', __FILE__, __LINE__);
         return false;
     }
     if (!$this->sourceFilename && !$this->rawImageData && $this->src) {
         $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src);
     }
     if ($this->config_cache_default_only_suffix && $this->sourceFilename) {
         // simplified cache filenames:
         // only use default parameters in phpThumb.config.php
         // substitute source filename into * in $this->config_cache_default_only_suffix
         // (eg: '*_thumb' becomes 'picture_thumb.jpg')
         if (strpos($this->config_cache_default_only_suffix, '*') === false) {
             $this->DebugMessage('aborting simplified caching filename because no * in "' . $this->config_cache_default_only_suffix . '"', __FILE__, __LINE__);
         } else {
             preg_match('/(.+)(\\.[a-z0-9]+)?$/iU', basename($this->sourceFilename), $matches);
             $this->cache_filename = $this->config_cache_directory . $this->osslash . str_replace('*', $matches[1], $this->config_cache_default_only_suffix) . '.' . strtolower($this->thumbnailFormat);
             return true;
         }
     }
     $this->cache_filename = $this->config_cache_directory . $this->osslash . 'phpThumb_cache_' . @$_SERVER['SERVER_NAME'];
     if ($this->new) {
         $this->cache_filename .= '_new' . strtolower(md5($this->new));
     } elseif ($this->md5s) {
         // source image MD5 hash provided
         $this->cache_filename .= '_raw' . $this->md5s;
     } elseif (!$this->src && $this->rawImageData) {
         $this->cache_filename .= '_raw' . strtolower(md5($this->rawImageData));
     } else {
         $this->cache_filename .= '_src' . strtolower(md5($this->sourceFilename));
     }
     if (@$_SERVER['HTTP_REFERER'] && $this->config_cache_differentiate_offsite) {
         $parsed_url1 = @parse_url(@$_SERVER['HTTP_REFERER']);
         $parsed_url2 = @parse_url('http://' . @$_SERVER['HTTP_HOST']);
         if (@$parsed_url1['host'] && @$parsed_url2['host'] && $parsed_url1['host'] != $parsed_url2['host']) {
             // include refering domain only if it doesn't match the domain of the current server
             //$this->cache_filename .= '_ref'.strtolower(md5(@$parsed_url2['host']));
             $this->cache_filename .= '_offsite';
         }
     }
     $ParametersString = '';
     if ($this->fltr && is_array($this->fltr)) {
         $ParametersString .= '_fltr' . implode('_fltr', $this->fltr);
     }
     $FilenameParameters1 = array('ar', 'bg', 'bc', 'far');
     foreach ($FilenameParameters1 as $key) {
         if ($this->{$key}) {
             $ParametersString .= '_' . $key . $this->{$key};
         }
     }
     $FilenameParameters2 = array('h', 'w', 'wl', 'wp', 'ws', 'hp', 'hs', 'sx', 'sy', 'sw', 'sh', 'xto', 'ra', 'iar', 'aoe', 'maxb');
     foreach ($FilenameParameters2 as $key) {
         if ($this->{$key}) {
             $ParametersString .= '_' . $key . intval($this->{$key});
         }
     }
     if ($this->thumbnailFormat == 'jpeg') {
         // only JPEG output has variable quality option
         $ParametersString .= '_q' . intval($this->thumbnailQuality);
     }
     $this->DebugMessage('SetCacheFilename() _par set from md5(' . $ParametersString . ')', __FILE__, __LINE__);
     $this->cache_filename .= '_par' . strtolower(md5($ParametersString));
     if ($this->md5s) {
         // source image MD5 hash provided
         // do not source image modification date --
         // cached image will be used even if file was modified or removed
     } elseif (!$this->config_cache_source_filemtime_ignore_remote && eregi('^(f|ht)tps?://', $this->src)) {
         $this->cache_filename .= '_dat' . intval(phpthumb_functions::filedate_remote($this->src));
     } elseif (!$this->config_cache_source_filemtime_ignore_local && $this->src && !$this->rawImageData) {
         $this->cache_filename .= '_dat' . intval(@filemtime($this->sourceFilename));
     }
     $this->cache_filename .= '.' . strtolower($this->thumbnailFormat);
     return true;
 }
开发者ID:alanhaggai,项目名称:plogger,代码行数:82,代码来源:phpthumb.class.php

示例2: SetCacheFilename

 function SetCacheFilename()
 {
     if (!is_null($this->cache_filename)) {
         $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
         return true;
     }
     $this->setOutputFormat();
     $this->setCacheDirectory();
     if (!$this->config_cache_directory) {
         $this->DebugMessage('SetCacheFilename() failed because $this->config_cache_directory is empty', __FILE__, __LINE__);
         return false;
     }
     if (!$this->sourceFilename && !$this->rawImageData && $this->src) {
         $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src);
     }
     if ($this->config_cache_default_only_suffix && $this->sourceFilename) {
         // simplified cache filenames:
         // only use default parameters in phpThumb.config.php
         // substitute source filename into * in $this->config_cache_default_only_suffix
         // (eg: '*_thumb' becomes 'picture_thumb.jpg')
         if (strpos($this->config_cache_default_only_suffix, '*') === false) {
             $this->DebugMessage('aborting simplified caching filename because no * in "' . $this->config_cache_default_only_suffix . '"', __FILE__, __LINE__);
         } else {
             preg_match('#(.+)(\\.[a-z0-9]+)?$#i', basename($this->sourceFilename), $matches);
             $this->cache_filename = $this->config_cache_directory . DIRECTORY_SEPARATOR . rawurlencode(str_replace('*', @$matches[1], $this->config_cache_default_only_suffix)) . '.' . strtolower($this->thumbnailFormat);
             return true;
         }
     }
     $this->cache_filename = '';
     $broad_directory_name = '';
     if ($this->new) {
         $broad_directory_name = strtolower(md5($this->new));
         $this->cache_filename .= '_new' . $broad_directory_name;
     } elseif ($this->md5s) {
         // source image MD5 hash provided
         $this->DebugMessage('SetCacheFilename() _raw set from $this->md5s = "' . $this->md5s . '"', __FILE__, __LINE__);
         $broad_directory_name = $this->md5s;
         $this->cache_filename .= '_raw' . $this->md5s;
     } elseif (!$this->src && $this->rawImageData) {
         $this->DebugMessage('SetCacheFilename() _raw set from md5($this->rawImageData) = "' . md5($this->rawImageData) . '"', __FILE__, __LINE__);
         $broad_directory_name = strtolower(md5($this->rawImageData));
         $this->cache_filename .= '_raw' . $broad_directory_name;
     } else {
         $this->DebugMessage('SetCacheFilename() _src set from md5($this->sourceFilename) "' . $this->sourceFilename . '" = "' . md5($this->sourceFilename) . '"', __FILE__, __LINE__);
         $broad_directory_name = strtolower(md5($this->sourceFilename));
         $this->cache_filename .= '_src' . $broad_directory_name;
     }
     if (@$_SERVER['HTTP_REFERER'] && $this->config_nooffsitelink_enabled) {
         $parsed_url1 = @phpthumb_functions::ParseURLbetter(@$_SERVER['HTTP_REFERER']);
         $parsed_url2 = @phpthumb_functions::ParseURLbetter('http://' . @$_SERVER['HTTP_HOST']);
         if (@$parsed_url1['host'] && @$parsed_url2['host'] && $parsed_url1['host'] != $parsed_url2['host']) {
             // include "_offsite" only if nooffsitelink_enabled and if referrer doesn't match the domain of the current server
             $this->cache_filename .= '_offsite';
         }
     }
     $ParametersString = '';
     if ($this->fltr && is_array($this->fltr)) {
         $ParametersString .= '_fltr' . implode('_fltr', $this->fltr);
     }
     $FilenameParameters1 = array('ar', 'bg', 'bc', 'far', 'sx', 'sy', 'sw', 'sh', 'zc');
     foreach ($FilenameParameters1 as $key) {
         if ($this->{$key}) {
             $ParametersString .= '_' . $key . $this->{$key};
         }
     }
     $FilenameParameters2 = array('h', 'w', 'wl', 'wp', 'ws', 'hp', 'hs', 'xto', 'ra', 'iar', 'aoe', 'maxb', 'sfn', 'dpi');
     foreach ($FilenameParameters2 as $key) {
         if ($this->{$key}) {
             $ParametersString .= '_' . $key . intval($this->{$key});
         }
     }
     if ($this->thumbnailFormat == 'jpeg') {
         // only JPEG output has variable quality option
         $ParametersString .= '_q' . intval($this->thumbnailQuality);
     }
     $this->DebugMessage('SetCacheFilename() _par set from md5(' . $ParametersString . ')', __FILE__, __LINE__);
     $this->cache_filename .= '_par' . strtolower(md5($ParametersString));
     if ($this->md5s) {
         // source image MD5 hash provided
         // do not source image modification date --
         // cached image will be used even if file was modified or removed
     } elseif (!$this->config_cache_source_filemtime_ignore_remote && preg_match('#^(f|ht)tps?\\://#i', $this->src)) {
         $this->cache_filename .= '_dat' . intval(phpthumb_functions::filedate_remote($this->src));
     } elseif (!$this->config_cache_source_filemtime_ignore_local && $this->src && !$this->rawImageData) {
         $this->cache_filename .= '_dat' . intval(@filemtime($this->sourceFilename));
     }
     $this->cache_filename .= '.' . strtolower($this->thumbnailFormat);
     $broad_directories = '';
     for ($i = 0; $i < $this->config_cache_directory_depth; $i++) {
         $broad_directories .= DIRECTORY_SEPARATOR . substr($broad_directory_name, 0, $i + 1);
     }
     $this->cache_filename = $this->config_cache_directory . $broad_directories . DIRECTORY_SEPARATOR . $this->config_cache_prefix . rawurlencode($this->cache_filename);
     return true;
 }
开发者ID:notzen,项目名称:exponent-cms,代码行数:94,代码来源:phpthumb.class.php

示例3: SetCacheFilename

 function SetCacheFilename()
 {
     if (!is_null($this->cache_filename)) {
         // $this->cache_filename already set, no need to re-set it
         return true;
     }
     $this->setOutputFormat();
     $this->setCacheDirectory();
     if (empty($this->config_cache_directory)) {
         $this->DebugMessage('SetCacheFilename() failed because $this->config_cache_directory is empty', __FILE__, __LINE__);
         return false;
     }
     if (empty($this->sourceFilename) && empty($this->rawImageData) && !empty($this->src)) {
         $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src);
     }
     $this->cache_filename = $this->config_cache_directory . '/phpThumb_cache';
     if ($this->new) {
         $this->cache_filename .= '_new' . $this->new;
     } elseif (!$this->src && $this->rawImageData) {
         $this->cache_filename .= '_' . strtolower(md5($this->rawImageData));
     } else {
         $this->cache_filename .= '_' . urlencode($this->src);
     }
     if (!empty($_SERVER['HTTP_REFERER'])) {
         $parsed_url1 = @parse_url(@$_SERVER['HTTP_REFERER']);
         $parsed_url2 = @parse_url('http://' . @$_SERVER['HTTP_HOST']);
         if (@$parsed_url1['host'] && @$parsed_url2['host'] && $parsed_url1['host'] != $parsed_url2['host']) {
             // include refering domain only if it doesn't match the domain of the current server
             $this->cache_filename .= '_httpreferer' . urlencode(@$parsed_url2['host']);
         }
     }
     if (!empty($_REQUEST['fltr']) && is_array($_REQUEST['fltr'])) {
         $this->cache_filename .= '_fltr' . urlencode(str_replace('|', '¦', implode('_fltr', $_REQUEST['fltr'])));
     }
     $FilenameParameters = array('h', 'w', 'sx', 'sy', 'sw', 'sh', 'far', 'bg', 'bgt', 'bc', 'xto', 'ra', 'ar', 'iar', 'maxb');
     foreach ($FilenameParameters as $key) {
         if (isset($this->{$key})) {
             if ($this->{$key} === true) {
                 $this->cache_filename .= '_' . $key . '1';
             } else {
                 $this->cache_filename .= '_' . $key . $this->{$key};
             }
         }
     }
     if (eregi('^(f|ht)tp[s]?://', $this->src)) {
         $this->cache_filename .= '_' . intval(phpthumb_functions::filedate_remote($this->src));
     } elseif ($this->src && !$this->rawImageData) {
         $this->cache_filename .= '_' . intval(@filemtime($this->sourceFilename));
     }
     $this->cache_filename .= '_q' . $this->thumbnailQuality;
     $this->cache_filename .= '_' . $this->thumbnailFormat;
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:53,代码来源:phpthumb.class.php


注:本文中的phpthumb_functions::filedate_remote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。