hotfix/paypal-note
LMR 2 years ago
parent 7b4025739c
commit 31b4b18d77

@ -364,9 +364,9 @@ class Information extends CI_Controller
echo json_encode($data);
} else {
$ic_content = $this->input->post('ic_content');
if (strcasecmp($this->config->item('site_code'), "chinatravel") == 0){ //ct站替换中国大陆的英文
if (stripos($ic_content, 'mainland china') !== false){
$ic_content = str_ireplace('mainland china','the mainland of china',$ic_content);
if (strcasecmp($this->config->item('site_code'), "chinatravel") == 0) { //ct站替换中国大陆的英文
if (stripos($ic_content, 'mainland china') !== false) {
$ic_content = str_ireplace('mainland china', 'the mainland of china', $ic_content);
}
}
@ -614,11 +614,13 @@ class Information extends CI_Controller
$breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true);
true
);
$template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content,
$template);
$template
);
//替换模板中的标签
$template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template);
@ -639,11 +641,13 @@ class Information extends CI_Controller
$feedback_content = $this->load->view(
$template_path . '-feedback-list',
array('feedback_list' => $feedback_list),
true);
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_content,
$information->ic_content);
$information->ic_content
);
}
}
@ -651,11 +655,13 @@ class Information extends CI_Controller
$weather_forecast_content = $this->load->view(
$template_path . '-weather-forecast',
array(),
true);
true
);
$information->ic_content = str_replace(
'<!--@WEATHER-FORECAST-BLOCK@-->',
$weather_forecast_content,
$information->ic_content);
$information->ic_content
);
//火车票搜索框添加 -- zp
if ($information->is_parent_id == "278008234") {
@ -675,11 +681,11 @@ class Information extends CI_Controller
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){
$data_H1['author']=$author->OPI_FirstName;
}else{
$author_web =$this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if(!empty($author_web)){
if (!empty($author)) {
$data_H1['author'] = $author->OPI_FirstName;
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (!empty($author_web)) {
$data_H1['author'] = $author_web->a_name;
}
}
@ -698,14 +704,16 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
array('information' => $information, 'author' => $author),
true);
true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
$article_top_image_content = $this->load->view(
$template_path . '-info-top-img',
array('information' => $information),
true);
true
);
$template = str_replace('<!--@INFO-TOP-IMAGE@-->', $article_top_image_content, $template);
$info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true);
@ -811,7 +819,6 @@ class Information extends CI_Controller
// print_r($trippest_detail_template);
// die();
$information->ic_content = str_replace('<!--@TRIPPEST-FORM@-->', $trippest_detail_template, $information->ic_content);
}
}
@ -820,7 +827,7 @@ class Information extends CI_Controller
//信息推荐
$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防止被插件屏蔽
// //广告改叫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);
}
@ -838,15 +845,17 @@ class Information extends CI_Controller
// 未勾选In Article 广告时,加入标签 <meta name="ezoic" content="noads"/>,让 ezoic 识别出该页面不展示广告。
if (empty($meta_google_ad_article) || !$meta_google_ad_article) {
$template = str_replace(
'<!--@Meta-Ezoic-NoAds@-->',
'<meta name="ezoic" content="noads"/>',
$template);
$template = str_replace(
'<!--@Meta-Ezoic-NoAds@-->',
'<meta name="ezoic" content="noads"/>',
$template
);
} else {
$template = str_replace(
'<!--@Meta-Ezoic-NoAds@-->',
'',
$template);
$template = str_replace(
'<!--@Meta-Ezoic-NoAds@-->',
'',
$template
);
}
//替换内容中广告
@ -872,7 +881,7 @@ class Information extends CI_Controller
$template_TrainSearch = "";
if ($information->ic_url == "/china-trains/hometest.htm" || $information->ic_url == "/china-trains/") {
$template_TrainSearch = $this->load->view($template_path . '-train-index', null, TRUE);
if ($device=="mobile"){
if ($device == "mobile") {
//手机端的搜索框直接显示不再加背景图这样可以保证CLS分数。
$template = str_replace('<!--@TOP-BANNER@-->', '<div class="detailtopbanner">' . $template_TrainSearch . '</div>', $template);
}
@ -894,7 +903,7 @@ class Information extends CI_Controller
$template = str_replace('<!--@TOP-VIDEO@-->', '<div class="detailtopbanner"><video autoplay="" controls="controls" id="bgvid" poster="' . $meta_video_picture . '" src="' . $meta_news_video . '" style="position: inherit;"> </video></div>', $template);
}
if (is_file('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
if (is_file('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-data.chinahighlights.com/css/mobile-first.css'));
} else {
$main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css'));
@ -998,20 +1007,24 @@ class Information extends CI_Controller
$breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true);
true
);
$template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content,
$template);
$template
);
$tour_form_content = $this->load->view(
$template_path . '-tour-form',
array('information' => $information),
true);
true
);
$template = str_replace(
'<!--@TOUR-FORM-TAG@-->',
$tour_form_content,
$template);
$template
);
//替换模板中的标签
$template = str_replace('<!--@TITLE@-->', $information->ic_seo_title, $template);
@ -1033,17 +1046,17 @@ class Information extends CI_Controller
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){
$data_H1['author']=$author->OPI_FirstName;
}else{
$author_web =$this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if(!empty($author_web)){
if (!empty($author)) {
$data_H1['author'] = $author->OPI_FirstName;
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (!empty($author_web)) {
$data_H1['author'] = $author_web->a_name;
}
}
$data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $meta_addon_picture;//$information->ic_photo; 用额外设置的图片替代
$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);
@ -1057,7 +1070,8 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
array('information' => $information, 'author_name' => $data_H1['author']),
true);
true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
if (!empty($meta_product_code)) {
@ -1069,7 +1083,7 @@ class Information extends CI_Controller
//信息推荐
$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防止被插件屏蔽
// //广告改叫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);
}
@ -1096,18 +1110,24 @@ class Information extends CI_Controller
}
}
}
$why_us_covid_list_pc = $this->load->view(
$template_path . '-why-us-covid-list-pc', array(), true);
$template_path . '-why-us-covid-list-pc',
array(),
true
);
$information->ic_content = str_replace('<!--@WHY-US-COVID-LIST-PC@-->', $why_us_covid_list_pc, $information->ic_content);
$why_us_covid_list_mobile = $this->load->view(
$template_path . '-why-us-covid-mobile', array(), true);
$template_path . '-why-us-covid-mobile',
array(),
true
);
$information->ic_content = str_replace('<!--@WHY-US-COVID-MOBILE@-->', $why_us_covid_list_mobile, $information->ic_content);
$info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true);
$information->ic_content = str_replace('<!--@INFO-PAGE-FORM@-->', $info_page_form_content, $information->ic_content);
if (is_file('D:/wwwroot/origin-www.globalhighlights.com/css/gh-global.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
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 {
$main_css_string = compress_css(GET_HTTP('https://www.globalhighlights.com/css/gh-global.css'));
@ -1131,7 +1151,7 @@ class Information extends CI_Controller
//设置内容图片缓加载
$lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.chinahighlights.com/grey.gif');
$template = str_replace('<!--@CUSTOM-CONENT@-->', $lazy_content, $template);
//社媒分享图片
$full_ic_photo = '';
if (!empty($information->ic_photo)) {
@ -1226,11 +1246,11 @@ class Information extends CI_Controller
$data['ads_by_google'] = $ads_by_google;
$data['author'] = ''; //获取作者信息
$author = $this->Operator_model->get_author_nikename($information->ic_author);
if(!empty($author)){
$data['author']=$author->OPI_FirstName;
}else{
$author_web =$this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if(!empty($author_web)){
if (!empty($author)) {
$data['author'] = $author->OPI_FirstName;
} else {
$author_web = $this->Infoauthors_model->detail_by_id($information->ic_author); //原始作者,可能是在线作者等
if (!empty($author_web)) {
$data['author'] = $author_web->a_name;
}
}
@ -1241,21 +1261,24 @@ class Information extends CI_Controller
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
array('information' => $information, 'author' => $author),
true);
true
);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
// 结构化标签BreadcrumbList
$breadcrumb_structured_data_content = $this->load->view(
$template_path . '-structured-data-breadcrumb',
array('breadcrumb_data' => $breadcrumb_data, 'information' => $information),
true);
true
);
$template = str_replace(
'<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->',
$breadcrumb_structured_data_content,
$template);
$template
);
//推荐信息或者产品
//信息推荐
$template_recommand = $recommand_information;// $this->recommand_information($information);
$template_recommand = $recommand_information; // $this->recommand_information($information);
$template = str_replace('<!--@ARTICLENEXT@-->', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template);
//广告改叫tips防止被插件屏蔽
if (!empty($template_recommand['Tips Right'])) {
@ -1289,28 +1312,31 @@ class Information extends CI_Controller
$template = str_replace('<!--@ADDTHIS-WIDGET@-->', $addthis_widget, $template);
$template = str_replace('?product_code=', '', $template);
} else {
$template = str_replace('?product_code=', '?product_code='.$meta_product_code, $template);
$template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template);
$inquiry_form_template = $this->load->view(
$template_path . '-inquiry-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true);
$template_path . '-inquiry-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true
);
$information->ic_content = str_replace('<!--@INQUIRY-FORM@-->', $inquiry_form_template, $information->ic_content);
// GP 表单
$gp_form_content = $this->load->view(
$template_path . '-gp-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true);
$template_path . '-gp-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true
);
$information->ic_content = str_replace('<!--@GP-FORM@-->', $gp_form_content, $information->ic_content);
// 水灯节 GP 线路表单
$gp_form_content = $this->load->view(
$template_path . '-lantern-festival-gp-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true);
$information->ic_content = str_replace('<!--@LANTERN-GP-FORM@-->', $gp_form_content, $information->ic_content);
$template_path . '-lantern-festival-gp-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true
);
$information->ic_content = str_replace('<!--@LANTERN-GP-FORM@-->', $gp_form_content, $information->ic_content);
}
// why-us 相关的标签
// why-us 相关的标签
$why_us_mobile = $this->load->view($template_path . '-why-us-mobile', false, true);
$information->ic_content = str_replace('<!--@WHY_US_MOBILE@-->', $why_us_mobile, $information->ic_content);
@ -1325,15 +1351,17 @@ class Information extends CI_Controller
// 水灯节表单
$lantern_form_content = $this->load->view(
$template_path . '-lantern-form',
array('information' => $information),
true);
$template_path . '-lantern-form',
array('information' => $information),
true
);
$information->ic_content = str_replace('<!--@LANTERN-FORM@-->', $lantern_form_content, $information->ic_content);
// 水灯节在信息页面表单
$lantern_form_info_page_content = $this->load->view(
$template_path . '-lantern-form-info-page',
array('information' => $information),
true);
$template_path . '-lantern-form-info-page',
array('information' => $information),
true
);
$information->ic_content = str_replace('<!--@LANTERN-FORM-INFO-PAGE@-->', $lantern_form_info_page_content, $information->ic_content);
// 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。
@ -1349,16 +1377,18 @@ class Information extends CI_Controller
$feedback_content = $this->load->view(
$template_path . '-feedback-list',
array('feedback_list' => $feedback_list),
true);
true
);
$information->ic_content = str_replace(
$tag_name,
$feedback_content,
$information->ic_content);
$information->ic_content
);
}
}
//主样式表,内联模式
if (is_file('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css')) {//主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
if (is_file('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css')) { //主样式表,内联模式,优先读取本地,没有在从网络读取,为了加速
$main_css_string = compress_css(file_get_contents('D:/wwwroot/origin-www.asiahighlights.com/css/mobile-first.css'));
} else {
$main_css_string = compress_css(GET_HTTP('https://proxy-data.asiahighlights.com/css/mobile-first.css'));
@ -1414,7 +1444,8 @@ class Information extends CI_Controller
file_put_contents($html_path, $template, LOCK_EX);
}
public function test_ah_feedback() {
public function test_ah_feedback()
{
$feedback_array = [];
preg_match_all('^<!--@FEEDBACK_(.*)@-->^', '<div><!--@FEEDBACK_Siem Reap,Bangkok@--></div>', $feedback_array);
if (!empty($feedback_array)) {
@ -1426,7 +1457,8 @@ class Information extends CI_Controller
$feedback_content = $this->load->view(
'mobile_first/ah' . '-feedback-list',
array('feedback_list' => $feedback_list),
true);
true
);
echo $feedback_content;
// $information->ic_content = str_replace(
// $tag_name,
@ -1471,12 +1503,12 @@ class Information extends CI_Controller
}
$data["crumb"] = $crumb;
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_author="";
//作者字符串,信息页或者城市天气页加载 2022-7-26
$str_author = "";
$author = $this->Operator_model->get_author_nikename($information->ic_author);
if ((empty($meta_product_code) && !($meta_ct_page_type !== false && $meta_ct_page_type != "")) || $meta_ct_page_type=="weatherpage"){
$OPI_FirstName = !empty($author)?$author->OPI_FirstName:'author nickname';
$str_author = '<div class="authorupdate">Written by <strong>'.$OPI_FirstName.'</strong> Updated <span>' . date("M. j, Y",strtotime($information->ic_datetime)) . '</span></div>' ;
if ((empty($meta_product_code) && !($meta_ct_page_type !== false && $meta_ct_page_type != "")) || $meta_ct_page_type == "weatherpage") {
$OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname';
$str_author = '<div class="authorupdate">Written by <strong>' . $OPI_FirstName . '</strong> Updated <span>' . date("M. j, Y", strtotime($information->ic_datetime)) . '</span></div>';
}
/* 详细内容 */
@ -1498,11 +1530,11 @@ class Information extends CI_Controller
// },$ic_content);
/** 替换H1加面包屑,加作者 */
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i', $crumb . "\r\n" . '<H1>$1</H1>' . "\r\n" .$str_author, $ic_content, 1);
$ic_content = preg_replace('/<h1>(.*)<\/h1>/i', $crumb . "\r\n" . '<H1>$1</H1>' . "\r\n" . $str_author, $ic_content, 1);
/**替换zodiac标签 */
if (strpos($ic_content, '<!--@ZODIAC-CALC@-->') !== false){
$zodiacCalc = $this->load->view('mobile_first/' . $this->config->item('site_code').'-zodiac-calc',false,true);
if (strpos($ic_content, '<!--@ZODIAC-CALC@-->') !== false) {
$zodiacCalc = $this->load->view('mobile_first/' . $this->config->item('site_code') . '-zodiac-calc', false, true);
$ic_content = str_replace('<!--@ZODIAC-CALC@-->', $zodiacCalc, $ic_content);
}
@ -1575,7 +1607,7 @@ class Information extends CI_Controller
$addBaseJs = false;
$addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
if ($meta_ct_page_price == "yes") {
$addBaseJs = true;
} else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") {
@ -1667,19 +1699,19 @@ class Information extends CI_Controller
}
//游船详细页
if ($meta_ct_page_type == "cruisedetails"){
if ($meta_ct_page_type == "cruisedetails") {
$productType = $meta_ct_page_type;
$meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value');
if (!empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
$dataCruise["shipname"]=$productCode;
$dataCruise["shipname"] = $productCode;
$template_curisedetails = $this->load->view($template_path . '-cruisedetails-form', $dataCruise, TRUE);
$data["template_curisedetails"] = $template_curisedetails;
}
//表单页
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform","tourdetail"))) {
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) {
$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\'" />';
@ -1732,13 +1764,12 @@ class Information extends CI_Controller
$meta_addon_picture = "";
$data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>';
}
} else if ($information->ic_url == "/china-flights") {
//机票首页
$template_TrainSearch = $this->load->view($template_path . '-flight-index', null, TRUE);
$ImgText = "";
//飞机票移动端去掉头部图片保证搜索框CLS
if ($device == 'mobile') {
//飞机票移动端去掉头部图片保证搜索框CLS
if ($device == 'mobile') {
$meta_addon_picture = "";
$data["TOPBANNER"] = '<div class="banner">' . $template_TrainSearch . '</div>';
}
@ -1788,7 +1819,6 @@ class Information extends CI_Controller
$html_path .= $html_path_ext;
create_folder_by_path(dirname($html_path));
file_put_contents($html_path, $template, LOCK_EX);
}
#endregion
@ -1813,41 +1843,41 @@ class Information extends CI_Controller
{
$data = array();
switch ($recommand->ir_rule) {
case 'rule_same_node_keyword'://同节点关键词
case 'rule_same_node_keyword': //同节点关键词
$keywords = explode(',', $recommand->ir_keyword);
$data = $this->Information_model->search_by_words_2($root_information->is_path, $keywords, $exclude_ids);
break;
case 'rule_same_url_keyword'://同URL关键词
case 'rule_same_url_keyword': //同URL关键词
$keywords = explode(',', $recommand->ir_keyword);
$url = trim($information->ic_url);
$url = substr($url, 0, strpos($url, '/', 1) + 1);
$data = $this->Information_model->search_by_words($url, $keywords, $exclude_ids);
break;
case 'rule_same_node_random'://同节点随机
case 'rule_same_node_random': //同节点随机
$data = $this->Information_model->random(1, $root_information->is_path, $exclude_ids);
break;
case 'rule_this_node_random'://指定节点下随机
case 'rule_this_node_random': //指定节点下随机
$ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id, 'is_path');
if (!empty($ir_pointer)) {
$data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids);
}
break;
case 'rule_range_random'://范围内随机,同读取备用节点
case 'rule_range_random': //范围内随机,同读取备用节点
break;
case 'rule_show_tips'://显示广告
case 'rule_show_tips': //显示广告
$data = $this->recommends_and_tips_model->tips_detail($recommand->ir_pointer_it_id);
return array($recommand->ir_name => $data);
break;
case 'rule_no_show'://不显示
case 'rule_no_show': //不显示
return array($recommand->ir_name => false);
break;
default: //'rule_parent'://继承上级规则则留空,程序会循环一遍分组的规则
return false;;
}
//读取备用节点
if (empty($data) && !empty($recommand->ir_urls)) {//查不到信息并且备选urls不为空则随机选一条
// $url_array = explode("\n", $recommand->ir_urls);
// $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
if (empty($data) && !empty($recommand->ir_urls)) { //查不到信息并且备选urls不为空则随机选一条
// $url_array = explode("\n", $recommand->ir_urls);
// $data = $this->Information_model->Detail(trim($url_array[rand(0, count($url_array) - 1)]));
$url_array = explode("\n", $recommand->ir_urls);
$data = $this->Information_model->random_range(1, $url_array, $exclude_ids);
}
@ -1871,11 +1901,11 @@ class Information extends CI_Controller
{
$data = array();
$group_detail = $this->Information_model->get_detail_by_path($information->is_path, 0); //信息所属分组,根据分组进行不同推荐
$group_recommands = $this->recommends_and_tips_model->recommends_list($group_detail->is_id);//节点下所有的推荐规则
$group_recommands = $this->recommends_and_tips_model->recommends_list($group_detail->is_id); //节点下所有的推荐规则
$root_detail = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$root_recommands = $this->recommends_and_tips_model->recommends_list($root_detail->is_id);//节点下所有的推荐规则
$root_recommands = $this->recommends_and_tips_model->recommends_list($root_detail->is_id); //节点下所有的推荐规则
$exclude_ids = array($information->is_id);//需要排除的is_id防止通过页面显示相同内容默认排除本身每个推荐内容都需要排除已经推荐过的
$exclude_ids = array($information->is_id); //需要排除的is_id防止通过页面显示相同内容默认排除本身每个推荐内容都需要排除已经推荐过的
foreach ($root_recommands as $item) {
$result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids);
if (!empty($result)) {
@ -1903,7 +1933,7 @@ class Information extends CI_Controller
$data['root_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 1); //信息所属分类,获取信息顶级节点内容
switch (strtolower($data['type_detail']->is_id)) {
case 278008010://Inspiration
case 278008010: //Inspiration
//随机获取两个同级节点内容
$random_array = $this->Information_model->random(2, $data['root_detail']->is_path, array($data['detail']->is_id));
if (!empty($random_array[0])) {
@ -1952,9 +1982,9 @@ class Information extends CI_Controller
$data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content);
}
break;
case 278008012://'planing-1(guide)':
case 278008013://'planning-2 (decision tips)':
case 278008011://'destination': //url的第一段表示地区根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下
case 278008012: //'planing-1(guide)':
case 278008013: //'planning-2 (decision tips)':
case 278008011: //'destination': //url的第一段表示地区根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下
$destination_url = trim($data['detail']->ic_url);
$destination_url = substr($destination_url, 0, strpos($destination_url, '/', 1) + 1);
//how to plan
@ -2057,7 +2087,7 @@ class Information extends CI_Controller
case 'ru':
case 'jp':
$information = $this->Information_model->Detail($url);
if ($delete_only || !$information || $information->ic_ht_area_type === 'q') {
if ($delete_only) {
//只删除操作在url修改和不发布信息的时候使用
$url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $url;
} else {
@ -2083,8 +2113,8 @@ class Information extends CI_Controller
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //禁止直接显示获取的内容
curl_setopt($ch, CURLOPT_HEADER, 0); //不需要HEAD
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);

Loading…
Cancel
Save