public function show() { $ac = $this->input->get('ac', true); $op = $this->input->get('op', true); $dir = $this->input->get('dirs', true); $path = $this->input->get('path'); if ($op != 'home' && $op != 'user' && $op != 'mobile') { $op = 'skins'; } if (empty($dir)) { admin_msg(L('plub_01'), 'javascript:history.back();', 'no'); } //模板路径不能为空 if (empty($ac)) { $skin_dir = CSCMS . 'tpl/' . $op . '/' . $dir . '/'; } else { if (!empty($op)) { $skin_dir = FCPATH . 'plugins/' . $ac . '/tpl/' . $op . '/' . $dir . '/'; } else { $skin_dir = FCPATH . 'plugins/' . $ac . '/tpl/skins/' . $dir . '/'; } } //模板文件说明 $skinfiles = $skin_dir . 'skins.php'; if (file_exists($skinfiles)) { $skin_arr = (require_once $skinfiles); } else { $skin_arr = array(); } $skin_dir = !empty($path) ? $skin_dir . $path . '/' : $skin_dir; $skin_dir = str_replace("//", "/", $skin_dir); if (!is_dir($skin_dir)) { admin_msg(L('tpl_12'), 'javascript:history.back();', 'no'); //模板路径不能为空 } $this->load->helper('file'); $showarr = get_dir_file_info($skin_dir, $top_level_only = TRUE); $dirs = $list = array(); if ($showarr) { foreach ($showarr as $t) { if (is_dir($t['server_path'])) { if ($t['name'] != 'install') { $dirs[] = array('name' => $t['name'], 'date' => date('Y-m-d H:i:s', $t['date']), 'size' => '--', 'icon' => Web_Path . 'packs/admin/images/ext/dir.gif', 'link' => site_url('skin/show') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . "&path=" . $path . "/" . $t['name'], 'dellink' => site_url('skin/del') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . "&file=" . $path . "/" . $t['name']); } } else { $exts = strtolower(trim(strrchr($t['name'], '.'), '.')); if ($exts == 'css') { $title = L('tpl_13'); } elseif ($exts == 'js') { $title = L('tpl_14'); } else { if ($op == 'mobile') { if (strpos($path . '/', '/user/') !== FALSE) { $skin_f = empty($skin_arr['user']) ? array() : $skin_arr['user']; } elseif (strpos($path . '/', '/home/') !== FALSE) { $skin_f = empty($skin_arr['home']) ? array() : $skin_arr['home']; } else { $skin_f = empty($skin_arr['index']) ? array() : $skin_arr['index']; } } else { $skin_f = $skin_arr; } $title = !arr_key_value($skin_f, $t['name']) ? L('tpl_15') : arr_key_value($skin_f, $t['name']); } if ($exts == 'html' || $exts == 'css' || $exts == 'js') { $times = date('Y-m-d H:i:s', $t['date']); $list[] = array('name' => $t['name'], 'title' => $title, 'ext' => get_extpic($exts), 'date' => date('Y-m-d', $t['date']) == date('Y-m-d') ? '<font color=red>' . $times . '<font>' : $times, 'size' => formatsize($t['size']), 'icon' => Web_Path . 'packs/admin/images/ext/' . get_extpic($exts) . '.gif', 'link' => site_url('skin/edit') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . "&file=" . $path . "/" . $t['name'], 'blink' => site_url('skin/copyt') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . "&file=" . $path . "/" . $t['name'], 'dellink' => site_url('skin/del') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . "&file=" . $path . "/" . $t['name']); } } } } $data['addlink'] = site_url('skin/add') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . $path; $data['path'] = empty($ac) ? str_replace(CSCMS . 'tpl', '', $skin_dir) : str_replace(FCPATH . 'plugins/' . $ac, '', $skin_dir); $data['dirs'] = $dirs; $data['show'] = $list; $data['uplink'] = site_url('skin/upload') . "?ac=" . $ac . "&op=" . $op; $parr = explode('/', $path); $spath = ''; for ($j = 0; $j < count($parr) - 1; $j++) { $spath .= $parr[$j] . '/'; } if (substr($spath, -1) == '/') { $spath = substr($spath, 0, -1); } $data['slink'] = empty($path) ? site_url('skin') . "?ac=" . $ac . "&op=" . $op : site_url('skin/show') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $dir . "&path=" . $spath; $this->load->view('skin_show.html', $data); }
public function setting_save() { $name = $this->input->post('name', true); $dir = $this->input->post('dir', true); $Web_Mode = intval($this->input->post('Web_Mode', true)); $Mobile_Is = intval($this->input->post('Mobile_Is', true)); $Skins_Dir = $this->input->post('Skins_Dir', true); $User_Dir = $this->input->post('User_Dir', true); $Mobile_Dir = $this->input->post('Mobile_Dir', true); $Ym_Mode = intval($this->input->post('Ym_Mode', true)); $Cache_Is = intval($this->input->post('Cache_Is', true)); $Cache_Time = intval($this->input->post('Cache_Time', true)); $Ym_Url = $this->input->post('Ym_Url', true); $User_Qx = $this->input->post('user', true); $User_Dj_Qx = $this->input->post('user_dj', true); $rewrite = $this->input->post('rewrite', true); $html = $this->input->post('html', true); $seo = $this->input->post('seo', true); $key = $this->input->post('key', true); if ($Web_Mode == 0) { $Web_Mode = 1; } if ($Cache_Time == 0) { $Cache_Time = 1800; } if (empty($Skins_Dir)) { admin_msg(L('plub_01'), 'javascript:history.back();', 'no'); } //模板路径不能为空 if ($Ym_Mode > 0 && empty($Ym_Url)) { admin_msg(L('plub_02'), 'javascript:history.back();', 'no'); } //模板路径不能为空 $row = $this->db->query("SELECT ak,name FROM " . CS_SqlPrefix . "plugins where dir='" . $dir . "'")->row(); if (!empty($name) && $name != $row->name) { $this->db->query("update " . CS_SqlPrefix . "plugins set name='" . $name . "' where dir='" . $dir . "'"); } $arrs = unarraystring(sys_auth($row->ak, 'D')); if (empty($key)) { $key = '0'; } if (empty($arrs) || empty($arrs['md5']) || $key != $arrs['key']) { $app['dir'] = $dir; $app['key'] = $key; $ak = $this->csapp->keys($app); if (empty($ak)) { admin_msg(L('plub_03'), 'javascript:history.back();', 'no'); } elseif ($ak == '0') { admin_msg(L('plub_04'), 'javascript:history.back();', 'no'); } $this->db->query("update " . CS_SqlPrefix . "plugins set ak='" . $ak . "' where dir='" . $dir . "'"); } if (is_dir(FCPATH . 'plugins/' . $dir)) { $data['Web_Mode'] = $Web_Mode; $data['Skins_Dir'] = $Skins_Dir; $data['User_Dir'] = $User_Dir; $data['Mobile_Dir'] = $Mobile_Dir; $data['Mobile_Is'] = $Mobile_Is; $data['Cache_Is'] = $Cache_Is; $data['Cache_Time'] = $Cache_Time; $data['Ym_Mode'] = $Ym_Mode; $data['Ym_Url'] = $Ym_Url; $data['User_Qx'] = empty($User_Qx) ? '' : implode(',', $User_Qx); $data['User_Dj_Qx'] = empty($User_Dj_Qx) ? '' : implode(',', $User_Dj_Qx); $data['Rewrite_Uri'] = $rewrite; $data['Html_Uri'] = $html; $data['Seo'] = $seo; //判断开启二级域名 global $_CS_Domain; if ($Ym_Mode == 1) { $_CS_Domain[$dir] = $Ym_Url; arr_file_edit($_CS_Domain); } else { if (arr_key_value($_CS_Domain, $dir)) { unset($_CS_Domain[$dir]); arr_file_edit($_CS_Domain); } } //伪静态模式,写入URL路由 if ($Web_Mode == 2) { foreach ($rewrite as $key => $val) { list($preg, $value) = $this->_rule_preg_value($rewrite[$key]['url']); if (!$preg || !$value) { $preg = $rewrite[$key]['url']; $rewrite_uri = $rewrite[$key]['uri']; } else { $rewrite_uri = $rewrite[$key]['uri']; if (!empty($value['{ji}'])) { $rewrite_uri = str_replace("{ji}", '$' . $value['{ji}'], $rewrite_uri); } if (!empty($value['{zu}'])) { $rewrite_uri = str_replace("{zu}", '$' . $value['{zu}'], $rewrite_uri); } if (!empty($value['{id}'])) { $rewrite_uri = str_replace("{id}", '$' . $value['{id}'], $rewrite_uri); } if (!empty($value['{page}'])) { $rewrite_uri = str_replace("{page}", '$' . $value['{page}'], $rewrite_uri); } if (!empty($value['{sort}'])) { $rewrite_uri = str_replace("{sort}", '$' . $value['{sort}'], $rewrite_uri); } } $_data[$preg] = $rewrite_uri; $_note[$preg]['name'] = $rewrite[$key]['title']; $_note[$preg]['url'] = $rewrite[$key]['url']; } $this->_route_file(FCPATH . 'plugins/' . $dir . '/config/rewrite.php', $_data, $_note, $dir); } else { $this->_route_file(FCPATH . 'plugins/' . $dir . '/config/rewrite.php'); } arr_file_edit($data, FCPATH . 'plugins/' . $dir . '/config/site.php'); admin_msg(L('plub_05'), site_url('plugins'), 'ok'); //修改完成 } else { admin_msg(L('plub_06'), site_url('plugins'), 'no'); //板块不存在 } }
public function setting_save() { $User_Mode = intval($this->input->post('User_Mode', TRUE)); $User_No_info = $this->input->post('User_No_info', TRUE, TRUE); $User_Ym = $this->input->post('User_Ym', TRUE, TRUE); $User_Code_Mode = intval($this->input->post('User_Code_Mode', TRUE)); $User_Logo = intval($this->input->post('User_Logo', TRUE)); $User_Tel = intval($this->input->post('User_Tel', TRUE)); $User_BookFun = intval($this->input->post('User_BookFun', TRUE)); $User_YkDown = intval($this->input->post('User_YkDown', TRUE)); $User_Uc_Mode = intval($this->input->post('User_Uc_Mode', TRUE)); $User_Uc_Fun = intval($this->input->post('User_Uc_Fun', TRUE)); $User_Downtime = intval($this->input->post('User_Downtime', TRUE)); $User_DownFun = intval($this->input->post('User_DownFun', TRUE)); $User_Downcion = intval($this->input->post('User_Downcion', TRUE)); $User_Reg = intval($this->input->post('User_Reg')); $User_RegZw = intval($this->input->post('User_RegZw')); $User_Regxy = $this->input->post('User_Regxy'); $User_Reg_Name = $this->input->post('User_Reg_Name', TRUE, true); $User_RegMsgFun = intval($this->input->post('User_RegMsgFun', TRUE)); $User_RegIP = intval($this->input->post('User_RegIP', TRUE)); $User_RegFun = intval($this->input->post('User_RegFun', TRUE)); $User_RegEmailFun = intval($this->input->post('User_RegEmailFun', TRUE)); $User_RegEmailContent = $this->input->post('User_RegEmailContent'); $User_RegMsgContent = $this->input->post('User_RegMsgContent'); $User_PassContent = $this->input->post('User_PassContent'); $User_Dtts = intval($this->input->post('User_Dtts')); $User_Fkts = intval($this->input->post('User_Fkts')); $User_Hyts = intval($this->input->post('User_Hyts')); $User_Fsts = intval($this->input->post('User_Fsts')); $User_Ssts = intval($this->input->post('User_Ssts')); $User_RmbToCion = intval($this->input->post('User_RmbToCion')); $User_Cion_Reg = intval($this->input->post('User_Cion_Reg')); $User_Cion_Log = intval($this->input->post('User_Cion_Log')); $User_Cion_Qd = intval($this->input->post('User_Cion_Qd')); $User_Cion_Logo = intval($this->input->post('User_Cion_Logo')); $User_Cion_Add = intval($this->input->post('User_Cion_Add')); $User_Cion_Zx = intval($this->input->post('User_Cion_Zx')); $User_Cion_Del = intval($this->input->post('User_Cion_Del')); $User_Jinyan_Reg = intval($this->input->post('User_Jinyan_Reg')); $User_Jinyan_Log = intval($this->input->post('User_Jinyan_Log')); $User_Jinyan_Qd = intval($this->input->post('User_Jinyan_Qd')); $User_Jinyan_Logo = intval($this->input->post('User_Jinyan_Logo')); $User_Jinyan_Add = intval($this->input->post('User_Jinyan_Add')); $User_Jinyan_Zx = intval($this->input->post('User_Jinyan_Zx')); $User_Jinyan_Del = intval($this->input->post('User_Jinyan_Del')); $User_Jinyan_Share = intval($this->input->post('User_Jinyan_Share')); $User_Cion_Share = intval($this->input->post('User_Cion_Share')); $User_Nums_Share = intval($this->input->post('User_Nums_Share')); $User_Nums_Add = intval($this->input->post('User_Nums_Add')); $User_Skins = $this->input->post('User_Skins', true, true); if ($User_RmbToCion == 0) { $User_RmbToCion = 1; } //HTML转码 $User_Regxy = str_encode($User_Regxy); $User_RegEmailContent = str_encode($User_RegEmailContent); $User_RegMsgContent = str_encode($User_RegMsgContent); $User_PassContent = str_encode($User_PassContent); //判断开启二级域名 global $_CS_Domain; if (!empty($User_Ym)) { $_CS_Domain['user'] = $User_Ym; arr_file_edit($_CS_Domain); } else { if (arr_key_value($_CS_Domain, 'user')) { unset($_CS_Domain['user']); arr_file_edit($_CS_Domain); } } //开启UC整合 if ($User_Uc_Mode == 1) { include CSCMS . 'lib/Cs_Ucenter.php'; $UC_DBHOST = $this->input->post('UC_DBHOST', true); $UC_DBUSER = $this->input->post('UC_DBUSER', true); $UC_DBPW = $this->input->post('UC_DBPW', true); $UC_DBNAME = $this->input->post('UC_DBNAME', true); $UC_DBTABLEPRE = $this->input->post('UC_DBTABLEPRE', true); $UC_KEY = $this->input->post('UC_KEY', true); $UC_API = $this->input->post('UC_API', true); $UC_APPID = intval($this->input->post('UC_APPID')); if (substr(UC_DBPW, 0, 1) . "********" . substr(UC_DBPW, -1) == $UC_DBPW) { $UC_DBPW = UC_DBPW; } $UC_DBTABLEPRE = "`" . $UC_DBNAME . "`." . $UC_DBTABLEPRE . ""; if (empty($UC_DBHOST) || empty($UC_DBUSER) || empty($UC_DBPW) || empty($UC_DBNAME) || empty($UC_KEY) || empty($UC_API) || empty($UC_APPID)) { admin_msg(L('plub_07'), 'javascript:history.back();', 'no'); } $strsuc = "<?php" . "\r\n"; $strsuc .= "define(\"UC_CONNECT\", \"mysql\");\r\n"; $strsuc .= "define(\"UC_DBHOST\", \"" . $UC_DBHOST . "\");\r\n"; $strsuc .= "define(\"UC_DBUSER\", \"" . $UC_DBUSER . "\");\r\n"; $strsuc .= "define(\"UC_DBPW\", \"" . $UC_DBPW . "\");\r\n"; $strsuc .= "define(\"UC_DBNAME\", \"" . $UC_DBNAME . "\");\r\n"; $strsuc .= "define(\"UC_DBCHARSET\", \"gbk\");\r\n"; $strsuc .= "define(\"UC_DBTABLEPRE\", \"" . $UC_DBTABLEPRE . "\");\r\n"; $strsuc .= "define(\"UC_KEY\", \"" . $UC_KEY . "\");\r\n"; $strsuc .= "define(\"UC_API\", \"" . $UC_API . "\");\r\n"; $strsuc .= "define(\"UC_CHARSET\", \"gbk\");\r\n"; $strsuc .= "define(\"UC_IP\", \"\");\r\n"; $strsuc .= "define(\"UC_APPID\", " . $UC_APPID . ");"; if (!write_file(CSCMS . 'lib/Cs_Ucenter.php', $strsuc)) { admin_msg(L('plub_08'), 'javascript:history.back();', 'no'); } } $strs = "<?php" . "\r\n"; $strs .= "define(\"User_Mode\"," . $User_Mode . "); //会员开关 \r\n"; $strs .= "define(\"User_No_info\",\"" . $User_No_info . "\"); //会员关闭提示\r\n"; $strs .= "define(\"User_Ym\",\"" . $User_Ym . "\"); //会员板块绑定域名 \r\n"; $strs .= "define(\"User_Code_Mode\"," . $User_Code_Mode . "); //会员验证码开关 \r\n"; $strs .= "define(\"User_Logo\"," . $User_Logo . "); //强制头像开关 \r\n"; $strs .= "define(\"User_Tel\"," . $User_Tel . "); //手机强制验证\r\n"; $strs .= "define(\"User_BookFun\"," . $User_BookFun . "); //网站留言开关 \r\n"; $strs .= "define(\"User_YkDown\"," . $User_YkDown . "); //游客下载开关 \r\n"; $strs .= "define(\"User_Uc_Mode\"," . $User_Uc_Mode . "); //UC整合开关 \r\n"; $strs .= "define(\"User_Uc_Fun\"," . $User_Uc_Fun . "); //UC整合会员是否需要激活 \r\n"; $strs .= "define(\"User_Downtime\"," . $User_Downtime . "); //重复扣币间隔小时 \r\n"; $strs .= "define(\"User_DownFun\"," . $User_DownFun . "); //分成比列开关 \r\n"; $strs .= "define(\"User_Downcion\"," . $User_Downcion . "); //默认分成比列数量 \r\n"; $strs .= "define(\"User_Reg\"," . $User_Reg . "); //会员注册开关 \r\n"; $strs .= "define(\"User_RegZw\"," . $User_RegZw . "); //用户名中文开关 \r\n"; $strs .= "define(\"User_Regxy\",\"" . $User_Regxy . "\"); //会员注册协议 \r\n"; $strs .= "define(\"User_Reg_Name\",\"" . $User_Reg_Name . "\"); //禁用用户名/昵称 \r\n"; $strs .= "define(\"User_RegMsgFun\"," . $User_RegMsgFun . "); //发送欢迎信息\r\n"; $strs .= "define(\"User_RegIP\"," . $User_RegIP . "); //同一IP注册限制小时 \r\n"; $strs .= "define(\"User_RegFun\"," . $User_RegFun . "); //新用户注册人工审核,1需要审核 \r\n"; $strs .= "define(\"User_RegEmailFun\"," . $User_RegEmailFun . "); //新用户邮件激活,1需要激活 \r\n"; $strs .= "define(\"User_RegEmailContent\",\"" . $User_RegEmailContent . "\"); //注册激活邮件内容\r\n"; $strs .= "define(\"User_RegMsgContent\",\"" . $User_RegMsgContent . "\"); //欢迎邮件内容不够\r\n"; $strs .= "define(\"User_PassContent\",\"" . $User_PassContent . "\"); //密码找回邮件内容\r\n"; $strs .= "define(\"User_Dtts\"," . $User_Dtts . "); //动态保留数,0为全部保留\r\n"; $strs .= "define(\"User_Fkts\"," . $User_Fkts . "); //访客保留数,0为全部保留 \r\n"; $strs .= "define(\"User_Hyts\"," . $User_Hyts . "); //好友保留数,0为全部保留 \r\n"; $strs .= "define(\"User_Fsts\"," . $User_Fsts . "); //粉丝保留数,0为全部保留 \r\n"; $strs .= "define(\"User_Ssts\"," . $User_Ssts . "); //说说保留数,0为全部保留 \r\n"; $strs .= "define(\"User_RmbToCion\"," . $User_RmbToCion . "); //默认金币比例 \r\n"; $strs .= "define(\"User_Cion_Reg\"," . $User_Cion_Reg . "); //注册赠送金币 \r\n"; $strs .= "define(\"User_Cion_Log\"," . $User_Cion_Log . "); //登入赠送金币 \r\n"; $strs .= "define(\"User_Cion_Qd\"," . $User_Cion_Qd . "); //签到赠送金币\r\n"; $strs .= "define(\"User_Cion_Logo\"," . $User_Cion_Logo . "); //上传头像赠送金币\r\n"; $strs .= "define(\"User_Cion_Add\"," . $User_Cion_Add . "); //发表数据赠送金币\r\n"; $strs .= "define(\"User_Cion_Zx\"," . $User_Cion_Zx . "); //在线1小时赠送金币\r\n"; $strs .= "define(\"User_Cion_Del\"," . $User_Cion_Del . "); //数据删除扣除金币\r\n"; $strs .= "define(\"User_Jinyan_Reg\"," . $User_Jinyan_Reg . "); //注册赠送经验\r\n"; $strs .= "define(\"User_Jinyan_Log\"," . $User_Jinyan_Log . "); //登入赠送经验\r\n"; $strs .= "define(\"User_Jinyan_Qd\"," . $User_Jinyan_Qd . "); //签到赠送经验\r\n"; $strs .= "define(\"User_Jinyan_Logo\"," . $User_Jinyan_Logo . "); //上传头像赠送经验\r\n"; $strs .= "define(\"User_Jinyan_Add\"," . $User_Jinyan_Add . "); //发表数据赠送经验\r\n"; $strs .= "define(\"User_Jinyan_Zx\"," . $User_Jinyan_Zx . "); //在线1小时赠送经验\r\n"; $strs .= "define(\"User_Jinyan_Del\"," . $User_Jinyan_Del . "); //数据删除扣除经验\r\n"; $strs .= "define(\"User_Cion_Share\"," . $User_Cion_Share . "); //每次分享奖励金币\r\n"; $strs .= "define(\"User_Jinyan_Share\"," . $User_Jinyan_Share . "); //每次分享奖励经验\r\n"; $strs .= "define(\"User_Nums_Share\"," . $User_Nums_Share . "); //每天分享奖励次数\r\n"; $strs .= "define(\"User_Nums_Add\"," . $User_Nums_Add . "); //每天发表数据奖励次数\r\n"; $strs .= "define(\"User_Skins\",\"" . $User_Skins . "\"); //会员默认模板路径"; //写文件 if (!write_file(CSCMS . 'lib/Cs_User.php', $strs)) { admin_msg('./cscms/lib/Cs_User.php ' . L('plub_09'), 'javascript:history.back();', 'no'); } else { admin_msg(L('plub_10'), site_url('user/setting')); } }
public function save() { $Web_Name = $this->input->post('Web_Name', TRUE, TRUE); $Web_Url = $this->input->post('Web_Url', TRUE, TRUE); $Web_Path = $this->input->post('Web_Path', TRUE, TRUE); $Admin_Code = $this->input->post('Admin_Code', TRUE, TRUE); $Web_Off = intval($this->input->post('Web_Off', TRUE)); $Web_Onneir = $this->input->post('Web_Onneir', TRUE, TRUE); $Web_Mode = intval($this->input->post('Web_Mode', TRUE)); $Web_Icp = $this->input->post('Web_Icp', TRUE, TRUE); $Admin_QQ = $this->input->post('Admin_QQ', TRUE, TRUE); $Admin_Tel = $this->input->post('Admin_Tel', TRUE, TRUE); $Admin_Mail = $this->input->post('Admin_Mail', TRUE, TRUE); $Web_Key = $this->input->post('Web_Key', TRUE, TRUE); $Web_Count = $_POST['Web_Count']; $Web_Title = $this->input->post('Web_Title', TRUE, TRUE); $Web_Keywords = $this->input->post('Web_Keywords', TRUE, TRUE); $Web_Description = $this->input->post('Web_Description', TRUE, TRUE); $Web_Notice = $this->input->post('Web_Notice', TRUE, TRUE); $Pl_Modes = intval($this->input->post('Pl_Modes', TRUE)); $Pl_Youke = intval($this->input->post('Pl_Youke', TRUE)); $Pl_Num = intval($this->input->post('Pl_Num', TRUE)); $Pl_Yy_Name = $this->input->post('Pl_Yy_Name', TRUE); $Pl_Ds_Name = $this->input->post('Pl_Ds_Name', TRUE); $Pl_Cy_Id = $this->input->post('Pl_Cy_Id', TRUE, TRUE); $Pl_Str = $this->input->post('Pl_Str', TRUE, TRUE); $Cache_Is = intval($this->input->post('Cache_Is', TRUE)); $Cache_Time = intval($this->input->post('Cache_Time', TRUE)); $CS_Play_w = intval($this->input->post('CS_Play_w')); $CS_Play_h = intval($this->input->post('CS_Play_h')); $CS_Play_sw = intval($this->input->post('CS_Play_sw')); $CS_Play_sh = intval($this->input->post('CS_Play_sh')); $CS_Play_AdloadTime = intval($this->input->post('CS_Play_AdloadTime')); $Html_Index = $this->input->post('Html_Index', TRUE, TRUE); $Html_StopTime = intval($this->input->post('Html_StopTime', TRUE)); $Html_PageNum = intval($this->input->post('Html_PageNum', TRUE)); $CS_Language = $this->input->post('CS_Language', TRUE, TRUE); $CS_Cache_Time = intval($this->input->post('CS_Cache_Time', TRUE)); $CS_Cache_Dir = $this->input->post('CS_Cache_Dir', TRUE, TRUE); $CS_Cache_On = $this->input->post('CS_Cache_On', TRUE, TRUE); $Mobile_Is = intval($this->input->post('Mobile_Is', TRUE)); $Mobile_Url = $this->input->post('Mobile_Url', TRUE, TRUE); $Mobile_Win = intval($this->input->post('Mobile_Win', TRUE)); $Mobile_Skins = $this->input->post('Mobile_Skins', TRUE, TRUE); $Web_Skins = $this->input->post('Web_Skins', TRUE, TRUE); if ($CS_Cache_Time == 0) { $CS_Cache_Time = 600; } if (empty($CS_Cache_Dir)) { $CS_Cache_Dir = "sql"; } if ($CS_Cache_On != "FALSE") { $CS_Cache_On = "TRUE"; } if ($Html_StopTime == 0) { $Html_StopTime = 1; } if ($Html_PageNum == 0) { $Html_PageNum = 20; } if ($Pl_Num == 0) { $Pl_Num = 10; } if ($Cache_Time == 0) { $Cache_Time = 600; } if ($CS_Play_w == 0) { $CS_Play_w = 445; } if ($CS_Play_h == 0) { $CS_Play_h = 64; } if ($CS_Play_sw == 0) { $CS_Play_sw = 600; } if ($CS_Play_sh == 0) { $CS_Play_sh = 450; } if ($CS_Play_AdloadTime == 0) { $CS_Play_AdloadTime = 10; } //HTML转码 $Web_Onneir = str_encode($Web_Onneir); $Web_Title = str_encode($Web_Title); $Web_Keywords = str_encode($Web_Keywords); $Web_Description = str_encode($Web_Description); $Web_Notice = str_encode($Web_Notice); $Web_Count = str_encode($Web_Count); //判断主要数据不能为空 if (empty($Web_Name) || empty($Web_Url) || empty($Web_Path) || empty($Admin_Code)) { admin_msg(L('setting_err_01'), site_url('setting'), 'no'); //站点名称、域名、路径、认证码不能为空 } //判断生成首页文件格式 $file_ext = strtolower(trim(substr(strrchr($Html_Index, '.'), 1))); if ($file_ext != 'html' && $file_ext != 'htm' && $file_ext != 'shtm' && $file_ext != 'shtml') { admin_msg(L('setting_err_60'), site_url('setting'), 'no'); //静态文件格式不正确 } //判断数据库缓存目录 if ($CS_Cache_Dir != CS_Cache_Dir) { if (file_exists(FCPATH . 'cache/' . CS_Cache_Dir)) { if (!rename(FCPATH . 'cache/' . CS_Cache_Dir, FCPATH . 'cache/' . $CS_Cache_Dir)) { admin_msg(vsprintf(L('setting_err_02'), array('./cache/' . CS_Cache_Dir)), site_url('setting'), 'no'); } } else { @mkdir(FCPATH . 'cache/' . $CS_Cache_Dir); } } //判断开启手机二级域名 global $_CS_Domain; if (!empty($Mobile_Url)) { $_CS_Domain['mobile'] = $Mobile_Url; arr_file_edit($_CS_Domain); } else { if (arr_key_value($_CS_Domain, 'mobile')) { unset($_CS_Domain['mobile']); arr_file_edit($_CS_Domain); } } //修改数据库缓存配置 $this->load->helper('file'); $db_cof = read_file(FCPATH . "cscms/lib/Cs_DB.php"); $db_cof = preg_replace('/"CS_Cache_On",(.*?)\\)/', '"CS_Cache_On",' . $CS_Cache_On . ')', $db_cof); $db_cof = preg_replace('/"CS_Cache_Dir","(.*?)"/', '"CS_Cache_Dir","' . $CS_Cache_Dir . '"', $db_cof); $db_cof = preg_replace('/"CS_Cache_Time",(.*?)\\)/', '"CS_Cache_Time",' . $CS_Cache_Time . ')', $db_cof); if (!write_file(FCPATH . "cscms/lib/Cs_DB.php", $db_cof)) { admin_msg(vsprintf(L('setting_err_03'), array('./cscms/lib/Cs_DB.php')), site_url('setting'), 'no'); } $strs = "<?php" . "\r\n"; $strs .= "define(\"Web_Name\",\"" . $Web_Name . "\"); //站点名称 \r\n"; $strs .= "define(\"Web_Url\",\"" . $Web_Url . "\"); //站点域名 \r\n"; $strs .= "define(\"Web_Path\",\"" . $Web_Path . "\"); //站点路径 \r\n"; $strs .= "define(\"Admin_Code\",\"" . $Admin_Code . "\"); //后台验证码 \r\n"; $strs .= "define(\"Web_Off\"," . $Web_Off . "); //网站开关 \r\n"; $strs .= "define(\"Web_Onneir\",\"" . $Web_Onneir . "\"); //网站关闭内容 \r\n"; $strs .= "define(\"Web_Mode\"," . $Web_Mode . "); //网站运行模式 \r\n"; $strs .= "define(\"Html_Index\",\"" . $Html_Index . "\"); //主页静态URL \r\n"; $strs .= "define(\"Html_StopTime\"," . $Html_StopTime . "); //生成间隔秒数 \r\n"; $strs .= "define(\"Html_PageNum\"," . $Html_PageNum . "); //每页生成数量 \r\n"; $strs .= "define(\"Web_Icp\",\"" . $Web_Icp . "\"); //网站ICP \r\n"; $strs .= "define(\"Admin_QQ\",\"" . $Admin_QQ . "\"); //站长QQ \r\n"; $strs .= "define(\"Admin_Tel\",\"" . $Admin_Tel . "\"); //站长电话 \r\n"; $strs .= "define(\"Admin_Mail\",\"" . $Admin_Mail . "\"); //站长EMAIL \r\n"; $strs .= "define(\"Web_Key\",\"" . $Web_Key . "\"); //热门搜索 \r\n"; $strs .= "define(\"Web_Count\",\"" . $Web_Count . "\"); //统计代码 \r\n"; $strs .= "define(\"Web_Title\",\"" . $Web_Title . "\"); //SEO-标题 \r\n"; $strs .= "define(\"Web_Keywords\",\"" . $Web_Keywords . "\"); //SEO-Keywords \r\n"; $strs .= "define(\"Web_Description\",\"" . $Web_Description . "\"); //SEO-description \r\n"; $strs .= "define(\"Web_Notice\",\"" . $Web_Notice . "\"); //网站公告 \r\n"; $strs .= "define(\"Pl_Modes\"," . $Pl_Modes . "); //评论方式 \r\n"; $strs .= "define(\"Pl_Youke\"," . $Pl_Youke . "); //游客是否可以评论 \r\n"; $strs .= "define(\"Pl_Num\"," . $Pl_Num . "); //评论每页条数 \r\n"; $strs .= "define(\"Pl_Yy_Name\",\"" . $Pl_Yy_Name . "\"); //友言账号 \r\n"; $strs .= "define(\"Pl_Ds_Name\",\"" . $Pl_Ds_Name . "\"); //多说账号 \r\n"; $strs .= "define(\"Pl_Cy_Id\",\"" . $Pl_Cy_Id . "\"); //畅言APP_Id \r\n"; $strs .= "define(\"Pl_Str\",\"" . $Pl_Str . "\"); //评论过滤字符 \r\n"; $strs .= "define(\"Cache_Is\"," . $Cache_Is . "); //缓存开关 \r\n"; $strs .= "define(\"Cache_Time\"," . $Cache_Time . "); //缓存时间 \r\n"; $strs .= "define(\"CS_Play_w\"," . $CS_Play_w . "); \r\n"; $strs .= "define(\"CS_Play_h\"," . $CS_Play_h . "); \r\n"; $strs .= "define(\"CS_Play_sw\"," . $CS_Play_sw . "); \r\n"; $strs .= "define(\"CS_Play_sh\"," . $CS_Play_sh . "); \r\n"; $strs .= "define(\"CS_Play_AdloadTime\"," . $CS_Play_AdloadTime . "); //视频播放前广告时间 \r\n"; $strs .= "define(\"CS_Language\",\"" . $CS_Language . "\"); //网站语言,english英文,zh_cn中文 \r\n"; $strs .= "define(\"Mobile_Is\"," . $Mobile_Is . "); //手机门户是否开启 \r\n"; $strs .= "define(\"Mobile_Url\",\"" . $Mobile_Url . "\"); //手机门户域名 \r\n"; $strs .= "define(\"Mobile_Win\"," . $Mobile_Win . "); //电脑是否可以访问手机页面 \r\n"; $strs .= "define(\"Mobile_Skins\",\"" . $Mobile_Skins . "\"); //手机门户模板路径 \r\n"; $strs .= "define(\"Web_Skins\",\"" . $Web_Skins . "\"); //默认主页模板路径 "; //写文件 if (!write_file(CSCMS . 'lib/Cs_Config.php', $strs)) { admin_msg(L('setting_err_03'), site_url('setting'), 'no'); } else { admin_msg(L('setting_err_04'), site_url('setting')); } }
function base_fun($body_arr) { global $_INTERFACE; //声明配置文件 global $_NOCHECKLOGIN; $inter_num = arr_key_value("inter_num", $body_arr); //获取接口号 $resp_arr = array(); if (!arr_key_value_login($inter_num, $_NOCHECKLOGIN)) { //检测登录状态 $body_arr['userid'] = getSessonUserData('userid'); if (!$body_arr['userid']) { //方便测试,这里先注释 $resp_arr['status'] = 1035; $resp_arr['desc'] = err_info($resp_arr['status']); return $resp_arr; } } switch ($inter_num) { case "0001": //web //web case "0046": //app require_once dirname(__FILE__) . "/pay/index.php"; $resp_arr = generate_order($body_arr); break; case "0005": #绑定提交 require_once dirname(__FILE__) . "/bind/code/bind.php"; $resp_arr = bind_general($body_arr); break; case "0006": #绑定校验 require_once dirname(__FILE__) . "/bind/code/bind.php"; $resp_arr = bind_check($body_arr); break; case "0007": #密码找回提交 require_once dirname(__FILE__) . "/getpwd/code/getpwd.php"; $resp_arr = get_pwd_general($body_arr); break; case "0008": #密码找回校验 require_once dirname(__FILE__) . "/getpwd/code/getpwd.php"; $resp_arr = get_pwd_check($body_arr); break; case "0027": #发送验证码 require_once dirname(__FILE__) . "/sms/code/sendsms.php"; $resp_arr = sms_general($body_arr); break; case "0028": //图片验证码校验 require_once dirname(__FILE__) . "/verifycode/verifyCode.php"; $resp_arr = verify_code($body_arr); break; case "0029": //发送邮件 require_once dirname(__FILE__) . "/mail/sendmail.php"; $resp_arr = sendemail($body_arr); break; case "0030": // 文件上传 require_once dirname(__FILE__) . "/fileupload/code/fileuploadservice.php"; $resp_arr = serviceHandle($body_arr); // 该方法需要根据业务需求进行修改 break; case "0032": //html2pdf require_once dirname(__FILE__) . "/html2pdf/html2pdf.class.php"; $html2pdf = new html2pdf(); $dest = dirname(dirname(__FILE__)) . $body_arr['dest']; $d_filename = $body_arr['d_filename']; $sourcehtmlfile = $body_arr['sourcehtmlfile']; $resp_arr = $html2pdf->createpdf($dest, $d_filename, $sourcehtmlfile); // break; case "0036": // 获取服务器时间 require_once dirname(__FILE__) . "/systime/getsystime.php"; $resp_arr = getsystime(); // 该方法需要根据业务需求进行修改 break; case "0037": //发送注册激活邮件activeuser require_once dirname(__FILE__) . "/activeuser/code/activeuser.php"; $resp_arr = activeuser_general($body_arr); break; case "0038": //验证 注册激活邮件activeuser require_once dirname(__FILE__) . "/activeuser/code/activeuser.php"; $resp_arr = activeuser_check($body_arr); break; case "0039": //登出 require_once dirname(__FILE__) . "/libcode/session.php"; $resp_arr = clearsessionjump($body_arr); break; case "0040": //生成图片,保存在服务器 require_once dirname(__FILE__) . "/createpic/createpic.php"; $resp_arr = createpicserver($body_arr); break; case "0043": //跳转到支付渠道,网页版支付 require_once dirname(__FILE__) . "/pay/index.php"; $resp_arr = jump_paychannel($body_arr); break; case "0044": //返回支付信息,移动端app支付 require_once dirname(__FILE__) . "/pay/index.php"; $resp_arr = echo_paychannel($body_arr); break; case "0045": //查询订单,移动端app require_once dirname(__FILE__) . "/pay/index.php"; $resp_arr = queryorderstatus($body_arr); break; case "0050": //购物车模块 require_once dirname(__FILE__) . "/shopping/index.php"; $resp_arr = dealCartFlow($body_arr); break; case "0051": //会员、积分模块 break; default: $procedure = arr_key_value($inter_num, $_INTERFACE); //根据接口号获取存储名 //执行存储过程 $resp_arr = exec_procedure($body_arr, $procedure); break; } if ($inter_num == "0026" && $resp_arr['status'] == 0) { //登录成功,记录userid到session中 $ret = setSessonUserData('userid', $resp_arr['out_data']['userid']); if ($body_arr['rememberpwd']) { //记住密码 rememberpwd($body_arr['account'], $body_arr['passwd'], $body_arr['second']); } } return $resp_arr; }
public function bind() { $csid = intval($this->input->get('csid')); $ac = $this->input->get('ac', TRUE); $LIST = (require_once APPPATH . 'config/bind.php'); $val = arr_key_value($LIST, $ac . '_' . $csid); $strs = '<option value="0"> |—选择目标分类</option>'; $query = $this->db->query("SELECT id,name FROM " . CS_SqlPrefix . "vod_list where fid=0 order by xid asc"); foreach ($query->result() as $row) { $clas = $row->id == $val ? ' selected="elected"' : ''; $strs .= '<option value="' . $row->id . '"' . $clas . '> |—' . $row->name . '</option>'; $query2 = $this->db->query("SELECT id,name FROM " . CS_SqlPrefix . "vod_list where fid=" . $row->id . " order by xid asc"); foreach ($query2->result() as $row2) { $clas2 = $row2->id == $val ? ' selected="elected"' : ''; $strs .= '<option value="' . $row2->id . '"' . $clas2 . '> | |—' . $row2->name . '</option>'; } } echo '<select class="select" name="cid" id="cid">' . $strs . ' </select><input class="button" type="button" value="提 交" onClick="submitbind(\'' . $ac . '\',\'' . $csid . '\');" style="cursor:pointer"> <input name="button" type="button" value="取 消" class="button" onClick="hidebind();" style="cursor:pointer"> '; }