Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         admintools
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: thumb.php 1400 2011-01-21 19:42:51Z FrankH $
14
 * @filesource		$HeadURL:  $
15
 * @lastmodified    $Date:  $
16
 *
17
 */
18

    
19
require('../../config.php');
20
include_once('resize_img.php');
21
require_once(WB_PATH.'/framework/functions.php');
22

    
23
if (isset($_GET['img']) && isset($_GET['t'])) {
24
	$image = addslashes($_GET['img']);
25

    
26
	// Check to see if it contains ..
27
	if (!check_media_path($image)) {
28
		$admin->print_error($MESSAGE['MEDIA']['DIR_DOT_DOT_SLASH'], WB_URL, false);
29
	}
30

    
31
	$type = addslashes($_GET['t']);
32
	$media = WB_PATH.MEDIA_DIRECTORY;
33
	$img=new RESIZEIMAGE($media.$image);
34
	if ($img->imgWidth) {
35
		if ($type == 1) {
36
			$img->resize_limitwh(50,50);
37
		} else if ($type == 2) {
38
			$img->resize_limitwh(200,200);
39
		} 
40
		$img->close();
41
	} else {
42
		header ("Content-type: image/jpeg");
43
		readfile ( "nopreview.jpg" );
44
	}
45
}
46
?>
(15-15/16)