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 1826 2012-11-20 22:05:34Z Luisehahne $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/media/thumbs.php $
14
 * @lastmodified    $Date: 2012-11-20 23:05:34 +0100 (Tue, 20 Nov 2012) $
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)