Blame view

js/_tiny_mce/plugins/ajaxfilemanager/ajax_image_preview.php 718 Bytes
42868d70   andryeyev   Создал GIT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  <?php
  	/**
  	 * ajax preview
  	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
  	 * @link www.phpletter.com
  	 * @since 22/April/2007
  	 *
  	 */
  	include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
  	if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
  	{
  		include_once(CLASS_IMAGE);
  		$image = new Image();
  		if($image->loadImage($_GET['path']))
  		{
  			if($image->resize(CONFIG_IMG_PREVIEW_MAX_X, CONFIG_IMG_PREVIEW_MAX_Y, true))
  			{
  				$image->showImage();
  			}else 
  			{
  				echo PREVIEW_NOT_PREVIEW . ".";	
  			}
  		}else 
  		{
  			echo PREVIEW_NOT_PREVIEW . "..";			
  		}
  
  			
  	}else 
  	{
  		echo PREVIEW_NOT_PREVIEW . "...";
  	}