Merge branch 'master' of gitee.com:hainatravel/information-system

feature/pay
cyc 6 years ago
commit 64efa74490

@ -3,9 +3,11 @@
if (!defined('BASEPATH')) if (!defined('BASEPATH'))
exit('No direct script access allowed'); exit('No direct script access allowed');
class Information extends CI_Controller { class Information extends CI_Controller
{
function __construct() { function __construct()
{
parent::__construct(); parent::__construct();
$this->permission->is_admin(); $this->permission->is_admin();
//$this->output->enable_profiler(TRUE); //$this->output->enable_profiler(TRUE);
@ -22,11 +24,13 @@ class Information extends CI_Controller {
$this->load->library('Amplib'); //加载AMP处理类 $this->load->library('Amplib'); //加载AMP处理类
} }
public function index() { public function index()
{
echo '信息首页'; echo '信息首页';
} }
public function add($is_parent_id) { public function add($is_parent_id)
{
//添加空内容. //添加空内容.
$this->InfoContents_model->Add('', 'New Information', '', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', 0, '', 0, '', ''); $this->InfoContents_model->Add('', 'New Information', '', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', 0, '', 0, '', '');
$infocontent = $this->InfoContents_model->get_ic_contents($this->InfoContents_model->insert_id); $infocontent = $this->InfoContents_model->get_ic_contents($this->InfoContents_model->insert_id);
@ -44,7 +48,8 @@ class Information extends CI_Controller {
} }
//移动结构顺序 //移动结构顺序
public function move() { public function move()
{
//网站会提交一个同级节点id列表字符串按照这个去排序 //网站会提交一个同级节点id列表字符串按照这个去排序
$parent_id = $this->input->post('pid'); $parent_id = $this->input->post('pid');
$idsStr = $this->input->post('ids'); $idsStr = $this->input->post('ids');
@ -65,7 +70,8 @@ class Information extends CI_Controller {
//把文章移动到任意板块文章下 //把文章移动到任意板块文章下
//is_id 信息结构IDis_parent_id即将转移到的信息结构id //is_id 信息结构IDis_parent_id即将转移到的信息结构id
public function move_by_is_id() { public function move_by_is_id()
{
$data = array(); $data = array();
$is_id = $this->input->post('is_id'); $is_id = $this->input->post('is_id');
$is_parent_id = $this->input->post('is_parent_id'); $is_parent_id = $this->input->post('is_parent_id');
@ -90,7 +96,8 @@ class Information extends CI_Controller {
return TRUE; return TRUE;
} }
public function delete($is_id) { public function delete($is_id)
{
//查询结构信息 //查询结构信息
$Structure = $this->InfoStructures_model->Detail($is_id); $Structure = $this->InfoStructures_model->Detail($is_id);
if ($Structure == FALSE) { if ($Structure == FALSE) {
@ -124,7 +131,8 @@ class Information extends CI_Controller {
} }
} }
public function edit($is_id) { public function edit($is_id)
{
set_time_limit(30); set_time_limit(30);
//$this->output->enable_profiler(true); //$this->output->enable_profiler(true);
//查询结构信息 //查询结构信息
@ -297,7 +305,8 @@ class Information extends CI_Controller {
exit(); exit();
} */ } */
public function test_proxy($url = false) { public function test_proxy($url = false)
{
$curl = curl_init(); $curl = curl_init();
//curl_setopt($curl,CURLOPT_URL, "http://graph.facebook.com/?id=http://www.chinahighlights.com"); //curl_setopt($curl,CURLOPT_URL, "http://graph.facebook.com/?id=http://www.chinahighlights.com");
//curl_setopt($curl,CURLOPT_URL, 'http://graph.facebook.com/?id=http://www.mybeijingchina.com/beijing-attractions/beihai-park/'); //curl_setopt($curl,CURLOPT_URL, 'http://graph.facebook.com/?id=http://www.mybeijingchina.com/beijing-attractions/beihai-park/');
@ -313,7 +322,8 @@ class Information extends CI_Controller {
} }
// 分享数 lzq // 分享数 lzq
public function statistical_sharing() { public function statistical_sharing()
{
//$info_ic = $this->Information_model->get_ic_url_by_code('mbj'); //$info_ic = $this->Information_model->get_ic_url_by_code('mbj');
$info_ic = $this->Information_model->get_ic_url(); $info_ic = $this->Information_model->get_ic_url();
@ -355,7 +365,8 @@ class Information extends CI_Controller {
$this->load->view('bootstrap3/statistical_sharing'); $this->load->view('bootstrap3/statistical_sharing');
} }
public function edit_save() { public function edit_save()
{
header('Cache-Control: no-cache'); header('Cache-Control: no-cache');
$information = $this->Information_model->Detail($this->input->post('is_id')); $information = $this->Information_model->Detail($this->input->post('is_id'));
if ($information === false) { if ($information === false) {
@ -470,7 +481,8 @@ class Information extends CI_Controller {
} }
//URL不重复检查 //URL不重复检查
function ic_url_check() { function ic_url_check()
{
if ($this->input->post('ignore_url_check')) { if ($this->input->post('ignore_url_check')) {
return true; return true;
} }
@ -484,7 +496,8 @@ class Information extends CI_Controller {
} }
//URL格式检查不能包含大小写、空格等特殊字符 //URL格式检查不能包含大小写、空格等特殊字符
function ic_url_format($url) { function ic_url_format($url)
{
if ($url != mb_strtolower($url) || strpos($url, ' ') !== false || strpos($url, '--') !== false || strpos($url, ')') !== false || strpos($url, '(') !== false || strpos($url, '//') !== false || strpos($url, '\\') !== false) { if ($url != mb_strtolower($url) || strpos($url, ' ') !== false || strpos($url, '--') !== false || strpos($url, ')') !== false || strpos($url, '(') !== false || strpos($url, '//') !== false || strpos($url, '\\') !== false) {
return false; return false;
} }
@ -493,7 +506,8 @@ class Information extends CI_Controller {
//更新静态文件 //更新静态文件
//不用参数提交的原因是可能url带有特殊字符CI会报错 //不用参数提交的原因是可能url带有特殊字符CI会报错
public function update_cache($static_html_url = false, $delete_only = false) { public function update_cache($static_html_url = false, $delete_only = false)
{
$url = !empty($static_html_url) ? $static_html_url : $this->input->post('cache_url'); $url = !empty($static_html_url) ? $static_html_url : $this->input->post('cache_url');
$url = str_replace($this->config->item('site_url'), '', $url); $url = str_replace($this->config->item('site_url'), '', $url);
$original_url = $url; //原始链接 $original_url = $url; //原始链接
@ -539,11 +553,11 @@ class Information extends CI_Controller {
case 'it': case 'it':
case 'ru': case 'ru':
case 'jp': case 'jp':
if ($delete_only) { $information = $this->Information_model->Detail($url);
if ($delete_only || $information->ic_ht_area_type === 'q') {
//只删除操作在url修改和不发布信息的时候使用 //只删除操作在url修改和不发布信息的时候使用
$url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url; $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
} else { } else {
$information = $this->Information_model->Detail($url);
$tmp = $url; $tmp = $url;
//判断是否是更新信息 //判断是否是更新信息
// 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了 // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了
@ -594,7 +608,8 @@ class Information extends CI_Controller {
case 'yz': case 'yz':
$url = $this->config->item('site_url') . $url . '@cache@refresh'; $url = $this->config->item('site_url') . $url . '@cache@refresh';
break; break;
default:return false; default:
return false;
break; break;
} }
@ -623,7 +638,8 @@ class Information extends CI_Controller {
} }
//更新CDN缓存 //更新CDN缓存
public function update_cdn($static_html_url = false) { public function update_cdn($static_html_url = false)
{
$flag = false; //false不更新true更新 $flag = false; //false不更新true更新
$update_site = array('jp', 'ru'); //需要更新CDN的站点 $update_site = array('jp', 'ru'); //需要更新CDN的站点
//需要更新的url //需要更新的url
@ -658,7 +674,8 @@ class Information extends CI_Controller {
} }
//获取产品信息,提供给用户选择进行绑定 //获取产品信息,提供给用户选择进行绑定
function get_products() { function get_products()
{
$HT_productType = $this->input->post('product_type'); $HT_productType = $this->input->post('product_type');
$HT_productName = $this->input->post('product_name'); $HT_productName = $this->input->post('product_name');
//产品类型 //产品类型
@ -679,7 +696,8 @@ class Information extends CI_Controller {
} }
//显示备份的内容 //显示备份的内容
function backup_content($log_id) { function backup_content($log_id)
{
$data['log_info'] = $this->Logs_model->read($log_id); $data['log_info'] = $this->Logs_model->read($log_id);
$data['log_list'] = $this->Logs_model->get_all_backup_list($data['log_info']->log_res_id); $data['log_list'] = $this->Logs_model->get_all_backup_list($data['log_info']->log_res_id);
$this->load->view('bootstrap/header', $data); $this->load->view('bootstrap/header', $data);
@ -688,7 +706,8 @@ class Information extends CI_Controller {
} }
//保存自定义配置 //保存自定义配置
function save_meta() { function save_meta()
{
$im_ic_id = $this->input->post('im_ic_id'); $im_ic_id = $this->input->post('im_ic_id');
$im_key = $this->input->post('im_key'); $im_key = $this->input->post('im_key');
$im_value = $this->input->post('im_value'); $im_value = $this->input->post('im_value');
@ -708,7 +727,8 @@ class Information extends CI_Controller {
} }
//保存自定义配置 //保存自定义配置
function delete_meta() { function delete_meta()
{
$im_ic_id = $this->input->post('im_ic_id'); $im_ic_id = $this->input->post('im_ic_id');
$im_key = $this->input->post('im_key'); $im_key = $this->input->post('im_key');
if ($im_ic_id && $im_key) { if ($im_ic_id && $im_key) {
@ -721,5 +741,4 @@ class Information extends CI_Controller {
echo json_encode($data); echo json_encode($data);
return true; return true;
} }
} }

Loading…
Cancel
Save