| 1 |
1797
|
Luisehahne
|
<?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$
|
| 13 |
|
|
* @filesource $HeadURL$
|
| 14 |
|
|
* @lastmodified $Date$
|
| 15 |
|
|
*
|
| 16 |
|
|
*/
|
| 17 |
|
|
|
| 18 |
1819
|
Luisehahne
|
if(!defined('WB_URL'))
|
| 19 |
|
|
{
|
| 20 |
|
|
$config_file = realpath('../../config.php');
|
| 21 |
|
|
if(file_exists($config_file) && !defined('WB_URL'))
|
| 22 |
|
|
{
|
| 23 |
|
|
require($config_file);
|
| 24 |
|
|
}
|
| 25 |
|
|
}
|
| 26 |
|
|
//if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
|
| 27 |
1797
|
Luisehahne
|
$modulePath = dirname(__FILE__);
|
| 28 |
|
|
|
| 29 |
|
|
/*
|
| 30 |
|
|
// Get image
|
| 31 |
|
|
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
|
| 32 |
|
|
$image = (isset(${$requestMethod}['img']) ? ${$requestMethod}['img'] : '');
|
| 33 |
|
|
print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong> basename: '.basename(__FILE__).' line: '.__LINE__.' -> <br />';
|
| 34 |
|
|
print_r( $_GET ); print '</pre>'; die(); // flush ();sleep(10);
|
| 35 |
|
|
*/
|
| 36 |
|
|
|
| 37 |
|
|
if (isset($_GET['img']) && isset($_GET['t'])) {
|
| 38 |
|
|
if(!class_exists('PhpThumbFactory', false)){ include($modulePath.'/inc/ThumbLib.inc.php'); }
|
| 39 |
|
|
// require_once($modulePath.'/inc/ThumbLib.inc.php');
|
| 40 |
|
|
$image = addslashes($_GET['img']);
|
| 41 |
|
|
$type = intval($_GET['t']);
|
| 42 |
|
|
// $media = WB_PATH.MEDIA_DIRECTORY.'/';
|
| 43 |
|
|
$thumb = PhpThumbFactory::create(WB_PATH.MEDIA_DIRECTORY.'/'.$image);
|
| 44 |
|
|
|
| 45 |
|
|
if ($type == 1) {
|
| 46 |
1819
|
Luisehahne
|
$thumb->adaptiveResize(20,20);
|
| 47 |
|
|
// $thumb->resize(30,30);
|
| 48 |
1797
|
Luisehahne
|
// $thumb->cropFromCenter(80,50);
|
| 49 |
|
|
// $thumb->resizePercent(40);
|
| 50 |
|
|
} else {
|
| 51 |
1819
|
Luisehahne
|
// $thumb->adaptiveResize(250,250);
|
| 52 |
|
|
$thumb->resizePercent(30);
|
| 53 |
1797
|
Luisehahne
|
// $thumb->cropFromCenter(80,50);
|
| 54 |
|
|
}
|
| 55 |
|
|
$thumb->show();
|
| 56 |
|
|
|
| 57 |
|
|
}
|