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

hotfix/paypal-note
candice 4 years ago
commit e86d909ffa

@ -514,11 +514,11 @@ class Information extends CI_Controller
$recommand_information = $this->recommand_information($information);
//用于批量更新,CH和chinatravel分开 20210317 zp
if ($this->config->item('site_code') == 'ch') {
$this->make_www_cache('pc', $information,$recommand_information);
$this->make_www_cache('mobile', $information,$recommand_information);
$this->make_www_cache('pc', $information, $recommand_information);
$this->make_www_cache('mobile', $information, $recommand_information);
} else if ($this->config->item('site_code') == 'ah') {
$this->make_www_cache_ah('pc', $information,$recommand_information);
$this->make_www_cache_ah('mobile', $information,$recommand_information);
$this->make_www_cache_ah('pc', $information, $recommand_information);
$this->make_www_cache_ah('mobile', $information, $recommand_information);
} else if ($this->config->item('site_code') == 'chinatravel') {
$this->make_www_cache_ct($information);
// $this->make_www_cache_ct('mobile', $information);
@ -936,7 +936,7 @@ class Information extends CI_Controller
$template);
$tour_form_content = $this->load->view(
$template_path . '-gh-tour-form',
$template_path . '-tour-form',
array('information' => $information),
true);
$template = str_replace(
@ -957,57 +957,46 @@ class Information extends CI_Controller
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
}
//非产品页面
$meta_product_code = get_meta($information->ic_id, 'meta_product_code');
if (empty($meta_product_code)) {
$ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
//H1模板替换
$data_H1 = array();
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$author = $this->Operator_model->get_author_nikename($information->ic_author);
$data_H1['author'] = $author; //获取作者信息
$data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $meta_addon_picture;//$information->ic_photo; 用额外设置的图片替代
$data_H1['breadcrumb_data'] = $breadcrumb_data;
$data_H1['ads_by_google'] = $ads_by_google;
$template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE);
$template = str_replace('<!--@HEAD_1@-->', $template_H1, $template);
$ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article'));
//H1模板替换
$data_H1 = array();
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$author = $this->Operator_model->get_author_nikename($information->ic_author);
$data_H1['author'] = $author; //获取作者信息
$data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $meta_addon_picture;//$information->ic_photo; 用额外设置的图片替代
$data_H1['breadcrumb_data'] = $breadcrumb_data;
$data_H1['ads_by_google'] = $ads_by_google;
$template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE);
$template = str_replace('<!--@HEAD_1@-->', $template_H1, $template);
// $addthis_widget = $this->load->view($template_path . '-add-this', false, true);
// $template = str_replace('<!--@ADDTHIS-WIDGET@-->', $addthis_widget, $template);
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
array('information' => $information, 'author' => $author),
true);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
} else {
// $template = str_replace('<!--@PRODUCT-JS@-->', '<script src="https://data.chinahighlights.com/js/flatpickr.js"></script>', $template);
// $inquiry_form_template = $this->load->view($template_path . '-inquiry-form', array('meta_product_code' => $meta_product_code), true);
// $information->ic_content = str_replace('<!--@INQUIRY-FORM@-->', $inquiry_form_template, $information->ic_content);
//
// $breadcrumb_content = $this->load->view($template_path . '-breadcrumb', array('breadcrumb_data' => $breadcrumb_data), true);
// $information->ic_content = str_replace('<!--@BREADCRUMB-BLOCK@-->', $breadcrumb_content, $information->ic_content);
}
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
array('information' => $information, 'author' => $author),
true);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
//信息推荐
$template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来pc和移动只需要查一次减少数据库负担
$template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
// //广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right TOP'])) {
// $template = str_replace('<!--@TIPS-RIGHT-TOP@-->', "<div class='right_brand_info'><aside>" . $template_recommand['Tips Right TOP']->it_content . "</aside></div>", $template);
// $template = str_replace('<!--@TIPS-RIGHT-TOP@-->', "<div class='right_brand_info'><aside>" . $template_recommand['Tips Right TOP']->it_content . "</aside></div>", $template);
}
if (!empty($template_recommand['Tips Right'])) {
// $template = str_replace('<!--@TIPS-RIGHT@-->', "<div class='right_tour'>" . $template_recommand['Tips Right']->it_content . "</div>", $template);
// $template = str_replace('<!--@TIPS-RIGHT@-->', "<div class='right_tour'>" . $template_recommand['Tips Right']->it_content . "</div>", $template);
}
//文中的信息推荐
if (strpos($information->ic_content, '<!--@Content-Recommends-Article@-->') !== false) {
// $information->ic_content = str_replace('<!--@Content-Recommends-Article@-->', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content);
// $information->ic_content = str_replace('<!--@Content-Recommends-Article@-->', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content);
}
//文中的线路推荐
if (strpos($information->ic_content, '<!--@Content-Recommends-Tour@-->') !== false) {
// $information->ic_content = str_replace('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content);
// $information->ic_content = str_replace('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content);
}
//替换内容中广告
@ -1023,7 +1012,6 @@ class Information extends CI_Controller
}
if (is_file('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css'));
} else {
@ -1033,11 +1021,11 @@ class Information extends CI_Controller
//额外样式
$meta_addon_css = get_meta($information->ic_id, 'meta_addon_css');
if (!empty($meta_addon_css)) {
// if ($meta_addon_css == 'https://proxy-data.chinahighlights.com/css/tour-detail-former.css' && is_file('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')) {
//$meta_addon_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css'));
// } else {
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
// }
// if ($meta_addon_css == 'https://proxy-data.chinahighlights.com/css/tour-detail-former.css' && is_file('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css')) {
//$meta_addon_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/tour-detail-former.css'));
// } else {
$meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css));
// }
$template = str_replace('<!--@ADDON-CSS@-->', '<style type="text/css">' . $meta_addon_css_string . '</style>', $template);
}
//额外js
@ -1051,7 +1039,7 @@ class Information extends CI_Controller
//替换内容中各种标签
//$tag_why_us = $this->load->view($template_path . '-why-us', false, true);
// $template = str_replace('<!--@TAG-WHY-US@-->', $tag_why_us, $template);
// $template = str_replace('<!--@TAG-WHY-US@-->', $tag_why_us, $template);
//Google广告代码
//if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) {
@ -1276,12 +1264,12 @@ class Information extends CI_Controller
//面包屑
$crumb = "";
$crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path);
if (count($crumb_data)>0){ //至少有一个父类面包屑才显示
if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示
$crumb = "<div class=\"crumb\"><a href=\"/\">Home</a>";
foreach ($crumb_data as $index => $item) {
$crumb .= '<a href="'.$item['ic_url'].'" data-index="'.$index.'" data-is-id="'.$item['is_id'].'">'.$item['ic_url_title'].'</a>';
$crumb .= '<a href="' . $item['ic_url'] . '" data-index="' . $index . '" data-is-id="' . $item['is_id'] . '">' . $item['ic_url_title'] . '</a>';
}
$crumb .="</div>";
$crumb .= "</div>";
}
$data["crumb"] = $crumb;
/* 详细内容 */
@ -1303,7 +1291,7 @@ class Information extends CI_Controller
// },$ic_content);
/** 替换H1加面包屑 */
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i',$crumb."\r\n".'<H1>$1</H1>',$ic_content,1);
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i', $crumb . "\r\n" . '<H1>$1</H1>', $ic_content, 1);
//图片加延迟
$ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://data.chinatravel.com/images/mobile-first/grey.gif');
@ -1460,7 +1448,7 @@ class Information extends CI_Controller
}
//表单页
if (in_array($meta_ct_page_type, array("customize", "contactus","pagewithform"))) {
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform"))) {
$productType = $meta_ct_page_type;
$addonJs .= '<script src="' . $apiweb . '/js/mobile-first/form.js" defer></script>';
$data["ADDONCSS"] .= '<link href="' . $apiweb . '/css/newcss3/flatpickr.css" rel="preload" as="style" onload="this.rel=\'stylesheet\'" />';

@ -32,16 +32,16 @@ $config['authentication'] = function () {
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_licenseKey
$config['licenseName'] = 'www.iro.com';
$config['licenseKey'] = '*J?L-*1**-C**X-*D**-*B**-Z*6*-3**J';
$config['licenseKey'] = '*J?L-*1**-C**X-*D**-*B**-Z*6*-3**J';
/*============================ CKFinder Internal Directory ============================*/
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_privateDir
$config['privateDir'] = array(
'backend' => 'default',
'tags' => '.ckfinder/tags',
'logs' => '.ckfinder/logs',
'cache' => '.ckfinder/cache',
'tags' => '.ckfinder/tags',
'logs' => '.ckfinder/logs',
'cache' => '.ckfinder/cache',
'thumbs' => '.ckfinder/cache/thumbs',
);
@ -49,77 +49,81 @@ $config['privateDir'] = array(
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_images
$config['images'] = array(
'maxWidth' => 2560,
'maxWidth' => 2560,
'maxHeight' => 1440,
'quality' => 0,
'quality' => 0,
'sizes' => array(
'small' => array('width' => 480, 'height' => 320, 'quality' => 0),
'small' => array('width' => 480, 'height' => 320, 'quality' => 0),
'medium' => array('width' => 600, 'height' => 480, 'quality' => 0),
'large' => array('width' => 800, 'height' => 600, 'quality' => 0)
'large' => array('width' => 800, 'height' => 600, 'quality' => 0)
)
);
/*=================================== Backends ========================================*/
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_backends
$sitecode='empty';
if(!empty($_GET['sitecode'])){
$sitecode=$_GET['sitecode'];
$sitecode = 'empty';
if (!empty($_GET['sitecode'])) {
$sitecode = $_GET['sitecode'];
}
switch ($sitecode){
case 'cht':
$site_url='https://data.chinahighlights.com';
break;
case 'ch':
$site_url='https://data.chinahighlights.com';
break;
case 'gm':
$site_url='https://data.chinarundreisen.com';
break;
case 'ah':
$site_url='https://data.asiahighlights.com';
break;
case 'vc':
$site_url='https://data.voyageschine.com/kcfinder/upload/vc';
break;
case 'jp':
$site_url='https://data.arachina.com/kcfinder/upload/jp';
break;
case 'vac':
$site_url='https://data.viaje-a-china.com/kcfinder/upload/vac';
break;
case 'it':
$site_url='https://data.viaggio-in-cina.it/kcfinder/upload/it';
break;
case 'ru':
$site_url='https://data.chinahighlights.ru/kcfinder/upload/ru';
break;
case 'ct':
$site_url='https://data.chinatravel.com';
break;
default:
$site_url='';
switch ($sitecode) {
case 'cht':
$site_url = 'https://data.chinahighlights.com';
break;
case 'ch':
$site_url = 'https://data.chinahighlights.com';
break;
case 'gm':
$site_url = 'https://data.chinarundreisen.com';
break;
case 'gh':
$site_url = 'https://data.globalhighlights.com';
break;
case 'ah':
$site_url = 'https://data.asiahighlights.com';
break;
case 'vc':
$site_url = 'https://data.voyageschine.com/kcfinder/upload/vc';
break;
case 'jp':
$site_url = 'https://data.arachina.com/kcfinder/upload/jp';
break;
case 'vac':
$site_url = 'https://data.viaje-a-china.com/kcfinder/upload/vac';
break;
case 'it':
$site_url = 'https://data.viaggio-in-cina.it/kcfinder/upload/it';
break;
case 'ru':
$site_url = 'https://data.chinahighlights.ru/kcfinder/upload/ru';
break;
case 'ct':
$site_url = 'https://data.chinatravel.com';
break;
default:
$site_url = '';
}
//文件上传目录,使用相对路径,在文件夹中建立虚拟目录指向真实文件夹
//创建指向目录 mklink /D D:\wwwroot\uploader-file\gh\image D:\wwwroot\origin-www.globalhighlights.com\image
//需要移出项目文件夹防止FTP访问到防止误删
if ('origin-int.mycht.cn' == $_SERVER["SERVER_NAME"] || 'origin-gm.mycht.cn' == $_SERVER["SERVER_NAME"]) {
// 国际站和德语站不需要更改目录
$site_upload_dir = dirname(__FILE__).('/userfiles/').$sitecode;
$site_upload_dir = dirname(__FILE__) . ('/userfiles/') . $sitecode;
} else {
$site_upload_dir = dirname(dirname(dirname(dirname(__FILE__)))).'/uploader-file/'.$sitecode;
$site_upload_dir = dirname(dirname(dirname(dirname(__FILE__)))) . '/uploader-file/' . $sitecode;
}
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => $site_url,
'root' => $site_upload_dir, // Can be used to explicitly set the CKFinder user files directory.
'chmodFiles' => 0777,
'name' => 'default',
'adapter' => 'local',
'baseUrl' => $site_url,
'root' => $site_upload_dir, // Can be used to explicitly set the CKFinder user files directory.
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8',
'followSymlinks'=>true,
'followSymlinks' => true,
);
/*================================ Resource Types =====================================*/
@ -130,20 +134,20 @@ $config['defaultResourceTypes'] = '';
//按日期生成不同文件夹,每周一个文件夹
//$week_folder= date("Y-m_W", time());
$config['resourceTypes'][] = array(
'name' => 'image', // Single quotes not allowed.
'directory' => 'image',
'maxSize' => 0,
'name' => 'image', // Single quotes not allowed.
'directory' => 'image',
'maxSize' => 0,
'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip,svg',
'deniedExtensions' => '',
'backend' => 'default'
'deniedExtensions' => '',
'backend' => 'default'
);
$config['resourceTypes'][] = array(
'name' => 'pic', // Single quotes not allowed.
'directory' => 'pic',
'maxSize' => 0,
'name' => 'pic', // Single quotes not allowed.
'directory' => 'pic',
'maxSize' => 0,
'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip,svg',
'deniedExtensions' => '',
'backend' => 'default'
'deniedExtensions' => '',
'backend' => 'default'
);
/*
@ -180,21 +184,21 @@ $config['roleSessionVar'] = 'CKFinder_UserRole';
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_accessControl
$config['accessControl'][] = array(
'role' => '*',
'resourceType' => '*',
'folder' => '/',
'role' => '*',
'resourceType' => '*',
'folder' => '/',
'FOLDER_VIEW' => true,
'FOLDER_CREATE' => true,
'FOLDER_RENAME' => true,
'FOLDER_DELETE' => false,
'FOLDER_VIEW' => true,
'FOLDER_CREATE' => true,
'FOLDER_RENAME' => true,
'FOLDER_DELETE' => false,
'FILE_VIEW' => true,
'FILE_CREATE' => true,
'FILE_RENAME' => true,
'FILE_DELETE' => true,
'FILE_VIEW' => true,
'FILE_CREATE' => true,
'FILE_RENAME' => true,
'FILE_DELETE' => true,
'IMAGE_RESIZE' => true,
'IMAGE_RESIZE' => true,
'IMAGE_RESIZE_CUSTOM' => true
);
@ -227,7 +231,7 @@ $config['plugins'] = array();
$config['cache'] = array(
'imagePreview' => 24 * 3600,
'thumbnails' => 24 * 3600 * 365,
'thumbnails' => 24 * 3600 * 365,
'proxyCommand' => 0
);

Loading…
Cancel
Save