刷新页面,或稍后再试!谢谢!!';exit; } require($cfg['path']['lib'] . 'smarty/libs/Smarty.class.php'); /* * 模版引擎 */ $tpl = new Smarty(); $tpl->template_dir = $cfg['path']['template']; $tpl->compile_dir = $cfg['path']['root'] . 'tmp/template_c/'; $tpl->compile_check = $cfg['debug']; $tpl->debugging = false; $tpl->caching = 0; $tpl->cache_lifetime = 6000; $tpl->left_delimiter = ''; $tpl->force_compile = true; /* * 引用赋值 */ $tpl->assign_by_ref('cfg',$cfg); require($cfg['path']['lib'] . 'classes/Html.class.php'); function time2Units ($time) { $year = floor($time / 60 / 60 / 24 / 365); $time -= $year * 60 * 60 * 24 * 365; $month = floor($time / 60 / 60 / 24 / 30); $time -= $month * 60 * 60 * 24 * 30; $week = floor($time / 60 / 60 / 24 / 7); $time -= $week * 60 * 60 * 24 * 7; $day = floor($time / 60 / 60 / 24); $time -= $day * 60 * 60 * 24; $hour = floor($time / 60 / 60); $time -= $hour * 60 * 60; $minute = floor($time / 60); $time -= $minute * 60; $second = $time; $elapse = ''; $unitArr = array('年' =>'year', '个月'=>'month', '周'=>'week', '天'=>'day', '小时'=>'hour', '分钟'=>'minute', '秒'=>'second' ); foreach ( $unitArr as $cn => $u ) { if ( $$u > 0 ) { $elapse = $$u . $cn; break; } } return $elapse; } /** * 页面信息类 */ class Page extends Html { public $tpl; public $cache; function __construct() { $GLOBALS['cfg']['page'] = array(); } public function __set($key, $value) { $GLOBALS['cfg']['page'][$key] = $value; } public function __get($key) { return $GLOBALS['cfg']['page'][$key]; } /** * 添加一个JS文件包含 * @param string $file 文件名 * @access public * @return void */ public function addJs($file,$btm=NULL) { if (strpos($file,'/')==false) { $file = $GLOBALS['cfg']['path']['js'] . $file; } if ($btm==NULL) { $GLOBALS['cfg']['page']['jsfiles'][$file] = $file; } else { $GLOBALS['cfg']['page']['jsbtmfiles'][$file] = $file; } } /** * 取生成的包含JS HTML * @access public * @return string */ public function getJsHtml($btm=NULL) { $html = ''; if (!$GLOBALS['cfg']['page']['jsfiles']) { return; } $jsFile = $btm?'jsbtmfiles':'jsfiles'; if ($GLOBALS['cfg']['page'][$jsFile]) { foreach ($GLOBALS['cfg']['page'][$jsFile] as $value) { $html .= $this->jsInclude($value,true)."\n"; } return $html; } else { return ; } } /** * 添加一个CSS文件包含 * @param string $file 文件名 * @access public * @return void */ public function addCss($file) { if (strpos($file,'/')==false) { $file = $GLOBALS['cfg']['path']['css'] . $file; } $GLOBALS['cfg']['page']['cssfiles'][$file] = $file; } /** * 取生成的包含CSS HTML * @access public * @return string */ public function getCssHtml() { if (!$GLOBALS['cfg']['page']['cssfiles']) { return; } $html = ''; foreach ($GLOBALS['cfg']['page']['cssfiles'] as $value) { $html .= $this->cssInclude($value,true); } return $html; } /** * 显示输出页面 * @access public * @return string */ public function show() { $path = ''; if ($this->dir) { $path = $this->dir . '/'; } $path .= $this->name . '.tpl'; $this->tpl->assign('jsFiles',$this->getJsHtml()); $this->tpl->assign('jsFiles1',$this->getJsHtml(1)); $this->tpl->assign('cssFiles',$this->getCssHtml()); $this->tpl->display($path); } /** * 转到URL,并提示信息 * @param string $url URL * @param string $msg 提示信息 * @access public * @return void */ public function goto($url, $msg=NULL) { if ($msg) { $this->jsAlert($msg); } $this->js('document.location="' . $url . '";'); $this->output(true); exit; } /** * replace方式转到URL,并提示信息 * @param string $url URL * @param string $msg 提示信息 * @access public * @return void */ public function replace($url, $msg=NULL) { if ($msg) { $this->jsAlert($msg); } $this->js('location.replace("' . $url . '");'); $this->output(true); exit; } /** * 返回,并提示信息 * @param string $msg 提示信息 * @access public * @return void */ public function back($msg){ $this->jsAlert($msg); $this->js('history.back();'); $this->output(true); exit; } /** * 开始页面缓存 * @param string $file 文件名 * @param string $time 有效时间 * @param string $output 是否输出 * @access public * @return void */ public function cache($file, $time, $output) { global $cfg; require_once($cfg['path']['lib'] . 'classes/PageCache.class.php'); $this->cache = new PageCache($file, $time); $this->cache->get($output); } /** * 保存页面缓存 * @access public * @return void */ public function save() { $path = ''; if ($this->dir) { $path = $this->dir . '/'; } $path .= $this->name . '.tpl'; $this->tpl->assign('jsFiles',$this->getJsHtml()); $this->tpl->assign('cssFiles',$this->getCssHtml()); $content = $this->tpl->fetch($path); if ($this->cache) { $this->cache->set($content); } } } /** * 自动载入apps,classes * * @param string $name * @return bool */ function __autoload($name) { global $cfg; if (!file_exists($cfg['path']['apps'] . $name . '.class.php')) { if (file_exists($cfg['path']['lib'] .'classes/' . $name . '.class.php')) { require_once($cfg['path']['lib'] .'classes/' . $name . '.class.php'); return true; } else { return false; } } require_once($cfg['path']['apps'] . $name . '.class.php'); return true; } $page = new Page(); $page->tpl = $tpl; $page->action = $_REQUEST['action']; $page->version = 'ANLEYE V1.6 20110104'; if ($_GET['request']=='ajax') { $_POST = charsetIconv($_POST); } require('anleye.php'); function print_rr($var){ echo "
";
	print_r($var);
	echo "
