diff --git a/application/config/config.php b/application/config/config.php index ffea7576..ffa29776 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -415,7 +415,6 @@ $config['site'] = array( ); //静态文件生成路径 - $config['cache']['jp']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\arachina.com'; $config['cache']['gm']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinarundreisen.com'; $config['cache']['vc']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\voyageschine.com'; @@ -423,6 +422,14 @@ $config['cache']['vac']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaje-a-china.c $config['cache']['ru']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinahighlights.ru'; $config['cache']['it']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaggio-in-cina.it'; +//静态文件站点域名 +$config['cache']['jp']['site_url'] = 'https://www.arachina.com'; +$config['cache']['gm']['site_url'] = 'https://www.chinarundreisen.com'; +$config['cache']['vc']['site_url'] = 'https://www.voyageschine.com'; +$config['cache']['vac']['site_url'] = 'https://www.viaje-a-china.com'; +$config['cache']['ru']['site_url'] = 'https://www.chinahighlights.ru'; +$config['cache']['it']['site_url'] = 'https://www.viaggio-in-cina.it'; + //静态文件更新接口 $config['cache']['jp']['cache_api'] = '/info.php/information/update_cache/'; $config['cache']['gm']['cache_api'] = '/info.php/information/update_cache/'; diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 0705a6b2..f6316f10 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -22,11 +22,13 @@ class Cache extends CI_Controller function __construct() { parent::__construct(); - $this->permission->is_admin(); + if (!$this->input->get('site_code')) { + $this->permission->is_admin(); + } $this->load->model('Area_model'); $this->load->model('InfoStructures_model'); $this->load->model('Information_model'); - $this->site_code = $this->config->item('site_code'); + $this->site_code = $this->input->get('site_code') ? $this->input->get('site_code') : $this->config->item('site_code'); } /** @@ -39,13 +41,14 @@ class Cache extends CI_Controller */ public function update() { + $returnType = $this->input->get('type'); //设置缓存文件文件夹 $cache_config = $this->config->item('cache'); $current_cache_config = $cache_config[$this->site_code]; $this->dir = $current_cache_config['cache_path']; //设置当前站点 - $this->current_domain = $this->config->item('site_url'); + $this->current_domain = $current_cache_config['site_url']; //$this->config->item('site_url'); //echo $this->config->item('site_url'); //设置缓存更新接口及POST参数 $this->cache_api = $current_cache_config['cache_api']; @@ -66,8 +69,15 @@ class Cache extends CI_Controller $data['cache_api'] = $this->cache_api; $data['post_para'] = $this->post_para; - //视图 - $this->load->view('cache/update', $data); + if ($returnType === 'json') { + //print_r($cache_config[$this->site_code]); + //echo('json'); + //print_r($data['file']); + echo (json_encode($data['file'])); + } else { + //视图 + $this->load->view('cache/update', $data); + } } /** @@ -150,7 +160,11 @@ class Cache extends CI_Controller $url_temp = $this->current_domain . $path_temp . '/' . $file_temp; $url_temp = str_replace('index.htm', '', $url_temp); $file_time[$url_temp] = date("F d Y H:i:s", filemtime("$dir/$f")); - $file[] = $url_temp; + + $encode = mb_detect_encoding($url_temp, array('ASCII', 'GBK', 'ISO-8859-1', 'UTF-8')); + $_url_temp = mb_convert_encoding($url_temp, 'UTF8', $encode); + + $file[] = $_url_temp; } } } diff --git a/application/controllers/information.php b/application/controllers/information.php index 857b55a1..f77733c7 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -666,12 +666,17 @@ class Information extends CI_Controller //信息推荐 $template_NEXT = $this->call_mobile_template_NEXT($template_path, $information->is_id); $template = str_replace('', $template_NEXT, $template); - $template = str_replace('', '', $template); + $addthis_widget=$this->load->view($template_path.'-add-this', false,true); + $template = str_replace('', $addthis_widget, $template); } else { $template = str_replace('', '', $template); } //顶部全屏大图 - $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); + if($device=='mobile'){//移动端读取移动大图 + $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); + }else{ + $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); + } $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); if (!empty($meta_addon_picture)) { if(!empty($meta_addon_picture_url)){ @@ -708,7 +713,8 @@ class Information extends CI_Controller $template = str_replace('', '', $template); } if (!empty(get_meta($information->ic_id, 'meta_google_ad_article'))) { - $template = str_replace('', '', $template); + $in_article_google=$this->load->view($template_path.'-google-ad', false,true); + $template = str_replace('', $in_article_google, $template); } //社媒分享图片 if (!empty($information->ic_photo)) { diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php index d17f485c..172bfafc 100644 --- a/application/controllers/welcome.php +++ b/application/controllers/welcome.php @@ -105,7 +105,7 @@ class Welcome extends CI_Controller { show_404(); return false; } - $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path); + $data['all_information'] = $this->Information_model->get_list_by_path($structure->is_path,false,false,'is_id,ic_url,ic_id,ic_status'); $this->load->view('bootstrap3/header', $data); switch ($view){ case 'amp': diff --git a/application/models/information_model.php b/application/models/information_model.php index ebafb5ca..70e0a4b4 100644 --- a/application/models/information_model.php +++ b/application/models/information_model.php @@ -97,14 +97,14 @@ class Information_model extends CI_Model { } //根据根节点路径获取子节点列表 - function get_list_by_path($path, $level = false, $site_code = false) { + function get_list_by_path($path, $level = false, $site_code = false,$filed=false) { $this->init(); if ($level !== false) { $this->level = " AND is1.is_level= '$level' "; } $this->path = " AND is1.is_path LIKE '$path%' "; $this->orderBy = ' ORDER BY is1.is_level ASC, is1.is_sort ASC,is1.is_path ASC '; - return $this->GetList('', $site_code); + return $this->GetList($filed, $site_code); } //根据路径获取某一级别节点详细页 diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 72cb1de4..d5785f89 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -746,11 +746,16 @@ -