<?php

/**
 *      [Dzz!] (C)2010-2011 dzz.cc
 *      This is NOT a freeware, use is subject to license terms
 *
 * ============================================================================
 * 版权所有 2010-2011 Dzz!Desktop，并保留所有权利。
 * 网站地址: http://dzz.cc；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式、任何目的的再发布。
 * ============================================================================
 */
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}
$refer=dreferer();
dzz_cpheader();
if(submitcheck('thamesubmit')) {
	if($operation=='dock' || $operation=='window' || $operation=='browser'|| $operation=='filemanage'|| $operation=='topbar'){
		$ids=$_POST['ids'];
		$deletes=$_POST['delete'];
		foreach($ids as $id){
			if(!in_array($id,$deletes)){
				$setarr=array(
						'name'=>getstr($_POST['name'][$id],80,0,0,0,-1),
						'disp'=>intval($_POST['disp'][$id]),
					);
				
				DB::update('dzz_thameitem',$setarr,"id='{$id}'");
			}
		}
		if($deletes) DB::delete('dzz_thameitem',"id IN (".dimplode($deletes).")");
	
	}elseif($operation=='color'){
		$ids=$_POST['ids'];
		$deletes=$_POST['delete'];
		foreach($ids as $id){
			if(!in_array($id,$deletes)){
				$setarr=array(
						'title'=>getstr($_POST['title'][$id],80,0,0,0,-1),
						'disp'=>intval($_POST['disp'][$id]),
					);
				
				DB::update('dzz_wallpaper',daddslashes($setarr),"bid='{$id}'");
			}
		}
		if($deletes) DB::delete('dzz_wallpaper',"bid IN (".dimplode($deletes).")");
	}elseif($operation=='class'){
		$ids=$_POST['ids'];
		$deletes=$_POST['delete'];
		foreach($ids as $id){
			if(!in_array($id,$deletes)){
				$setarr=array(
						'classname'=>getstr($_POST['classname'][$id],80,0,0,0,-1),
						'disp'=>intval($_POST['disp'][$id]),
					);
				
				DB::update('dzz_wallpaper_class',daddslashes($setarr),"classid='{$id}'");
			}
		}
		if($deletes){
			DB::update('dzz_wallpaper',array('classid'=>0),"classid IN (".dimplode($deletes).")");
			DB::delete('dzz_wallpaper_class',"classid IN (".dimplode($deletes).")");
		}
	}elseif($operation=='scale' || $operation=='repeat'){
		$ids=$_POST['ids'];
		$deletes=$_POST['delete'];
		foreach($ids as $id){
			if(!in_array($id,$deletes)){
				$setarr=array(
						'title'=>getstr($_POST['title'][$id],80,0,0,0,-1),
						'disp'=>intval($_POST['disp'][$id]),
						'classid'=>intval($_POST['classid'][$id]),
					);
				
				DB::update('dzz_wallpaper',daddslashes($setarr),"bid='{$id}'");
			}
		}
		if($deletes){
			$query=DB::query("select * from ".DB::table('dzz_wallpaper')." where bid IN (".dimplode($deletes).")");
			while($value=DB::fetch($query)){
				if($value['thumb']) @unlink(DISCUZ_ROOT.$value['val'].'.thumb.jpg');
				@unlink(DISCUZ_ROOT.$value['val']);
			}
			DB::delete('dzz_wallpaper',"bid IN (".dimplode($deletes).")");
		}
	}elseif($operation=='url'){
		$ids=$_POST['ids'];
		$deletes=$_POST['delete'];
		foreach($ids as $id){
			if(!in_array($id,$deletes)){
				$setarr=array(
						'title'=>getstr($_POST['title'][$id],80,0,0,0,-1),
						'disp'=>intval($_POST['disp'][$id]),
						'classid'=>intval($_POST['classid'][$id]),
					);
				
				DB::update('dzz_wallpaper',daddslashes($setarr),"bid='{$id}'");
			}
		}
		if($deletes){
			$query=DB::query("select * from ".DB::table('dzz_wallpaper')." where bid IN (".dimplode($deletes).")");
			while($value=DB::fetch($query)){
				if($value['thumb']) @unlink(DISCUZ_ROOT.$value['img'].'.thumb.jpg');
				@unlink(DISCUZ_ROOT.$value['img']);
			}
			DB::delete('dzz_wallpaper',"bid IN (".dimplode($deletes).")");
		}
	}else{
		$ids=$_POST['ids'];
		$deletes=$_POST['delete'];
		$default=intval($_POST['default']);
		foreach($ids as $id){
			if(!in_array($id,$deletes)){
				$setarr=array(
						'name'=>getstr($_POST['name'][$id],80,0,0,0,-1),
						'disp'=>intval($_POST['disp'][$id]),
					);
				if($default==$id){
					 $setarr['default']=1;
					 DB::query("update ".DB::table('dzz_thame')." set `default`=0 where id!='{$id}'");
				}
				DB::update('dzz_thame',$setarr,"id='{$id}'");
			}
		}
		if($deletes) DB::delete('dzz_thame',"id IN (".dimplode($deletes).")");
	}
	cpmsg($lang['do_success'],$refer,'succeed');
}else{
	if($operation=='dock'){
		if($do=='setup'){
			$folder=trim($_GET['folder']);
			$msg='';
			if(!$folder) cpmsg($lang['parameter_error'],$refer,'error');
			$setarr=array(
							'folder'=>$folder,
							'idtype'=>'dock',
							'name'=>$folder,
							);
				DB::insert('dzz_thameitem',daddslashes($setarr));
				cpmsg($lang['do_success'],$refer,'succeed');
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_dock']);
			$docks=array();
			$folder=array();
			$query=DB::query("select * from ".DB::table('dzz_thameitem')." where idtype='dock' ORDER BY disp");
			while($value=DB::fetch($query)){
				$value['thumb']='dzz/styles/dock/'.$value['folder'].'/thumb.jpg';
				$docks[]=$value;
				$folder[]=$value['folder'];
			}
			//获取目录中的dock；
			$dock=array();
			$dockdir = DISCUZ_ROOT.'./dzz/styles/dock';
			$dirhandle =dir($dockdir);
			while($entry = $dirhandle->read()) {
				if(!in_array($entry, array('.', '..')) && is_dir($dockdir.'/'.$entry)) {
					$dock[]=$entry;
				}
			}
			
			$docks_no=array();
			foreach($dock as $value){
				if(!in_array($value,$folder)){
					$docks_no[]=array('folder'=>$value,'thumb'=>'dzz/styles/dock/'.$value.'/thumb.jpg');
				}
			}
		}
	}elseif($operation=='window'){
		if($do=='setup'){
			$folder=trim($_GET['folder']);
			$msg='';
			if(!$folder) cpmsg($lang['parameter_error'],$refer,'error');
			$setarr=array(
							'folder'=>$folder,
							'idtype'=>'window',
							'name'=>$folder,
							);
				DB::insert('dzz_thameitem',daddslashes($setarr));
				cpmsg($lang['do_success'],$refer,'succeed');
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_window']);
			$windows=array();
			$folder=array();
			$query=DB::query("select * from ".DB::table('dzz_thameitem')." where idtype='window' ORDER BY disp");
			while($value=DB::fetch($query)){
				$value['thumb']='dzz/styles/window/'.$value['folder'].'/thumb.jpg';
				$windows[]=$value;
				$folder[]=$value['folder'];
			}
			//获取目录
			$window=array();
			$windir = DISCUZ_ROOT.'./dzz/styles/window';
			$dirhandle =dir($windir);
			while($entry = $dirhandle->read()) {
				if(!in_array($entry, array('.', '..')) && is_dir($windir.'/'.$entry)) {
					$window[]=$entry;
				}
			}
			$windows_no=array();
			foreach($window as $value){
				if(!in_array($value,$folder)){
					$windows_no[]=array('folder'=>$value,'thumb'=>'dzz/styles/window/'.$value.'/thumb.jpg');
				}
			}
		}
	}elseif($operation=='browser'){
		if($do=='setup'){
			$folder=trim($_GET['folder']);
			$msg='';
			if(!$folder) cpmsg($lang['parameter_error'],$refer,'error');
			$setarr=array(
							'folder'=>$folder,
							'idtype'=>'browser',
							'name'=>$folder,
							);
				DB::insert('dzz_thameitem',daddslashes($setarr));
				cpmsg($lang['do_success'],$refer,'succeed');
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_browser']);
			$browsers=array();
			$folder=array();
			$query=DB::query("select * from ".DB::table('dzz_thameitem')." where idtype='browser' ORDER BY disp");
			while($value=DB::fetch($query)){
				$value['thumb']='dzz/styles/browser/'.$value['folder'].'/thumb.jpg';
				$browsers[]=$value;
				$folder[]=$value['folder'];
			}
			//获取目录
			$browser=array();
			$windir = DISCUZ_ROOT.'./dzz/styles/browser';
			$dirhandle =dir($windir);
			while($entry = $dirhandle->read()) {
				if(!in_array($entry, array('.', '..')) && is_dir($windir.'/'.$entry)) {
					$browser[]=$entry;
				}
			}
			$browsers_no=array();
			foreach($browser as $value){
				if(!in_array($value,$folder)){
					$browsers_no[]=array('folder'=>$value,'thumb'=>'dzz/styles/browser/'.$value.'/thumb.jpg');
				}
			}
		}
	}elseif($operation=='topbar'){
		if($do=='setup'){
			$folder=trim($_GET['folder']);
			$msg='';
			if(!$folder) cpmsg($lang['parameter_error'],$refer,'error');
			$setarr=array(
							'folder'=>$folder,
							'idtype'=>'topbar',
							'name'=>$folder,
							);
				DB::insert('dzz_thameitem',daddslashes($setarr));
				cpmsg($lang['do_success'],$refer,'succeed');
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_topbar']);
			$topbars=array();
			$folder=array();
			$query=DB::query("select * from ".DB::table('dzz_thameitem')." where idtype='topbar' ORDER BY disp");
			while($value=DB::fetch($query)){
				$value['thumb']='dzz/styles/navbar/'.$value['folder'].'/thumb.jpg';
				$topbars[]=$value;
				$folder[]=$value['folder'];
			}
			//获取目录
			$topbar=array();
			$windir = DISCUZ_ROOT.'./dzz/styles/navbar';
			$dirhandle =dir($windir);
			while($entry = $dirhandle->read()) {
				if(!in_array($entry, array('.', '..')) && is_dir($windir.'/'.$entry)) {
					$topbar[]=$entry;
				}
			}
			$topbars_no=array();
			foreach($topbar as $value){
				if(!in_array($value,$folder)){
					$topbars_no[]=array('folder'=>$value,'thumb'=>'dzz/styles/navbar/'.$value.'/thumb.jpg');
				}
			}
		}
	}elseif($operation=='filemanage'){
		if($do=='setup'){
			$folder=trim($_GET['folder']);
			$msg='';
			if(!$folder) cpmsg($lang['parameter_error'],$refer,'error');
			$setarr=array(
							'folder'=>$folder,
							'idtype'=>'filemanage',
							'name'=>$folder,
							);
				DB::insert('dzz_thameitem',daddslashes($setarr));
				cpmsg($lang['do_success'],$refer,'succeed');
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_filemanage']);
			$filemanages=array();
			$folder=array();
			$query=DB::query("select * from ".DB::table('dzz_thameitem')." where idtype='filemanage' ORDER BY disp");
			while($value=DB::fetch($query)){
				$value['thumb']='dzz/styles/filemanage/'.$value['folder'].'/thumb.jpg';
				$filemanages[]=$value;
				$folder[]=$value['folder'];
			}
			//获取目录
			$filemanage=array();
			$windir = DISCUZ_ROOT.'./dzz/styles/filemanage';
			$dirhandle =dir($windir);
			while($entry = $dirhandle->read()) {
				if(!in_array($entry, array('.', '..')) && is_dir($windir.'/'.$entry)) {
					$filemanage[]=$entry;
				}
			}
			$filemanages_no=array();
			foreach($filemanage as $value){
				if(!in_array($value,$folder)){
					$filemanages_no[]=array('folder'=>$value,'thumb'=>'dzz/styles/filemanage/'.$value.'/thumb.jpg');
				}
			}
		}
	}elseif($operation=='color'){
		if($do=='add'){
			$setarr=array(
							'title'=>trim($_POST['title']),
							'val'=>trim($_POST['val']),
							'type'=>'color',
							'classid'=>0,
							'disp'=>0,
							'dateline'=>$_G['timestamp']
						   );
			if(strpos($setarr['val'],'#')!==0){
				cpmsg($lang['clolor_val_error'],$refer,'error');
			}
			if(DB::insert('dzz_wallpaper',daddslashes($setarr))){
				cpmsg($lang['do_success'],$refer,'succeed');
			}
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_colorWallpaper']);
			$page=intval($_GET['page'])<1?1:intval($_GET['page']);
			$list=array();
			$perpage =20;
			$start = ($page-1)*$perpage;
			$count=DB::result_first("SELECT COUNT(*) FROM ".DB::table('dzz_wallpaper')." where type='color'");
			if($count){
				$query=DB::query("SELECT * FROM ".DB::table('dzz_wallpaper')." where type='color' ORDER BY disp DESC LIMIT $start,$perpage" );
				while($value=DB::fetch($query)){
					$value['dateline']=dgmdate($value['dateline']);
					$list[]=$value;
				}
			}
			$multi = multi($count, $perpage, $page, ADMINSCRIPT."?action=$action&operation=$operation");
		}
	}elseif($operation=='scale' ||$operation=='repeat'){
		if($do=='add'){
			$setarr=array(
							'title'=>trim($_POST['title']),
							
							'type'=>$operation,
							'classid'=>intval($_POST['classid']),
							'disp'=>0,
							'dateline'=>$_G['timestamp']
						   );
			$upload=dzz_backimg_save($_FILES['backimg']);
			if($upload && is_array($upload)){
				$setarr['val']=$_G['setting']['attachurl'].$upload['filepath'];
				$setarr['thumb']=$upload['thumb'];
			}else{
				cpmsg($upload,$refer,'error');
			}
			if(DB::insert('dzz_wallpaper',daddslashes($setarr))){
				cpmsg($lang['do_success'],$refer,'succeed');
			}
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_'.$operation.'Wallpaper']);
			$classid=intval($_GET['classid']);
			$class=array();
			
			$query=DB::query("select * from ".DB::table('dzz_wallpaper_class')." where type='{$operation}' order by disp DESC");
			while($value=DB::fetch($query)){
				$class[]=$value;
			}
			$page=intval($_GET['page'])<1?1:intval($_GET['page']);
			$list=array();
			$perpage =20;
			$start = ($page-1)*$perpage;
			$wheresql="type='{$operation}'";
			if($classid) $wheresql.=" and classid='{$classid}'";
			$count=DB::result_first("SELECT COUNT(*) FROM ".DB::table('dzz_wallpaper')." where $wheresql");
			if($count){
				$query=DB::query("SELECT * FROM ".DB::table('dzz_wallpaper')." where $wheresql ORDER BY disp DESC LIMIT $start,$perpage" );
				while($value=DB::fetch($query)){
					$value['dateline']=dgmdate($value['dateline']);
					if($value['thumb']) $value['thumbpic']=$value['val'].'.thumb.jpg';
					else  $value['thumbpic']=$value['val'];
					$list[]=$value;
				}
			}
			$multi = multi($count, $perpage, $page, ADMINSCRIPT."?action=$action&operation=$operation&classid=$classid");
		}
	}elseif($operation=='url'){
		if($do=='add'){
			$setarr=array(
							'title'=>trim($_POST['title']),
							'val'=>trim($_POST['val']),
							'type'=>'url',
							'classid'=>intval($_POST['classid']),
							'disp'=>0,
							'dateline'=>$_G['timestamp']
						   );
			$upload=dzz_backimg_save($_FILES['backimg']);
			if($upload && is_array($upload)){
				$setarr['img']=$_G['setting']['attachurl'].$upload['filepath'];
				$setarr['thumb']=$upload['thumb'];
			}else{
				cpmsg($upload,$refer,'error');
			}
			if(DB::insert('dzz_wallpaper',daddslashes($setarr))){
				cpmsg($lang['do_success'],$refer,'succeed');
			}
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_'.$operation.'Wallpaper']);
			$classid=intval($_GET['classid']);
			$class=array();
			
			$query=DB::query("select * from ".DB::table('dzz_wallpaper_class')." where type='{$operation}' order by disp DESC");
			while($value=DB::fetch($query)){
				$class[]=$value;
			}
			$page=intval($_GET['page'])<1?1:intval($_GET['page']);
			$list=array();
			$perpage =20;
			$start = ($page-1)*$perpage;
			$wheresql="type='url'";
			if($classid) $wheresql.=" and classid='{$classid}'";
			$count=DB::result_first("SELECT COUNT(*) FROM ".DB::table('dzz_wallpaper')." where $wheresql");
			if($count){
				$query=DB::query("SELECT * FROM ".DB::table('dzz_wallpaper')." where $wheresql ORDER BY disp DESC LIMIT $start,$perpage" );
				while($value=DB::fetch($query)){
					$value['dateline']=dgmdate($value['dateline']);
					if($value['thumb']) $value['thumbpic']=$value['img'].'.thumb.jpg';
					else  $value['thumbpic']=$value['img'];
					$list[]=$value;
				}
			}
			$multi = multi($count, $perpage, $page, ADMINSCRIPT."?action=$action&operation=$operation&classid=$classid");
		}
	}elseif($operation=='class'){
		if($do=='add'){
			$setarr=array(
							'classname'=>trim($_POST['classname']),
							'type'=>$_POST['type'],
							'disp'=>0
						   );
			
			if(DB::insert('dzz_wallpaper_class',daddslashes($setarr))){
				cpmsg($lang['do_success'],$refer,'succeed');
			}
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_Wallpaper_class']);
			$class=array();
			$type=trim($_GET['type']);
			$query=DB::query("select * from ".DB::table('dzz_wallpaper_class')." where type='{$type}' order by disp DESC");
			while($value=DB::fetch($query)){
				$class[]=$value;
			}
		}
	}else{
		if($do=='setup'){
			$folder=trim($_GET['folder']);
			$msg='';
			if(!$folder) cpmsg($lang['parameter_error'],$refer,'error');
			$link='dzz/styles/thame/'.$folder.'/config.txt';
				$text=file_get_contents($link);
				$setarr=array();
				if(preg_match("/\[name\](.*?)\[\/name\]/i",$text,$name1)){
					$setarr['name']=trim($name1[1]);
				}
				if(preg_match("/\[btype\](.*?)\[\/btype\]/i",$text,$btype1)){
					$setarr['btype']=trim($btype1[1]);
				}
				if(preg_match("/\[url\](.*?)\[\/url\]/i",$text,$url1)){
					$setarr['url']=trim($url1[1]);
				}
				if(preg_match("/\[dock\](.*?)\[\/dock\]/i",$text,$dock1)){
					$setarr['dock']=trim($dock1[1]);
				}
				if(preg_match("/\[window\](.*?)\[\/window\]/i",$text,$window1)){
					$setarr['window']=trim($window1[1]);
				}
				if(preg_match("/\[topbar\](.*?)\[\/topbar\]/i",$text,$topbar1)){
					$setarr['topbar']=trim($topbar1[1]);
				}
				if(preg_match("/\[filemanage\](.*?)\[\/filemanage\]/i",$text,$filemanage1)){
					$setarr['filemanage']=trim($filemanage1[1]);
				}
				if(preg_match("/\[browser\](.*?)\[\/browser\]/i",$text,$browser1)){
					$setarr['browser']=trim($browser1[1]);
				}
				if(preg_match("/\[folder\](.*?)\[\/folder\]/i",$text,$folder1)){
					$setarr['folder']=trim($folder1[1]);
				}
				if(preg_match("/\[background-color\](.*?)\[\/background-color\]/i",$text,$backimg1)){
					$setarr['backimg']=trim($backimg1[1]);
				}
				if(!$setarr['folder'] || !$setarr['name'] || (!$setarr['url'] && $setarr['btype']==0)){
					cpmsg($lang['config_text_fomat_error'],$refer,'error');
				}
				DB::insert('dzz_thame',daddslashes($setarr),0,1);
				cpmsg($lang['do_success'],$refer,'succeed');
		}else{
			dzz_shownav($lang['menu_theme'],$lang['menu_theme_config']);
			$thames=array();
			$folder=array();
			$query=DB::query("SELECT * FROM ".DB::table('dzz_thame')."  where 1 ORDER BY disp" );
			while($value=DB::fetch($query)){
				if(!$value['thumb']) $value['thumb']='dzz/styles/thame/'.$value[folder]."/thumb.jpg";
				$thames[]=$value;
				$folder[]=$value['folder'];
			}
			//获取目录；
			$thame=array();
			$thamedir = DISCUZ_ROOT.'./dzz/styles/thame';
			$dirhandle =dir($thamedir);
			while($entry = $dirhandle->read()) {
				if(!in_array($entry, array('.', '..')) && is_dir($thamedir.'/'.$entry)) {
					$thame[]=$entry;
				}
			}
			$thame_no=array();
			foreach($thame as $value){
				if(!in_array($value,$folder)){
					$thame_no[]=$value;
				}
			}
			$thames_no=array();
			foreach($thame_no as $folder){
				$link='dzz/styles/thame/'.$folder.'/config.txt';
				$text=file_get_contents($link);
				$setarr=array();
				if(preg_match("/\[name\](.*?)\[\/name\]/i",$text,$name1)){
					$setarr['name']=trim($name1[1]);
				}
				if(preg_match("/\[btype\](.*?)\[\/btype\]/i",$text,$btype1)){
					$setarr['btype']=trim($btype1[1]);
				}
				if(preg_match("/\[url\](.*?)\[\/url\]/i",$text,$url1)){
					$setarr['url']=trim($url1[1]);
				}
				if(preg_match("/\[dock\](.*?)\[\/dock\]/i",$text,$dock1)){
					$setarr['dock']=trim($dock1[1]);
				}
				if(preg_match("/\[window\](.*?)\[\/window\]/i",$text,$window1)){
					$setarr['window']=trim($window1[1]);
				}
				if(preg_match("/\[browser\](.*?)\[\/browser\]/i",$text,$browser1)){
					$setarr['browser']=trim($browser1[1]);
				}
				if(preg_match("/\[topbar\](.*?)\[\/topbar\]/i",$text,$topbar1)){
					$setarr['topbar']=trim($topbar1[1]);
				}
				if(preg_match("/\[filemanage\](.*?)\[\/filemanage\]/i",$text,$filemanage1)){
					$setarr['filemanage']=trim($filemanage1[1]);
				}
				if(preg_match("/\[folder\](.*?)\[\/folder\]/i",$text,$folder1)){
					$setarr['folder']=trim($folder1[1]);
				}
				if(!$setarr['folder'] || !$setarr['name'] || (!$setarr['url'] && $setarr['btype']==0)){
					cpmsg($lang['config_text_fomat_error'],$refer,'error');
				}else{
					$setarr['thumb']='dzz/styles/thame/'.$setarr['folder']."/thumb.jpg";
					$thames_no[]=$setarr;
				}
			}
		}
	}
	
	
}
function dzz_backimg_save($FILE,$dir='appimg') {
		global $_G;
		$allowpictype = array('jpg','jpeg','gif','png');
	
		require_once dzz_libfile('class/upload');
		$upload = new discuz_upload();
		$upload->init($FILE, $dir);
	
		if($upload->error()) {
			return lang('spacecp', 'lack_of_access_to_upload_file_size');
		}
	
		if(!$upload->attach['isimage']) {
			return lang('spacecp', 'only_allows_upload_file_types');
		}
		$upload->save();
		if($upload->error()) {
			return lang('spacecp', 'mobile_picture_temporary_failure');
		}
		$setarr = array(
			'filepath' => $dir.'/'.$upload->attach['attachment'],
			'thumb' => 0,
		);
		//生成缩略图
		require_once libfile('class/image');
		$image = new image;
		if($thumb = $image->Thumb($_G['setting']['attachurl'].$setarr['filepath'],'',101, 101,1)){
			$setarr['thumb']=$thumb;
		}
		return $setarr;
	}
include dzztemplate('admin/dzz_thame');

?>