"; } ?> Rss '; echo ''; echo '上传成功'; echo ""; echo ''; $store_info = explode('|',$to); $js_func = $store_info[0]; /* 判断特殊字符 */ if($store_info[1]){ if(!ereg("^[A-Za-z]+$",$store_info[1])){ exit; } } if($store_info[2]){ if(!ereg("^[A-Za-z]+$",$store_info[2])){ exit; } } $upload_conf = require($cfg['path']['conf'].'upload.cfg.php'); $this_config = (array)$upload_conf[$store_info[1]][$store_info[2]]; if(empty($this_config)){ exit; } $upload = new UploadFile();//实例化上传对象 //设置可以上传文件的类型 $upload->setAllowFileType($this_config['allowType']); foreach ($_FILES as $a_file){ if($a_file['error']!=UPLOAD_ERR_NO_FILE) { try{ $fileName = $upload->upload($a_file,$cfg['path']['root'].'upfile/'.$this_config['originalPath'], 1); $f_path['url'] = $this_config['originalPath'].$fileName; $f_path['name'] = $a_file['name']; $attach_file[] = $f_path; if(in_array(strtolower(FileSystem::fileExt($f_path['name'])),array('gif','jpeg','jpg','png')) && !$this_config['noResize']){ //先缩略到指定大小 $image = new Image($cfg['path']['root'].'upfile/'.$this_config['originalPath'].$fileName); $image->resizeImage($this_config['width'],$this_config['height'],$this_config['resizeType']); $image->save(); //加水印 if($this_config['watermark']){ $image = new Image($cfg['path']['root'].'upfile/'.$this_config['originalPath'].$fileName); $image->waterMark($this_config['watermarkPic'],$this_config['watermarkPos']); $image->save(); } //如果需要再生成缩略图 if($this_config['thumb']){ $image = new Image($cfg['path']['root'].'upfile/'.$this_config['originalPath'].$fileName); $image->resizeImage($this_config['thumbWidth'],$this_config['thumbHeight'],$this_config['thumbResizeType']); if($this_config['originalPath']==$this_config['thumbDir']){ //防止存储目录相同时覆盖原有的图片,不存储缩略图直接设置 thumb 属性为空 $image->save(2,$cfg['path']['root'].'upfile/'.$this_config['thumbDir'],'_thumb'); $thumb_path = $this_config['thumbDir'].FileSystem::getBasicName($fileName, false).'_thumb'.FileSystem::fileExt($fileName, true); }else{ $image->save(1,$cfg['path']['root'].'upfile/'.$this_config['thumbDir']); $thumb_path = $this_config['thumbDir'].$fileName; } } } //回传参数 echo ""; }catch(Exception $e){ $page->back( $e->getMessage()); } }else{ echo ""; exit; } echo ""; } echo ''; echo ''; }elseif($action=="form"){ echo ''; echo ''; echo '上传文件'; echo ""; echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ''; } ?>
"; echo ""; echo ""; echo "