⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_popup.php

📁 easy cms for getion you image with high qualite
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php/***********************************************************************  Copyright (C) 2006 Aizu Ikmal Ahmad (aizu@ikmal.com.my)  This file is part of iFoto.  iFoto is free software; you can redistribute it and/or modify it  under the terms of the GNU General Public License as published  by the Free Software Foundation; either version 2 of the License,  or (at your option) any later version.  iFoto is distributed in the hope that it will be useful, but  WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License for more details.  You should have received a copy of the GNU General Public License  along with this program; if not, write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston,  MA  02111-1307  USA************************************************************************/include('config.php');include('includes/functions.php');if(@$_COOKIE['ifotocp'] == md5($admin_username.$admin_password)){	html_interface();}else{	echo 'Please login.';	exit();}function popup_content(){	$id_request = @$_GET['id'];	define('ID_REQUEST', $id_request);	$popup_case = @$_GET['pop'];	switch($popup_case){		case 'dir_masteradd' : 	dir_masteradd(); 	break;		case 'dir_add' : 		dir_add(); 			break;		case 'dir_genthumbs' : 	dir_genthumbs();	break;		case 'dir_upload' : 	dir_upload(); 		break;		case 'dir_rename' : 	dir_rename(); 		break;		case 'dir_delete' : 	dir_delete(); 		break;		case 'file_rename' : 	file_rename(); 		break;		case 'file_desc' : 		file_desc(); 		break;		case 'file_delete' : 	file_del(); 		break;	}}function dir_masteradd(){	if(post_param('submit') && post_param('album_name')){		$dir_to_create = post_param('album_name');		if($dir_to_create == ''){			exit('Please type the gallery name.');		}		if(is_dir('./gallery/'.$dir_to_create)){			exit('Gallery named '.$dir_to_create.' already existed. Click <a href="#" onClick="window.history.go(-1)">here</a> to try again.');		}		if(mkdir('./gallery/'.$dir_to_create)){			echo 'Gallery created!';		}else{			echo 'Cannot create gallery. Please create it using FTP instead.';		}		?>	    <br /><br /><a href="javascript:tutupWindow();">Close</a>	    <script language="JavaScript">	        <!--	        function tutupWindow() {	        opener.location.reload();	        self.close();	        }	        // -->	    </script>		<?	}else{		?>		<h1>Add New Album</h1>		<form action="?pop=dir_masteradd" method="POST">			Album Name<br />			<input type="text" name="album_name" /><br />			<input type="submit" name="submit" value="Submit" /> <input type="button" name="cancel" value="Cancel" onclick="window.close();" />		</form>		<?	}}function dir_add(){	if(post_param('submit') && post_param('album_name') && get_param('id')){		$main_dir		= get_param('id');		$dir_to_create	= post_param('album_name');		if($dir_to_create == ''){			exit('Please type the gallery name.');		}		if(is_dir('./gallery/'.$main_dir.'/'.$dir_to_create)){			exit('Gallery named '.$dir_to_create.' already existed. Click <a href="#" onClick="window.history.go(-1)">here</a> to try again.');		}		if(mkdir('./gallery/'.$main_dir.'/'.$dir_to_create)){			echo 'Sub-gallery created!';		}else{			echo 'Cannot create sub-gallery. Please create it using FTP instead.';		}		?>	    <br /><br /><a href="javascript:tutupWindow();">Close</a>	    <script language="JavaScript">	        <!--	        function tutupWindow() {	        opener.location.reload();	        self.close();	        }	        // -->	    </script>		<?	}else{		?>		<h1>Add New Album</h1>		<form action="?pop=dir_add&id=<?=get_param('id')?>" method="POST">			Album Name<br />			<input type="text" name="album_name" /><br />			<input type="submit" name="submit" value="Submit" /> <input type="button" name="cancel" value="Cancel" onclick="window.close();" />		</form>		<?	}}function dir_genthumbs(){	if(post_param('submit') && get_param('id')){		require('includes/thumbnailer.php');		$dir_id = trim(get_param('id'));		$files = directoryToArray('gallery/'.$dir_id, true);		foreach($files as $file){			if ($file != '.' AND $file != '..' AND (substr(strtolower($file),-3) == 'jpg' || substr(strtolower($file),-3) == 'gif' || substr(strtolower($file),-3) == 'png')) {				$file_split_arr = explode('/', $file);				$total_arr = count($file_split_arr);				if($total_arr == 3){					$current_dir = $file_split_arr[1];					$filename_only = $file_split_arr[2];				}elseif($total_arr == 4){					$current_dir = $file_split_arr[1] . '/' . $file_split_arr[2];					$filename_only = $file_split_arr[3];				}				if(!file_exists('data/thumbdata_'.base64_encode($current_dir.']|['.$filename_only.']|['.filectime($file)).'.jpg') AND (substr(strtolower($file), -3) == 'jpg' || substr(strtolower($file), -3) == 'gif')){					$tis = new ThumbnailImage();					$tis->src_file  = $file;					$tis->dest_type = THUMB_JPEG;					//$tis->dest_file = 'data/thumbdata_'.base64_encode($current_dir.']|['.$file . ']|[' . filemtime('gallery/'.$current_dir.'/'.$file)).'.jpg';					$tis->dest_file = 'data/thumbdata_'.base64_encode($current_dir.']|['.$filename_only . ']|[' . filectime($file)).'.jpg';					$tis->max_width = 120;					$tis->max_height = 4000;					$tis->Output();				}			}		}		?>		Thumbnail generated successful!	    <br /><br /><a href="javascript:tutupWindow();">Close</a>	    <script language="JavaScript">	        <!--	        function tutupWindow() {	        opener.location.reload();	        self.close();	        }	        // -->	    </script>		<?	}else{		?>		<h1>Regenerate Thumbnails</h1>		<form action="?pop=dir_genthumbs&id=<?=get_param('id')?>" method="POST" name="generateThumb">			Thumbnail generation, may took up to 30 seconds to 1 minute. If this window display a blank white page appear after 30 second, please press <b>F5</b> on your keyboard to resume thumbnail generation.<br /><br />			<input type="submit" name="submit" value="Generate Thumbnails" onclick="this.value='Processing...';" />			<input type="button" name="cancel" value="Cancel" onclick="window.close();" />		</form>		<?	}}function dir_upload(){	if(post_param('submit')){		$dir_target = get_param('id');		if(!is_dir('./gallery/'.$dir_target)){			exit('Gallery named '.$dir_target.' didn\'t exist. Click <a href="#" onClick="window.history.go(-1)">here</a> to try again.');		}        $uploaddir  = './gallery/'.$dir_target;        $file_name = $_FILES['file_name']['name'];        $true_name = str_replace(" ","_",$file_name);        $file_name = str_replace("%20","",$true_name);        $uploadfile = $uploaddir . '/' . $file_name;        if (move_uploaded_file($_FILES['file_name']['tmp_name'], $uploadfile)) {	        // chmoded to 777, so that the FTP user can update this file also	        chmod('./gallery/'.$dir_target, 0777);	        require('includes/thumbnailer.php');			if(!file_exists('data/thumbdata_'.base64_encode($dir_target.']|['.$file_name.']|['.filectime('gallery/'.$dir_target.'/'.$file_name)).'.jpg') AND (substr(strtolower($file_name), -3) == 'jpg' || substr(strtolower($file_name), -3) == 'gif')){				$tis = new ThumbnailImage();				$tis->src_file  = 'gallery/'.$dir_target.'/'.$file_name;				$tis->dest_type = THUMB_JPEG;				//$tis->dest_file = 'data/thumbdata_'.base64_encode($current_dir.']|['.$file . ']|[' . filemtime('gallery/'.$current_dir.'/'.$file)).'.jpg';				$tis->dest_file = 'data/thumbdata_'.base64_encode($dir_target.']|['.$file_name . ']|[' . filectime('gallery/'.$dir_target.'/'.$file_name)).'.jpg';				$tis->max_width = 120;				$tis->max_height = 4000;				$tis->Output();			}        	echo 'File uploaded succcesfully. Click <a href="?pop=dir_upload&id='.get_param('id').'">here</a> to upload more file.';        	//print_r($_FILES);        } else {            echo 'Upload Error.';            //print_r($_FILES);        }		?>	    <br /><br /><a href="javascript:tutupWindow();">Close</a>	    <script language="JavaScript">	        <!--	        function tutupWindow() {	        opener.location.reload();	        self.close();	        }	        // -->	    </script>		<?	}else{		?>		<h1>Upload New File</h1>		<form action="?pop=dir_upload&id=<?=get_param('id')?>" method="POST" enctype="multipart/form-data">			<input type="file" name="file_name" /><br />			<input type="submit" name="submit" value="Submit" onclick="this.value='Uploading...';" />			<input type="button" name="cancel" value="Cancel" onclick="window.close();" />		</form>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -