添加社媒分享按钮和社媒图片选择

ct-mobile-first
ycc 5 years ago
parent 544ee09f63
commit ae5bc42631

@ -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,'),

@ -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('<!--@CUSTOM-CONENT@-->', $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('<!--@ARTICLENEXT@-->', $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('<!--@OG:IMAGE@-->', '<meta property="og:image" content="$full_ic_photo"><meta property="og:image:secure_url" content="$full_ic_photo"><meta property="og:image:width" content="800"><meta property="og:image:height" content="450">', $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('<!--@CUSTOM-CONENT@-->', $this->input->post('ic_content'), $template);
$template_NEXT=$this->call_mobile_template_NEXT($template_path,$this->input->post('is_id'));
$template=str_replace('<!--@ARTICLENEXT@-->', $template_NEXT, $template);
//社媒分享图片
if(!empty($information->ic_photo)){
$full_ic_photo=$this->config->item('site_image_url').$information->ic_photo;
$template=str_replace('<!--@OG:IMAGE@-->', '<meta property="og:image" content="'.$full_ic_photo.'"><meta property="og:image:secure_url" content="'.$full_ic_photo.'"><meta property="og:image:width" content="800"><meta property="og:image:height" content="450">', $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);

@ -247,7 +247,9 @@
for (var key in result.Pinfo) {
if ('<?php echo $this->config->item('site_code') ?>' == 'cht') {
editor.insertHtml('<div class="photoBlock300 autowidht" id="yonglaidingweitupian"> <img class="img-responsive" src="' + site_image_url + result.Pinfo[key].PUrl + '" alt="' + result.Pinfo[key].Sinfo + '" width="' + result.Pinfo[key].Width + '" height="' + result.Pinfo[key].Height + '" />' + result.Pinfo[key].Sinfo + '</div>');
} else {
} else if('<?php echo $this->config->item('site_code') ?>' == 'ch'){
editor.insertHtml('<div class="infoimage"><img src="'+ site_image_url + result.Pinfo[key].PUrl +'" alt="'+ result.Pinfo[key].Sinfo +'" class="img-responsive" width="' + result.Pinfo[key].Width+'" height="'+ result.Pinfo[key].Height+'"><span class="infoimagetitle">'+result.Pinfo[key].Sinfo+'</span></div>');
}else {
editor.insertHtml('<img src="' + site_image_url + result.Pinfo[key].PUrl + '" alt="' + result.Pinfo[key].PName + '" width="' + result.Pinfo[key].Width + '" height="' + result.Pinfo[key].Height + '" />');
}
use_pictures = use_pictures + result.Pinfo[key].ID + ':' + result.Pinfo[key].PUrl + ':' + result.Pinfo[key].wh + ',';

@ -9,6 +9,7 @@
<meta name="apple-mobile-web-app-title" content="China Highlights - Since 1998!">
<meta name="keywords" content="<!--@KEYWORDS@-->">
<meta name="description" content="<!--@DESCRIPTION@-->">
<!--@OG:IMAGE@-->
<link rel="canonical" href="<!--@CANONICAL@-->">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="preconnect" href="//data.chinahighlights.com">

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save