1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category admin
|
5
|
* @package media
|
6
|
* @author Ryan Djurovich (2004-2009), WebsiteBaker Project
|
7
|
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: thumbs.php 1798 2012-10-28 09:43:11Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/media/thumbs.php $
|
14
|
* @lastmodified $Date: 2012-10-28 10:43:11 +0100 (Sun, 28 Oct 2012) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
require('../../config.php');
|
19
|
$modulePath = dirname(__FILE__);
|
20
|
|
21
|
/*
|
22
|
// Get image
|
23
|
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
|
24
|
$image = (isset(${$requestMethod}['img']) ? ${$requestMethod}['img'] : '');
|
25
|
print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong> basename: '.basename(__FILE__).' line: '.__LINE__.' -> <br />';
|
26
|
print_r( $_GET ); print '</pre>'; die(); // flush ();sleep(10);
|
27
|
*/
|
28
|
|
29
|
if (isset($_GET['img']) && isset($_GET['t'])) {
|
30
|
if(!class_exists('PhpThumbFactory', false)){ include($modulePath.'/inc/ThumbLib.inc.php'); }
|
31
|
// require_once($modulePath.'/inc/ThumbLib.inc.php');
|
32
|
$image = addslashes($_GET['img']);
|
33
|
$type = intval($_GET['t']);
|
34
|
// $media = WB_PATH.MEDIA_DIRECTORY.'/';
|
35
|
$thumb = PhpThumbFactory::create(WB_PATH.MEDIA_DIRECTORY.'/'.$image);
|
36
|
|
37
|
if ($type == 1) {
|
38
|
// $thumb->cropFromCenter(80,50);
|
39
|
$thumb->resize(30,30);
|
40
|
// $thumb->resizePercent(40);
|
41
|
} else {
|
42
|
$thumb->resize(250,250);
|
43
|
// $thumb->resizePercent(50);
|
44
|
// $thumb->cropFromCenter(80,50);
|
45
|
}
|
46
|
$thumb->show();
|
47
|
|
48
|
}
|