當前位置: 首頁>>代碼示例>>PHP>>正文


PHP timthumb::start方法代碼示例

本文整理匯總了PHP中timthumb::start方法的典型用法代碼示例。如果您正苦於以下問題:PHP timthumb::start方法的具體用法?PHP timthumb::start怎麽用?PHP timthumb::start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在timthumb的用法示例。


在下文中一共展示了timthumb::start方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: images

 function images()
 {
     ini_set('memory_limit', '128M');
     require 'include/cypher.class.php';
     require 'include/timthumb/timthumb.class.php';
     $ecode_str = base64_decode(str_replace(preg_split('~~u', '-_,', null, PREG_SPLIT_NO_EMPTY), preg_split('~~u', '+/=', null, PREG_SPLIT_NO_EMPTY), $this->args[0]));
     $cypher = new Cypher();
     $cypher->key = Core::inst()->img_password;
     $images_param['src'] = '../view/upload/images/' . $cypher->decrypt(mb_substr($ecode_str, mb_strlen(Core::inst()->img_prefix, 'UTF-8') - mb_strlen($ecode_str, 'UTF-8')));
     $this('db')->query('SELECT * FROM `di.album_gallery`, `di.album_photo` WHERE `di.album_gallery`.`album_gallery_id` = `di.album_photo`.`album_photo_gallery_id` AND `di.album_photo`.`album_photo_name` = ? AND `di.album_gallery`.`album_gallery_visible` = 1;', $cypher->decrypt(mb_substr($ecode_str, mb_strlen(Core::inst()->img_prefix, 'UTF-8') - mb_strlen($ecode_str, 'UTF-8'))));
     if ($this('db')->affected_rows() == 0) {
         exit(0);
     }
     if (isset($this->args[1]) && $this->args[1] != 0) {
         $images_param['w'] = $this->args[1];
     }
     if (isset($this->args[2]) && $this->args[2] != 0) {
         $images_param['h'] = $this->args[2];
     }
     $images_param['q'] = 100;
     timthumb::start($images_param);
 }
開發者ID:gorodok11,項目名稱:di_gallery,代碼行數:22,代碼來源:viewController.php

示例2: define

if (!defined('WEBSHOT_PROXY')) {
    define('WEBSHOT_PROXY', '');
}
//In case you're behind a proxy server.
if (!defined('WEBSHOT_XVFB_RUNNING')) {
    define('WEBSHOT_XVFB_RUNNING', false);
}
//ADVANCED: Enable this if you've got Xvfb running in the background.
// 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.
if (!isset($ALLOWED_SITES)) {
    $ALLOWED_SITES = array('flickr.com', 'staticflickr.com', 'picasa.com', 'img.youtube.com', 'upload.wikimedia.org', 'photobucket.com', 'imgur.com', 'imageshack.us', 'tinypic.com');
}
// -------------------------------------------------------------
// -------------- STOP EDITING CONFIGURATION HERE --------------
// -------------------------------------------------------------
timthumb::start();
class timthumb
{
    protected $src = "";
    protected $is404 = false;
    protected $docRoot = "";
    protected $lastURLError = false;
    protected $localImage = "";
    protected $localImageMTime = 0;
    protected $url = false;
    protected $myHost = "";
    protected $isURL = false;
    protected $cachefile = '';
    protected $errors = array();
    protected $toDeletes = array();
    protected $cacheDirectory = '';
開發者ID:sdgdsffdsfff,項目名稱:shipin,代碼行數:31,代碼來源:timthumb.php

示例3: renderImage

 /**
  *
  * Render resized image
  * @param string $image
  * @param int $width
  * @param int $height
  * @return string image
  */
 function renderImage($image, $width = 0, $height = 0)
 {
     if ($image) {
         if ($this->params->get('thumbnailmode', 1)) {
             $timthumb_params = array();
             if (preg_match('/^https?:\\/\\/[^\\/]+/i', $image)) {
                 $timthumb_params['src'] = $image;
             } else {
                 $timthumb_params['src'] = JURI::Base() . $image;
             }
             $timthumb_params['w'] = $width;
             $timthumb_params['h'] = $height;
             $timthumb_params['q'] = $this->params->get('imagequality', '90');
             $timthumb_params['a'] = $this->params->get('alignment', 'c');
             $timthumb_params['zc'] = $this->params->get('zoomcrop', '1');
             if ($this->params->get('customfilters', '') != '') {
                 $timthumb_params['f'] = $this->params->get('customfilters', '');
             } else {
                 $filters = $this->params->get('filters');
                 if (!empty($filters)) {
                     $filters = implode("|", $filters);
                     $timthumb_params['f'] = $filters;
                 }
             }
             $timthumb_params['s'] = $this->params->get('sharpen', '0');
             $timthumb_params['cc'] = $this->params->get('canvascolour', 'FFFFFF');
             $timthumb_params['ct'] = $this->params->get('canvastransparency', '1');
             $tb_image = timthumb::start($timthumb_params);
             // If can resize image -> return resized image, else keep original image
             if (trim($tb_image) != '') {
                 $image = $tb_image;
             }
             return $image;
         } else {
             return $image;
         }
     } else {
         return '';
     }
 }
開發者ID:vstorm83,項目名稱:propertease,代碼行數:48,代碼來源:helper.php


注:本文中的timthumb::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。