From ae5bc4263186882180102e69553c42f80fe91fd1 Mon Sep 17 00:00:00 2001 From: ycc Date: Thu, 24 Dec 2020 16:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A4=BE=E5=AA=92=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=8C=89=E9=92=AE=E5=92=8C=E7=A4=BE=E5=AA=92=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config/config.php | 2 +- application/controllers/information.php | 18 ++++++++++++++---- .../views/bootstrap3/information_edit.php | 4 +++- application/views/mobile_first/ch-pc.php | 1 + application/views/mobile_first/ch.php | 3 ++- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index e5f81d6c..6178b762 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -388,7 +388,7 @@ $config['proxy_ips'] = ''; //各站信息组和人员权限分配 $config['site'] = array( 'cht' => array('site_code' => 'cht', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'https://www.chinahighlights.com', 'site_image_url' => '//images.chinahighlights.com', 'site_authors' => array('zzy', 'spt', 'yl', 'gavin', 'sw', 'zl', 'wbl', 'yqw', 'lf', 'zhm', 'pkl'), 'site_user' => ',ycc,lmr, zyh,J,shw,B,zzy,WJJ,Tony,pcf,zxy,wst,wz,v,S,yyg,yxd,wj,sw,yl,hx,spt,wmr,zl,syt,gavin,zm,htc,yqw,bhn,lmj,wbl,yqw,LYY,zhm,si'), - 'ch' => array('site_code' => 'ch', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'https://www.chinahighlights.com', 'site_image_url' => '//images.chinahighlights.com', 'site_authors' => array('TDJ','ycc'), 'site_user' => ',ycc,'), + 'ch' => array('site_code' => 'ch', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'https://www.chinahighlights.com', 'site_image_url' => 'https://images.chinahighlights.com', 'site_authors' => array('TDJ','ycc'), 'site_user' => ',ycc,'), 'gm' => array('site_code' => 'gm', 'site_id' => 22, 'site_lgc' => '4', 'site_url' => 'https://www.chinarundreisen.com', 'site_image_url' => '//bilder.chinarundreisen.com', 'site_authors' => array('DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'), 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'), 'vc' => array('site_code' => 'vc', 'site_id' => 30, 'site_lgc' => '5', 'site_url' => 'https://www.voyageschine.com', 'site_image_url' => '//images.voyageschine.com', 'site_authors' => array('JE', 'kq', 'lya', 'lyz', 'zyh'), 'site_user' => ',ycc,lmr, zyh,JE,htc,kq,lya,bhn,Tony,zyh,B,J,lyz,LYY,'), 'jp' => array('site_code' => 'jp', 'site_id' => 88, 'site_lgc' => '3', 'site_url' => 'https://www.arachina.com', 'site_image_url' => '//images.arachina.com', 'site_authors' => array('hql', 'LLM', 'SHX', 'lmr', 'zyh', 'zb'), 'site_user' => ',ycc,lmr, zyh,hql,LLM,SHX,htc,zpl,Tony,zyh,J,B,zb,LYY,'), diff --git a/application/controllers/information.php b/application/controllers/information.php index c50b5548..a1f15585 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -485,8 +485,8 @@ class Information extends CI_Controller $update_info_log = $this->update_cache($ic_url, true); }else if (strcasecmp($site_code, "ch") == 0 && !empty($auto_update_cache)) { //读取模板生成PC和移动优先文件 - $this->make_mobile_html(); - $this->make_pc_html(); + $this->make_mobile_html($information); + $this->make_pc_html($information); } else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) { $update_info_log = $this->update_cache($ic_url); } else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { @@ -558,7 +558,7 @@ class Information extends CI_Controller return true; } - function make_mobile_html(){ + function make_mobile_html($information){ $data=array(); //获取移动优先的模板,如果有的话 $mobile_first_template_path='mobile_first/'.$this->config->item('site_code'); @@ -576,6 +576,11 @@ class Information extends CI_Controller $mobile_template=str_replace('', $this->input->post('ic_content'), $mobile_template); $template_NEXT=$this->call_mobile_template_NEXT($mobile_first_template_path,$this->input->post('is_id')); $mobile_template=str_replace('', $template_NEXT, $mobile_template); + //社媒分享图片 + if(!empty($information->ic_photo)){ + $full_ic_photo=$this->config->item('site_image_url').$information->ic_photo; + $mobile_template=str_replace('', '', $mobile_template); + } // /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm $mobile_html=$this->config->item('cache')[$this->config->item('site_code')]['cache_path'].$this->input->post('ic_url'); $mobile_html=str_replace("\\", "/", $mobile_html); @@ -588,7 +593,7 @@ class Information extends CI_Controller } - function make_pc_html(){ + function make_pc_html($information){ $data=array(); //获取PC的模板,如果有的话 $template_path='mobile_first/'.$this->config->item('site_code'); @@ -606,6 +611,11 @@ class Information extends CI_Controller $template=str_replace('', $this->input->post('ic_content'), $template); $template_NEXT=$this->call_mobile_template_NEXT($template_path,$this->input->post('is_id')); $template=str_replace('', $template_NEXT, $template); + //社媒分享图片 + if(!empty($information->ic_photo)){ + $full_ic_photo=$this->config->item('site_image_url').$information->ic_photo; + $template=str_replace('', '', $template); + } // /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm $html_path=$this->config->item('cache')[$this->config->item('site_code')]['cache_path'].$this->input->post('ic_url'); $html_path=str_replace("\\", "/", $html_path); diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index c39741dc..8a0d71cd 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -247,7 +247,9 @@ for (var key in result.Pinfo) { if ('config->item('site_code') ?>' == 'cht') { editor.insertHtml('
' + result.Pinfo[key].Sinfo + '' + result.Pinfo[key].Sinfo + '
'); - } else { + } else if('config->item('site_code') ?>' == 'ch'){ + editor.insertHtml('
'+ result.Pinfo[key].Sinfo +''+result.Pinfo[key].Sinfo+'
'); + }else { editor.insertHtml('' + result.Pinfo[key].PName + ''); } use_pictures = use_pictures + result.Pinfo[key].ID + ':' + result.Pinfo[key].PUrl + ':' + result.Pinfo[key].wh + ','; diff --git a/application/views/mobile_first/ch-pc.php b/application/views/mobile_first/ch-pc.php index b611f2b7..dd137aa6 100644 --- a/application/views/mobile_first/ch-pc.php +++ b/application/views/mobile_first/ch-pc.php @@ -9,6 +9,7 @@ + diff --git a/application/views/mobile_first/ch.php b/application/views/mobile_first/ch.php index 01f78e31..47ca6189 100644 --- a/application/views/mobile_first/ch.php +++ b/application/views/mobile_first/ch.php @@ -7,6 +7,7 @@ + @@ -242,7 +243,7 @@ -