mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
- thumbnail support is fully functional with custom imageThumb class which supports caching and so on, the class is still considered beta (specially the clean_cache() function)
- updated simple template - added Last Access (atime) to dirlist.lib.php - updated and fixed loads of other things git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@18 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
26
thumb.php
Normal file
26
thumb.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require_once('libs/imagethumb.lib.php');
|
||||
|
||||
$src = ( !empty($_GET['src']) ) ? $_GET['src'] : false ;
|
||||
$w = ( !empty($_GET['w']) && preg_match("/[0-9]{1,4}/", $_GET['w']) ) ? $_GET['w'] : null ;
|
||||
$h = ( !empty($_GET['h']) && preg_match("/[0-9]{1,4}/", $_GET['w']) ) ? $_GET['h'] : null ;
|
||||
$q = ( !empty($_GET['q']) ) ? $_GET['q'] : false ;
|
||||
|
||||
//TODO load sizes from config instead of from $_GET vars for security reasons...
|
||||
|
||||
if ( preg_match("/^\//", $src) ) {
|
||||
if ( function_exists('apache_lookup_uri') ) {
|
||||
$file = apache_lookup_uri($src);
|
||||
$file = ( is_array($file) ) ? $file['filename'] : $file->filename ;
|
||||
} else {
|
||||
$file = $_SERVER['DOCUMENT_ROOT'].$src;
|
||||
}
|
||||
} else $file = $src;
|
||||
|
||||
$image = new imageThumb();
|
||||
$image->cache_dir = 'cache/thumbnails/';
|
||||
$image->quick($file, $w, $h, $q);
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user