Project

General

Profile

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 2070 2014-01-03 01:21:42Z darkviper $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/media/thumbs.php $
14
 * @lastmodified    $Date: 2014-01-03 02:21:42 +0100 (Fri, 03 Jan 2014) $
15
 *
16
 */
17

    
18
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
$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
        $thumb->adaptiveResize(20,20);
47
//        $thumb->resize(30,30);
48
//		$thumb->cropFromCenter(80,50);
49
// 		$thumb->resizePercent(40);
50
	} else {
51
    	$thumb->Resize(300,300);
52
// 		$thumb->resizePercent(25);
53
//		$thumb->cropFromCenter(80,50);
54
	}
55
	$thumb->show();
56

    
57
 }
(13-13/14)