Changeset 13444
- Timestamp:
- Feb 29, 2012, 10:21:46 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/i.php
r13426 r13444 320 320 { 321 321 global $page; 322 323 if (isset($_GET['ajaxload']) and $_GET['ajaxload'] == 'true') 324 { 325 include_once(PHPWG_ROOT_PATH.'include/functions_cookie.inc.php'); 326 include_once(PHPWG_ROOT_PATH.'include/functions_url.inc.php'); 327 328 $response = new json_response(); 329 $response->url = embellish_url(get_absolute_root_url().$page['derivative_path']); 330 echo json_encode($response); 331 return; 332 } 322 333 $fp = fopen($page['derivative_path'], 'rb'); 323 334 … … 344 355 } 345 356 357 class json_response 358 { 359 var $url; 360 } 346 361 347 362 $page=array(); … … 401 416 } 402 417 send_derivative($expires); 418 exit; 403 419 } 404 420 -
trunk/include/derivative.inc.php
r13252 r13444 100 100 101 101 private $params; 102 private $rel_path, $rel_url ;102 private $rel_path, $rel_url, $is_cached; 103 103 104 104 function __construct($type, $src_image) … … 114 114 } 115 115 116 self::build($src_image, $this->params, $this->rel_path, $this->rel_url );116 self::build($src_image, $this->params, $this->rel_path, $this->rel_url, $this->is_cached); 117 117 } 118 118 … … 154 154 } 155 155 156 private static function build($src, &$params, &$rel_path, &$rel_url )156 private static function build($src, &$params, &$rel_path, &$rel_url, &$is_cached=null) 157 157 { 158 158 if ( $src->has_size() && $params->is_identity( $src->get_size() ) ) … … 161 161 $params = null; 162 162 $rel_path = $rel_url = $src->rel_path; 163 $is_cached = true; 163 164 return; 164 165 } … … 192 193 if ($mtime===false or $mtime < $params->last_mod_time) 193 194 { 195 $is_cached = false; 194 196 $url_style = 2; 195 197 } 196 198 else 197 199 { 200 $is_cached = true; 198 201 $url_style = 1; 199 202 } … … 304 307 } 305 308 } 309 310 function is_cached() 311 { 312 return $this->is_cached; 313 } 306 314 } 307 315 -
trunk/themes/default/template/thumbnails.tpl
r12958 r13444 1 1 {if !empty($thumbnails)}{strip} 2 {combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='async'} 3 {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='async'} 2 4 {*define_derivative name='derivative_params' width=160 height=90 crop=true*} 3 5 {html_style} … … 23 25 {/html_style} 24 26 {foreach from=$thumbnails item=thumbnail} 27 {assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)} 25 28 <li> 26 29 <span class="wrap1"> 27 30 <span class="wrap2"> 28 31 <a href="{$thumbnail.URL}"> 29 <img class="thumbnail" src="{$pwg->derivative_url($derivative_params, $thumbnail.src_image)}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">32 <img class="thumbnail" {if !$derivative->is_cached()}data-{/if}src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}"> 30 33 </a> 31 34 </span>
Note: See TracChangeset
for help on using the changeset viewer.