<?php
/** 
 * UQ云商：	www.uqcms.com  
 * 联系QQ：	2200631718 
 * 可免费商用，需要留UQ云商链接作为交换，只首页底部留取即可，不影响使用。
 */

defined('IN_UQ') or exit('Access Denied'); class config_uqcms extends control { function __construct() { $this->aid = $_SESSION['admin']['aid']; parent::__construct(); } public function post() { if($_POST){ $uq0 = $_POST; $this->flush_config($uq0); } } private function flush_config($uq1) { foreach($uq1 as $uq2=>$uq3){ $uq0['name'] = $uq2; $uq0['value'] = $uq3??'0'; $uq4 = $this->db->get_one("select * from ".table('config')." where name = '".$uq2."'"); if($uq4['name'] == ''){ $uq5 = $this->db->add(table('config'), $uq0); if($uq5){ $uq6[] = ''; } }else{ $uq5 = $this->db->update(table('config'), $uq0, "name ='{$uq2}'"); if($uq5){ $uq6[] = ''; } } } if(count($uq1) == count($uq6)){ cache::del('config/index'); right_json(); }else{ error_json('保存失败'); } } public function template() { $uq7 = scandir(UQCMS_PATH . 'home/templates'); foreach ($uq7 as $uq3){ if($uq3 != '.' && $uq3 != '..'){ $uq8[] = ['name'=>$uq3]; } } $this->assign('pc_tpl_list', $uq8); $uq9 = scandir(UQCMS_PATH . 'wap/templates'); foreach ($uq9 as $uq3){ if($uq3 != '.' && $uq3 != '..'){ $uq10[] = ['name'=>$uq3]; } } $this->assign('wap_tpl_list', $uq10); $this->display(); } public function temp_clear() { $uq11 = ['templates_c', 'images', 'cache', 'log', 'session', 'config', 'upgrade', 'wchat']; $uq12 = isset($_GET['path'])?$_GET['path']:error_json('路径错误'); if($uq12 == 'all'){ foreach($uq11 as $uq3){ $this->temp_func_del($uq3); } }else{ $uq13 = explode(',', $uq12); foreach($uq13 as $uq3){ if(in_array($uq3, $uq11)){ $this->temp_func_del($uq3); }else{ error_json('删除目标错误'); } } } right_json(); } private function temp_func_del($uq14) { file::del_dir('temp/'.$uq14); file::mk_dir('temp/'.$uq14); } function other() { $uq15 = ini_get('upload_max_filesize'); $this->assign('upload_size', $uq15); $this->display(); } function email() { if(!extension_loaded('openssl')){ $this->assign('error_status', true); } $this->display(); } } 