diff --git a/application/controllers/information.php b/application/controllers/information.php index 816def97..c9f07286 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -1,7 +1,7 @@ InfoContents_model->Add('', 'New Information', '', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', 0, '', 0, '', ''); $infocontent = $this->InfoContents_model->get_ic_contents($this->InfoContents_model->insert_id); - if (!empty ($infocontent) && $this->InfoStructures_model->Add($is_parent_id, $this->InfoContents_model->insert_id)) { + if (!empty($infocontent) && $this->InfoStructures_model->Add($is_parent_id, $this->InfoContents_model->insert_id)) { $is_id = $this->InfoStructures_model->insert_id; $InfoStructures = $this->InfoStructures_model->Detail($is_id); $InfoStructures->is_id = $is_id; @@ -84,7 +84,7 @@ class Information extends CI_Controller $data = array(); $is_id = $this->input->post('is_id'); $is_parent_id = $this->input->post('is_parent_id'); - if ($is_id == $is_parent_id || empty ($is_id) || empty ($is_parent_id)) { + if ($is_id == $is_parent_id || empty($is_id) || empty($is_parent_id)) { return false; } //即将移动到文章结构信息 @@ -109,13 +109,13 @@ class Information extends CI_Controller //is_id 信息结构ID, public function copy_by_is_id($src_is_id, $dest_is_id) { - if (empty ($src_is_id) || empty ($src_is_id)) { + if (empty($src_is_id) || empty($src_is_id)) { echo 'need 2 is_id v1'; return false; } $data = array(); - if ($src_is_id == $dest_is_id || empty ($src_is_id) || empty ($dest_is_id)) { + if ($src_is_id == $dest_is_id || empty($src_is_id) || empty($dest_is_id)) { echo 'need 2 is_id v2'; return false; } @@ -190,38 +190,38 @@ class Information extends CI_Controller $item_meta_pccss = $this->InfoMetas_model->get($item->is_ic_id, 'AMP_CSS_PC'); $item_meta_pcschema = $this->InfoMetas_model->get($item->is_ic_id, 'AMP_SCHEMA'); - if (!empty ($item_meta_amp)) + if (!empty($item_meta_amp)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP', $item_meta_amp); - if (!empty ($item_meta_ampbody)) + if (!empty($item_meta_ampbody)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_BODY', $item_meta_ampbody); - if (!empty ($item_meta_ampcss)) + if (!empty($item_meta_ampcss)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_CSS', $item_meta_ampcss); - if (!empty ($item_meta_ampscript)) + if (!empty($item_meta_ampscript)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_SCRIPT', $item_meta_ampscript); - if (!empty ($item_meta_ampjson)) + if (!empty($item_meta_ampjson)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_JSON', $item_meta_ampjson); - if (!empty ($item_meta_ampstatus)) + if (!empty($item_meta_ampstatus)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_STATUS', $item_meta_ampstatus); - if (!empty ($item_meta_pcstatus)) + if (!empty($item_meta_pcstatus)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_BODY_PC_STATUS', $item_meta_pcstatus); - if (!empty ($item_meta_pcbody)) + if (!empty($item_meta_pcbody)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_BODY_PC', $item_meta_pcbody); - if (!empty ($item_meta_pccss)) + if (!empty($item_meta_pccss)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_CSS_PC', $item_meta_pccss); - if (!empty ($item_meta_pcschema)) + if (!empty($item_meta_pcschema)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_SCHEMA', $item_meta_pcschema); // gm 补充meta $item_meta_addon_css = $this->InfoMetas_model->get($item->is_ic_id, 'meta_addon_css'); - if (!empty ($item_meta_addon_css)) + if (!empty($item_meta_addon_css)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'meta_addon_css', $item_meta_addon_css); $item_meta_addon_js = $this->InfoMetas_model->get($item->is_ic_id, 'meta_addon_js'); - if (!empty ($item_meta_addon_js)) + if (!empty($item_meta_addon_js)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'meta_addon_js', $item_meta_addon_js); $item_meta_use_list_picture = $this->InfoMetas_model->get($item->is_ic_id, 'meta_use_list_picture'); - if (!empty ($item_meta_use_list_picture)) + if (!empty($item_meta_use_list_picture)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'meta_use_list_picture', $item_meta_use_list_picture); // 添加节点 @@ -242,17 +242,17 @@ class Information extends CI_Controller return true; } - //[德语->国际]复制节点结构到任意站点的节点下面。-- lmr + //[国际<-德语][在int.mycht.cn上执行]复制节点结构到任意站点的节点下面。-- lmr //is_id 信息结构ID, public function copy_by_is_id_gm($src_is_id, $dest_is_id) { - if (empty ($src_is_id) || empty ($src_is_id)) { + if (empty($src_is_id) || empty($src_is_id)) { echo 'need 2 is_id v1'; return false; } $data = array(); - if ($src_is_id == $dest_is_id || empty ($src_is_id) || empty ($dest_is_id)) { + if ($src_is_id == $dest_is_id || empty($src_is_id) || empty($dest_is_id)) { echo 'need 2 is_id v2'; return false; } @@ -329,38 +329,38 @@ class Information extends CI_Controller $item_meta_pccss = $this->InfoMetas_model->get_gm($item->is_ic_id, 'AMP_CSS_PC'); $item_meta_pcschema = $this->InfoMetas_model->get_gm($item->is_ic_id, 'AMP_SCHEMA'); - if (!empty ($item_meta_amp)) + if (!empty($item_meta_amp)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP', $item_meta_amp); - if (!empty ($item_meta_ampbody)) + if (!empty($item_meta_ampbody)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_BODY', $item_meta_ampbody); - if (!empty ($item_meta_ampcss)) + if (!empty($item_meta_ampcss)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_CSS', $item_meta_ampcss); - if (!empty ($item_meta_ampscript)) + if (!empty($item_meta_ampscript)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_SCRIPT', $item_meta_ampscript); - if (!empty ($item_meta_ampjson)) + if (!empty($item_meta_ampjson)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_JSON', $item_meta_ampjson); - if (!empty ($item_meta_ampstatus)) + if (!empty($item_meta_ampstatus)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_STATUS', $item_meta_ampstatus); - if (!empty ($item_meta_pcstatus)) + if (!empty($item_meta_pcstatus)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_BODY_PC_STATUS', $item_meta_pcstatus); - if (!empty ($item_meta_pcbody)) + if (!empty($item_meta_pcbody)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_BODY_PC', $item_meta_pcbody); - if (!empty ($item_meta_pccss)) + if (!empty($item_meta_pccss)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_CSS_PC', $item_meta_pccss); - if (!empty ($item_meta_pcschema)) + if (!empty($item_meta_pcschema)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'AMP_SCHEMA', $item_meta_pcschema); // gm 补充meta $item_meta_addon_css = $this->InfoMetas_model->get_gm($item->is_ic_id, 'meta_addon_css'); - if (!empty ($item_meta_addon_css)) + if (!empty($item_meta_addon_css)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'meta_addon_css', $item_meta_addon_css); $item_meta_addon_js = $this->InfoMetas_model->get_gm($item->is_ic_id, 'meta_addon_js'); - if (!empty ($item_meta_addon_js)) + if (!empty($item_meta_addon_js)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'meta_addon_js', $item_meta_addon_js); $item_meta_use_list_picture = $this->InfoMetas_model->get_gm($item->is_ic_id, 'meta_use_list_picture'); - if (!empty ($item_meta_use_list_picture)) + if (!empty($item_meta_use_list_picture)) $this->InfoMetas_model->Add($this->InfoContents_model->insert_id, 'meta_use_list_picture', $item_meta_use_list_picture); // 添加节点 @@ -404,7 +404,7 @@ class Information extends CI_Controller //} $this->Logs_model->delete($is_id, $info_detail->ic_content); - if (!empty ($info_detail->ic_summary)) { + if (!empty($info_detail->ic_summary)) { $this->Logs_model->backup_summary($is_id, $info_detail->ic_summary); } $this->InfoStructures_model->Delete($Structure->is_id); @@ -452,7 +452,7 @@ class Information extends CI_Controller //检查该信息是否已收录 $data['embody'] = 1; - if (isset ($data['information']->ic_id)) { + if (isset($data['information']->ic_id)) { $embody = $this->InfoMetas_model->get($data['information']->ic_id, 'meta_embody'); if ($embody && $embody != '1') { $data['embody'] = 0; @@ -662,13 +662,13 @@ class Information extends CI_Controller //AMP更新和生成 beign $auto_update_amp = $this->input->get_post('auto_update_amp'); - if (!empty ($auto_update_amp) && $auto_update_amp == 'true' && $this->input->post('ic_status') == 1) { + if (!empty($auto_update_amp) && $auto_update_amp == 'true' && $this->input->post('ic_status') == 1) { $amp_result = $this->amplib->auto_create($information->ic_id); - if (!empty ($amp_result)) { + if (!empty($amp_result)) { $amp_result = json_decode($amp_result); if ($amp_result->result == 'ok') { $amp_save_result = $this->amplib->edit_save($information->ic_id, $amp_result->data->amp, '1'); - if (!empty ($amp_save_result)) { + if (!empty($amp_save_result)) { $amp_save_result = json_decode($amp_save_result); if ($amp_save_result->name == 'no') { echo json_encode(array('name' => 'no', 'value' => 'AMP转换语法错误,请重新进入AMP编辑器检查')); @@ -678,7 +678,7 @@ class Information extends CI_Controller } } } - + //如果URL有修改也删除静态文件 if ($this->input->post('ic_url') != $information->ic_url) { $this->update_cache($information->ic_url, true); @@ -694,9 +694,9 @@ class Information extends CI_Controller $ic_url = $this->input->post('ic_url'); $auto_update_cache = $this->input->get_post('auto_update_cache_checkbox'); - if (strcasecmp($site_code, "gm") == 0 && !empty ($auto_update_cache)) { + if (strcasecmp($site_code, "gm") == 0 && !empty($auto_update_cache)) { $update_info_log = $this->update_cache($ic_url, true); - } else if (strcasecmp($site_code, "ch") == 0 && !empty ($auto_update_cache)) { + } else if (strcasecmp($site_code, "ch") == 0 && !empty($auto_update_cache)) { //读取模板生成PC和移动优先文件 $information_new = $this->Information_model->Detail($this->input->post('is_id')); //$this->benchmark->mark('000'); @@ -705,36 +705,36 @@ class Information extends CI_Controller $this->make_www_cache('mobile', $information_new, $recommand_information); $this->make_www_cache('pc', $information_new, $recommand_information); //echo ' |000~111: '.$this->benchmark->elapsed_time('000', '111'); - } else if (strcasecmp($site_code, "ah") == 0 && !empty ($auto_update_cache)) { + } else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { //读取模板生成PC和移动优先文件 $recommand_information = $this->recommand_information($information); $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_ah('mobile', $information_new, $recommand_information); $this->make_www_cache_ah('pc', $information_new, $recommand_information); - } else if (strcasecmp($site_code, "gh") == 0 && !empty ($auto_update_cache)) { + } else if (strcasecmp($site_code, "gh") == 0 && !empty($auto_update_cache)) { $recommand_information = $this->recommand_information($information); $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_gh('mobile', $information_new, $recommand_information); $this->make_www_cache_gh('pc', $information_new, $recommand_information); - } else if (strcasecmp($site_code, "chinatravel") == 0 && !empty ($auto_update_cache)) { + } else if (strcasecmp($site_code, "chinatravel") == 0 && !empty($auto_update_cache)) { //chinatravel读取模板生成PC和移动优先文件 $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_ct($information_new); // $this->make_www_cache_ct('pc', $information_new); - } else if (strcasecmp($site_code, "shanghai") == 0 && !empty ($auto_update_cache)) { + } else if (strcasecmp($site_code, "shanghai") == 0 && !empty($auto_update_cache)) { $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_sh($information_new); - } else if (strcasecmp($site_code, "cht") == 0 && !empty ($auto_update_cache)) { + } 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)) { + } else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { //$update_info_log = $this->update_cache($ic_url); } else if (strcasecmp($site_code, "cht") != 0 && strcasecmp($site_code, "gm") != 0 && strcasecmp($site_code, "ah") != 0) { //非cht站点并且非GM并且非AH $update_info_log = $this->update_cache($ic_url); - } else if (strcasecmp($site_code, "ct") == 0 && !empty ($auto_update_cache)) { + } else if (strcasecmp($site_code, "ct") == 0 && !empty($auto_update_cache)) { $update_info_log = $this->update_cache($ic_url); } - if (empty ($update_info_log) || count($update_info_log) == 0 || !isset ($update_info_log[0]['url'])) { + if (empty($update_info_log) || count($update_info_log) == 0 || !isset($update_info_log[0]['url'])) { $update_info_log = 'not found update info log'; } @@ -762,7 +762,7 @@ class Information extends CI_Controller '202000017' => 'http://www.chinahighlights.com/author/christy-campbell/', ); $key = $this->input->post('ic_author'); - if (isset ($author_pages[$key])) { + if (isset($author_pages[$key])) { $this->update_cache($author_pages[$key]); } } @@ -798,7 +798,7 @@ class Information extends CI_Controller public function update_www_cache($ic_id) { $information = $this->Information_model->detail_by_ic_id($ic_id); - if (empty ($information)) { + if (empty($information)) { echo json_encode(array('name' => 'no', 'data' => '找不到这个页面')); return false; } @@ -832,10 +832,10 @@ class Information extends CI_Controller //静态文件操作 public function html_file_helper($active = 'find', $ic_url = false) { - if (empty ($ic_url)) { + if (empty($ic_url)) { $ic_url = $this->input->get_post('ic_url'); } - if (empty ($ic_url)) { + if (empty($ic_url)) { return false; } $html_file = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $ic_url; @@ -920,7 +920,7 @@ class Information extends CI_Controller // 解析结果:; Shanghai,Beijing $feedback_array = []; preg_match_all('^^', $information->ic_content, $feedback_array); - if (!empty ($feedback_array)) { + if (!empty($feedback_array)) { foreach ($feedback_array[0] as $index => $tag_name) { $city_name_string = $feedback_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -945,7 +945,7 @@ class Information extends CI_Controller // 解析结果:; Bangkok $feedback30_array = []; preg_match_all('^^', $information->ic_content, $feedback30_array); - if (!empty ($feedback30_array)) { + if (!empty($feedback30_array)) { foreach ($feedback30_array[0] as $index => $tag_name) { $city_name = $feedback30_array[1][$index]; $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name); @@ -965,7 +965,7 @@ class Information extends CI_Controller // 集合页面反馈标签 $feedback_city_array = []; preg_match_all('^^', $information->ic_content, $feedback_city_array); - if (!empty ($feedback_city_array)) { + if (!empty($feedback_city_array)) { foreach ($feedback_city_array[0] as $index => $tag_name) { $city_name_string = $feedback_city_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -1019,7 +1019,7 @@ class Information extends CI_Controller $data_TrainCity = array(); $data_TrainCity["from"] = ""; $data_TrainCity["to"] = ""; - if (!empty ($meta_train_city)) { + if (!empty($meta_train_city)) { if (strpos($meta_train_city, '|') !== false) { $arrTrainCity = explode('|', $meta_train_city); $data_TrainCity["from"] = $arrTrainCity[0]; @@ -1041,11 +1041,11 @@ class Information extends CI_Controller $data_H1['author'] = ''; //获取作者信息 $data_H1['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate'); $author = $this->Operator_model->get_author_nikename($information->ic_author); - if (!empty ($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_web)) { $data_H1['author'] = $author_web->a_name; } } @@ -1054,7 +1054,7 @@ class Information extends CI_Controller $parsed_photo = $information->ic_photo; $parsed_photo_url = parse_url($information->ic_photo); if ( - (!isset ($parsed_photo_url['host']) || !isset ($parsed_photo_url['scheme'])) && isset ($parsed_photo_url['path']) + (!isset($parsed_photo_url['host']) || !isset($parsed_photo_url['scheme'])) && isset($parsed_photo_url['path']) ) { $parsed_photo = 'https://images.chinahighlights.com' . $parsed_photo_url['path']; } @@ -1066,9 +1066,9 @@ class Information extends CI_Controller $data_H1['ic_datetime'] = $information->ic_datetime; $template_H1 = $this->load->view($template_path . '-h1', $data_H1, true); $template = str_replace('', $template_H1, $template); - + //非产品页面 - if (empty ($meta_product_code)) { + if (empty($meta_product_code)) { $template = str_replace('?product_code=', '', $template); $article_structured_data_content = $this->load->view( @@ -1109,14 +1109,14 @@ class Information extends CI_Controller '', $template ); - if (!empty ($meta_product_code)) { + if (!empty($meta_product_code)) { //准备需要的数据 $dataTrippest = []; $dataTrippest["ic_title"] = $information->ic_title; //附加选项 $t_Type = get_meta($information->ic_id, 'meta_trippest_type'); - if (isset ($t_Type)) { + if (isset($t_Type)) { $dataTrippest["t_Type"] = $t_Type; } else { $dataTrippest["t_Type"] = "general"; @@ -1140,7 +1140,7 @@ class Information extends CI_Controller // 132003 西安目的地 // 132004 桂林目的地 // 132005 成都目的地 - if (isset($dataTrippest['PagDetail']) && $dataTrippest['PagDetail']!=null ) { + if (isset($dataTrippest['PagDetail']) && $dataTrippest['PagDetail'] != null) { $PAG_SourceType = $dataTrippest['PagDetail']->PAG_SourceType; switch ($PAG_SourceType) { case '132001': @@ -1168,7 +1168,7 @@ class Information extends CI_Controller $dataTrippest['PAG_SourceType'] = ""; break; } - + //每周发团 $PAG_Scheme = $dataTrippest['PagDetail']->PAG_Scheme; @@ -1183,7 +1183,7 @@ class Information extends CI_Controller // $price = $this->trippest_model->get_price("BJALC-1",2); $price = $this->trippest_model->get_price($dataTrippest['PagDetail']->PAG_Code, 2); $showPrice = ""; - if (!empty ($price)) { + if (!empty($price)) { $PKP_AdultNetPrice = $price->PKP_AdultNetPrice; $PKP_AdultSpecialPrice = $price->PKP_AdultSpecialPrice; if ($PKP_AdultSpecialPrice > 0) { @@ -1211,10 +1211,10 @@ class Information extends CI_Controller $template = str_replace('', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), true), $template); $meta_show_advertise = get_meta($information->ic_id, 'meta_show_advertise'); // //广告,改叫tips,防止被插件屏蔽 - if (!empty ($template_recommand['Tips Right TOP']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { + if (!empty($template_recommand['Tips Right TOP']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { $template = str_replace('', "
", $template); } - if (!empty ($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { + if (!empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } @@ -1225,7 +1225,7 @@ class Information extends CI_Controller $tips_right_a = []; $tips_right_b = []; $tips_right_c = []; - + for ($i = 1; $i <= 12; $i++) { $key = 'List Tips Right A_' . $i; if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) { @@ -1254,8 +1254,8 @@ class Information extends CI_Controller ), true ); - if(($meta_show_advertise == 'yes' || empty($meta_show_advertise))){ - $template = str_replace('', $tips_right_list_content, $template); + if (($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { + $template = str_replace('', $tips_right_list_content, $template); } } @@ -1269,7 +1269,7 @@ class Information extends CI_Controller } // 未勾选In Article 广告时,加入标签 ,让 ezoic 识别出该页面不展示广告。 - if (empty ($meta_google_ad_article) || !$meta_google_ad_article) { + if (empty($meta_google_ad_article) || !$meta_google_ad_article) { $template = str_replace( '', '', @@ -1286,7 +1286,7 @@ class Information extends CI_Controller //替换内容中广告 $temp_array = array(); preg_match_all('^^', $information->ic_content, $temp_array); - if (!empty ($temp_array[1])) { + if (!empty($temp_array[1])) { foreach ($temp_array[1] as $key => $item) { $tips_detail = $this->recommends_and_tips_model->tips_detail($item); if ($tips_detail) { @@ -1305,7 +1305,7 @@ class Information extends CI_Controller //顶部视频 $meta_news_video = get_meta($information->ic_id, 'meta_news_video'); $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); - if (!empty ($meta_news_video) && !empty ($meta_video_picture)) { + if (!empty($meta_news_video) && !empty($meta_video_picture)) { $template = str_replace('', '
', $template); } @@ -1327,7 +1327,7 @@ class Information extends CI_Controller } //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); - if (!empty ($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 { @@ -1337,12 +1337,12 @@ class Information extends CI_Controller } //额外js $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); - if (!empty ($meta_addon_js)) { + if (!empty($meta_addon_js)) { $template = str_replace('', '', $template); } - + $meta_index_set = get_meta($information->ic_id, 'meta_index_set'); - if (!empty ($meta_index_set)) { + if (!empty($meta_index_set)) { $template = str_replace('', '', $template); } //设置内容图片缓加载 @@ -1359,12 +1359,12 @@ class Information extends CI_Controller //} //社媒分享图片 $full_ic_photo = ''; - if (!empty ($information->ic_photo)) { + if (!empty($information->ic_photo)) { $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; } else { $full_ic_photo = get_meta($information->ic_id, 'meta_addon_picture_mobile'); } - if (!empty ($full_ic_photo)) { + if (!empty($full_ic_photo)) { $template = str_replace('', '', $template); } //设置图片尺寸 @@ -1440,7 +1440,7 @@ class Information extends CI_Controller { $feedback30_array = []; preg_match_all('^^', '
', $feedback30_array); - if (!empty ($feedback30_array)) { + if (!empty($feedback30_array)) { foreach ($feedback30_array[0] as $index => $tag_name) { $city_name = $feedback30_array[1][$index]; $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name, 2); @@ -1465,7 +1465,7 @@ class Information extends CI_Controller { $feedback_city_array = []; preg_match_all('^^', '
', $feedback_city_array); - if (!empty ($feedback_city_array)) { + if (!empty($feedback_city_array)) { foreach ($feedback_city_array[0] as $index => $tag_name) { $city_name_string = $feedback_city_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -1515,13 +1515,13 @@ class Information extends CI_Controller { $price_item_array = $this->price_pregmatch($price_content); $price_tag_list = []; - if (!empty ($price_item_array)) { + if (!empty($price_item_array)) { foreach ($price_item_array as $price_item) { - $price_date = !empty ($price_item->price_date) ? $price_item->price_date : date('Y-m-d', time() + 86400 * 7); //当前时间7天后的价格 + $price_date = !empty($price_item->price_date) ? $price_item->price_date : date('Y-m-d', time() + 86400 * 7); //当前时间7天后的价格 $price_number = ''; //优先读取新的价格体系 $price = $this->PrimeLinePrice_model->search($price_item->cli_no, 1, $price_item->cli_grade, $price_item->person_size, $price_date, $dept_sn); - if (!empty ($price)) { + if (!empty($price)) { switch (strtoupper($price_item->price_people)) { case 'A': $price_number = $price->PLP_AdultUnitPrice; @@ -1543,7 +1543,7 @@ class Information extends CI_Controller } } else { $price = $this->Price_model->search($price_item->cli_no, 1, $price_item->cli_grade, false, $price_date); - if (!empty ($price)) { + if (!empty($price)) { switch (strtoupper($price_item->price_people)) { case 'A': @@ -1599,7 +1599,7 @@ class Information extends CI_Controller $site_money = $this->currency->calc_show_price($price_number); //把金额格式化为带有逗号(,)方便阅读,如 12,345 $price_number = is_numeric($price_number) ? number_format($site_money) : $price_number; - if (!empty ($price_number)) { + if (!empty($price_number)) { $price_tag = [ 'placeholder' => $price_item->placeholder, 'price_number' => $price_number, @@ -1624,11 +1624,11 @@ class Information extends CI_Controller $placeholder = $item; $item = str_replace('#', '', $item); $price_array = explode(',', $item); - $cli_no = !empty ($price_array[0]) ? $price_array[0] : false; //线路代号 - if (empty ($cli_no)) { + $cli_no = !empty($price_array[0]) ? $price_array[0] : false; //线路代号 + if (empty($cli_no)) { continue; //没有设置线路代号则进入下一条 } - $cli_grade = !empty ($price_array[1]) ? $price_array[1] : false; //标准7001、豪华7002、经济7003 + $cli_grade = !empty($price_array[1]) ? $price_array[1] : false; //标准7001、豪华7002、经济7003 switch (strtoupper($cli_grade)) { case 'ST': $cli_grade = '7001'; @@ -1642,7 +1642,7 @@ class Information extends CI_Controller default: $cli_grade = '7001'; } - $person_size = (!empty ($price_array[2]) && is_numeric($price_array[2])) ? $price_array[2] : 2; //人等1,2-5,6-9,10,默认2人等 + $person_size = (!empty($price_array[2]) && is_numeric($price_array[2])) ? $price_array[2] : 2; //人等1,2-5,6-9,10,默认2人等 //为了兼容以前的人等方式,把算数人等转换为单数 25=>2 switch ($person_size) { case '25': @@ -1652,8 +1652,8 @@ class Information extends CI_Controller $person_size = '6'; break; } - $price_date = !empty ($price_array[3]) ? $price_array[3] : false; //价格时间 - $price_people = !empty ($price_array[4]) ? $price_array[4] : 'A'; //A成人、C小孩、B婴儿、R单间房差 + $price_date = !empty($price_array[3]) ? $price_array[3] : false; //价格时间 + $price_people = !empty($price_array[4]) ? $price_array[4] : 'A'; //A成人、C小孩、B婴儿、R单间房差 $result[] = (object) array('placeholder' => $placeholder, 'cli_no' => $cli_no, 'cli_grade' => $cli_grade, 'person_size' => $person_size, 'price_date' => $price_date, 'price_people' => $price_people); } return $result; @@ -1726,7 +1726,7 @@ class Information extends CI_Controller } $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); - $ads_by_google = !empty (get_meta($information->ic_id, 'meta_google_ad_article')); + $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); //信息所属分类,获取信息顶级节点内容 @@ -1734,11 +1734,11 @@ class Information extends CI_Controller $data_H1['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate'); $author = $this->Operator_model->get_author_nikename($information->ic_author); - if (!empty ($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_web)) { $data_H1['author'] = $author_web->a_name; } } @@ -1749,7 +1749,7 @@ class Information extends CI_Controller $template_H1 = $this->load->view($template_path . '-h1', $data_H1, true); $template = str_replace('', $template_H1, $template); - if (empty ($meta_product_code)) { + if (empty($meta_product_code)) { $addthis_widget = $this->load->view($template_path . '-add-this', false, true); $template = str_replace('', $addthis_widget, $template); } @@ -1761,13 +1761,13 @@ class Information extends CI_Controller ); $template = str_replace('', $article_structured_data_content, $template); - if (!empty ($meta_product_code)) { + if (!empty($meta_product_code)) { // $product_code_input = ""; $template = str_replace('', $product_code_input, $template); } - if (empty ($meta_product_code)) { + if (empty($meta_product_code)) { $template = str_replace('?product_code=', '', $template); } else { $template = str_replace('?product_code=', '?product_code=' . $meta_product_code, $template); @@ -1777,10 +1777,10 @@ class Information extends CI_Controller $template_recommand = $recommand_information; //$this->recommand_information($information); 从外面传进来,pc和移动只需要查一次,减少数据库负担 $template = str_replace('', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), true), $template); // //广告,改叫tips,防止被插件屏蔽 - if (!empty ($template_recommand['Tips Right TOP'])) { + if (!empty($template_recommand['Tips Right TOP'])) { // $template = str_replace('', "
", $template); } - if (!empty ($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { + if (!empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } // 右侧列表广告 @@ -1815,8 +1815,8 @@ class Information extends CI_Controller ), true ); - if(($meta_show_advertise == 'yes' || empty($meta_show_advertise))){ - $template = str_replace('', $tips_right_list_content, $template); + if (($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { + $template = str_replace('', $tips_right_list_content, $template); } //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { @@ -1830,7 +1830,7 @@ class Information extends CI_Controller //替换内容中广告 $temp_array = array(); preg_match_all('^^', $information->ic_content, $temp_array); - if (!empty ($temp_array[1])) { + if (!empty($temp_array[1])) { foreach ($temp_array[1] as $key => $item) { $tips_detail = $this->recommends_and_tips_model->tips_detail($item); if ($tips_detail) { @@ -1841,7 +1841,7 @@ class Information extends CI_Controller // 未勾选In Article 广告时,加入标签 ,让 ezoic 识别出该页面不展示广告。 $meta_google_ad_article = get_meta($information->ic_id, 'meta_google_ad_article'); - if (empty ($meta_google_ad_article) || !$meta_google_ad_article) { + if (empty($meta_google_ad_article) || !$meta_google_ad_article) { $template = str_replace( '', '', @@ -1868,7 +1868,7 @@ class Information extends CI_Controller ); $information->ic_content = str_replace('', $why_us_covid_list_mobile, $information->ic_content); - if (empty ($meta_product_code)) { + if (empty($meta_product_code)) { $info_page_form_content = $this->load->view($template_path . '-info-page-form', false, true); $information->ic_content = str_replace('', $info_page_form_content, $information->ic_content); } else { @@ -1896,7 +1896,7 @@ class Information extends CI_Controller // 解析结果:; Bangkok $feedback30_array = []; preg_match_all('^^', $information->ic_content, $feedback30_array); - if (!empty ($feedback30_array)) { + if (!empty($feedback30_array)) { foreach ($feedback30_array[0] as $index => $tag_name) { $city_name = $feedback30_array[1][$index]; $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name); @@ -1916,7 +1916,7 @@ class Information extends CI_Controller // 集合页面反馈标签 $feedback_city_array = []; preg_match_all('^^', $information->ic_content, $feedback_city_array); - if (!empty ($feedback_city_array)) { + if (!empty($feedback_city_array)) { foreach ($feedback_city_array[0] as $index => $tag_name) { $city_name_string = $feedback_city_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -1945,7 +1945,7 @@ class Information extends CI_Controller // 解析结果:; Siem Reap,Bangkok $feedback_array = []; preg_match_all('^^', $information->ic_content, $feedback_array); - if (!empty ($feedback_array)) { + if (!empty($feedback_array)) { foreach ($feedback_array[0] as $index => $tag_name) { $city_name_string = $feedback_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -1973,7 +1973,7 @@ class Information extends CI_Controller $template = str_replace('', '', $template); //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); - if (!empty ($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 { @@ -1983,12 +1983,12 @@ class Information extends CI_Controller } //额外js $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); - if (!empty ($meta_addon_js)) { + if (!empty($meta_addon_js)) { $template = str_replace('', '', $template); } - + $meta_index_set = get_meta($information->ic_id, 'meta_index_set'); - if (!empty ($meta_index_set)) { + if (!empty($meta_index_set)) { $template = str_replace('', '', $template); } //设置内容图片缓加载 @@ -1997,12 +1997,12 @@ class Information extends CI_Controller //社媒分享图片 $full_ic_photo = ''; - if (!empty ($information->ic_photo)) { + if (!empty($information->ic_photo)) { $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; } else { $full_ic_photo = get_meta($information->ic_id, 'meta_addon_picture_mobile'); } - if (!empty ($full_ic_photo)) { + if (!empty($full_ic_photo)) { $template = str_replace('', '', $template); } //设置图片尺寸 @@ -2065,7 +2065,7 @@ class Information extends CI_Controller //顶部视频 $data['meta_news_video'] = get_meta($information->ic_id, 'meta_news_video'); $data['meta_video_picture'] = get_meta($information->ic_id, 'meta_video_picture'); - if (empty ($data['meta_news_video']) && empty ($data['meta_video_picture'])) { + if (empty($data['meta_news_video']) && empty($data['meta_video_picture'])) { //没有顶部视频时候才读取全屏大图 //顶部全屏大图 if ($device == 'mobile') { //移动端读取移动大图 @@ -2089,16 +2089,16 @@ class Information extends CI_Controller ]; $breadcrumb_data = $this->Information_model->get_breadcrumb_data($information->is_id, $information->is_path, $group_map); - $ads_by_google = !empty (get_meta($information->ic_id, 'meta_google_ad_article')); + $ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article')); $data['meta_news_createdate'] = get_meta($information->ic_id, 'meta_news_createdate'); $data['ads_by_google'] = $ads_by_google; $data['author'] = ''; //获取作者信息 $author = $this->Operator_model->get_author_nikename($information->ic_author); - if (!empty ($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_web)) { $data['author'] = $author_web->a_name; } } @@ -2128,14 +2128,14 @@ class Information extends CI_Controller $template_recommand = $recommand_information; $template = str_replace('', $this->load->view($recommand_template, array('recommands' => $template_recommand), true), $template); //广告,改叫tips,防止被插件屏蔽 - if (!empty ($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { + if (!empty($template_recommand['Tips Right']) && ($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } // 右侧列表广告 $tips_right_a = []; $tips_right_b = []; $tips_right_c = []; - + for ($i = 1; $i <= 12; $i++) { $key = 'List Tips Right A_' . $i; if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) { @@ -2165,10 +2165,10 @@ class Information extends CI_Controller true ); - if(($meta_show_advertise == 'yes' || empty($meta_show_advertise))){ + if (($meta_show_advertise == 'yes' || empty($meta_show_advertise))) { $template = str_replace('', $tips_right_list_content, $template); } - + //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), true), $information->ic_content); @@ -2181,7 +2181,7 @@ class Information extends CI_Controller //替换内容中广告 $temp_array = array(); preg_match_all('^^', $information->ic_content, $temp_array); - if (!empty ($temp_array[1])) { + if (!empty($temp_array[1])) { foreach ($temp_array[1] as $key => $item) { $tips_detail = $this->recommends_and_tips_model->tips_detail($item); if ($tips_detail) { @@ -2192,7 +2192,7 @@ class Information extends CI_Controller $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); // 非产品页面 - if (empty ($meta_product_code)) { + if (empty($meta_product_code)) { $addthis_widget = $this->load->view($template_path . '-add-this', false, true); $template = str_replace('', $addthis_widget, $template); $template = str_replace('?product_code=', '', $template); @@ -2274,16 +2274,17 @@ class Information extends CI_Controller true ); $information->ic_content = str_replace( - '', - $new_year_countdown_form_content, - $information->ic_content); + '', + $new_year_countdown_form_content, + $information->ic_content + ); // 动态加载反馈标签,第一个城市不足八条,使用第二城市数据。 // HTLM:
// 解析结果:; Siem Reap,Bangkok $feedback_array = []; preg_match_all('^^', $information->ic_content, $feedback_array); - if (!empty ($feedback_array)) { + if (!empty($feedback_array)) { foreach ($feedback_array[0] as $index => $tag_name) { $city_name_string = $feedback_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -2308,7 +2309,7 @@ class Information extends CI_Controller // 解析结果:; Bangkok $feedback30_array = []; preg_match_all('^^', $information->ic_content, $feedback30_array); - if (!empty ($feedback30_array)) { + if (!empty($feedback30_array)) { foreach ($feedback30_array[0] as $index => $tag_name) { $city_name = $feedback30_array[1][$index]; $feedback_list = $this->Feedback_model->get_feedback_by_city_name($city_name); @@ -2328,7 +2329,7 @@ class Information extends CI_Controller // 集合页面反馈标签 $feedback_city_array = []; preg_match_all('^^', $information->ic_content, $feedback_city_array); - if (!empty ($feedback_city_array)) { + if (!empty($feedback_city_array)) { foreach ($feedback_city_array[0] as $index => $tag_name) { $city_name_string = $feedback_city_array[1][$index]; $city_name_list = explode(',', $city_name_string); @@ -2361,19 +2362,19 @@ class Information extends CI_Controller $template = str_replace('', '', $template); //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); - if (!empty ($meta_addon_css)) { + if (!empty($meta_addon_css)) { //内联方式 $meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css)); $template = str_replace('', '', $template); } //额外js $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); - if (!empty ($meta_addon_js)) { + if (!empty($meta_addon_js)) { $template = str_replace('', '', $template); } - + $meta_index_set = get_meta($information->ic_id, 'meta_index_set'); - if (!empty ($meta_index_set)) { + if (!empty($meta_index_set)) { $template = str_replace('', '', $template); } //设置内容图片缓加载 @@ -2387,12 +2388,12 @@ class Information extends CI_Controller //社媒分享图片 $full_ic_photo = ''; - if (!empty ($information->ic_photo)) { + if (!empty($information->ic_photo)) { $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; } else { $full_ic_photo = get_meta($information->ic_id, 'meta_addon_picture_mobile'); } - if (!empty ($full_ic_photo)) { + if (!empty($full_ic_photo)) { $template = str_replace('', '', $template); } @@ -2452,8 +2453,8 @@ class Information extends CI_Controller //作者字符串,信息页或者城市天气页加载 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'; + 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 = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
'; } @@ -2465,12 +2466,12 @@ class Information extends CI_Controller $data_TrainCity = array(); $data_TrainCity["from"] = ""; $data_TrainCity["to"] = ""; - if (!empty ($meta_train_city)) { + if (!empty($meta_train_city)) { if (strpos($meta_train_city, '|') !== false) { $arrTrainCity = explode('|', $meta_train_city); $data_TrainCity["from"] = $arrTrainCity[0]; $data_TrainCity["to"] = $arrTrainCity[1]; - + } } $template_TrainDetailSearch = $this->load->view($template_path . '-train-detail', $data_TrainCity, true); @@ -2503,7 +2504,7 @@ class Information extends CI_Controller /**替换火车标签 */ if (strpos($ic_content, '') !== false) { - $ic_content = str_replace('', $template_TrainDetailSearch, $ic_content); + $ic_content = str_replace('', $template_TrainDetailSearch, $ic_content); } /**替换zodiac标签 */ @@ -2526,7 +2527,7 @@ class Information extends CI_Controller $data["FloatIcon"] = ""; //浮动图标替代addthis $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"); - if (empty (get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) { + if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) { //$data["addthis_widget"] = $this->load->view($template_path . '-add-this', false, true); //社媒代码addthis $data["FloatIcon"] = "
Create My Trip
"; } else { @@ -2538,7 +2539,7 @@ class Information extends CI_Controller $data["TOPVIDEO"] = ""; $meta_news_video = get_meta($information->ic_id, 'meta_news_video'); $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); - if (!empty ($meta_news_video) && !empty ($meta_video_picture)) { + if (!empty($meta_news_video) && !empty($meta_video_picture)) { $data["TOPVIDEO"] = ''; } @@ -2552,7 +2553,7 @@ class Information extends CI_Controller //额外样式 $data["ADDONCSS"] = ""; $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); - if (!empty ($meta_addon_css)) { + if (!empty($meta_addon_css)) { //引用方式 //$data["ADDONCSS"]= ''; //内联方式 @@ -2561,7 +2562,7 @@ class Information extends CI_Controller } //社媒分享图片 $data["OGIMAGE"] = ""; - if (!empty ($information->ic_photo)) { + if (!empty($information->ic_photo)) { if (strpos($information->ic_photo, "chinatravel.com") != false) { $full_ic_photo = $information->ic_photo; } else { @@ -2573,7 +2574,7 @@ class Information extends CI_Controller //结构化标签 $data["ConstructionCode"] = ""; $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code'); - if (!empty ($meta_construction_code)) { + if (!empty($meta_construction_code)) { $data["ConstructionCode"] = $meta_construction_code; } @@ -2596,7 +2597,7 @@ class Information extends CI_Controller //额外js $data["ADDONJS"] = ""; $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); - if (!empty ($meta_addon_js)) { + if (!empty($meta_addon_js)) { $addonJs .= ''; } //价格js @@ -2637,11 +2638,11 @@ class Information extends CI_Controller $productCode = ""; if ($meta_ct_page_type == "daytripdetail") { //一日游 - if (!empty ($meta_ct_page_type)) { + if (!empty($meta_ct_page_type)) { $productType = $meta_ct_page_type; } $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); - if (!empty ($meta_ct_page_value)) { + if (!empty($meta_ct_page_value)) { $productCode = $meta_ct_page_value; } $addonJs .= ''; @@ -2652,7 +2653,7 @@ class Information extends CI_Controller //线路 $productType = $meta_ct_page_type; $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); - if (!empty ($meta_ct_page_value)) { + if (!empty($meta_ct_page_value)) { $productCode = $meta_ct_page_value; } @@ -2672,7 +2673,7 @@ class Information extends CI_Controller 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)) { + if (!empty($meta_ct_page_value)) { $productCode = $meta_ct_page_value; } $dataCruise["shipname"] = $productCode; @@ -2707,17 +2708,17 @@ class Information extends CI_Controller if ($device == 'mobile') { //移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); $bannerImg = '' . $information->ic_title . ''; - if (!empty ($meta_addon_picture_url) && !empty ($meta_addon_picture_text)) { + if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) { $ImgText = ''; - } else if (!empty ($meta_addon_picture_text)) { + } else if (!empty($meta_addon_picture_text)) { $ImgText = ''; } } else { $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $bannerImg = '' . $information->ic_title . ''; - if (!empty ($meta_addon_picture_url) && !empty ($meta_addon_picture_text)) { + if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) { $ImgText = ''; - } else if (!empty ($meta_addon_picture_text)) { + } else if (!empty($meta_addon_picture_text)) { $ImgText = ''; } } @@ -2744,8 +2745,8 @@ class Information extends CI_Controller } } - if (!empty ($meta_addon_picture)) { - if (!empty ($meta_addon_picture_url)) { + if (!empty($meta_addon_picture)) { + if (!empty($meta_addon_picture_url)) { $data["TOPBANNER"] = ''; } else { $data["TOPBANNER"] = ''; @@ -2833,8 +2834,8 @@ class Information extends CI_Controller //作者字符串,信息页或者城市天气页加载 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'; + 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 = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
'; } @@ -2859,7 +2860,7 @@ class Information extends CI_Controller $data["FloatIcon"] = ""; //浮动图标替代addthis $arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains"); - if (empty (get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) { + if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) { $data["FloatIcon"] = "
Create My Trip
"; } else { $data["ISPRODUCT"] = "yes"; @@ -2869,7 +2870,7 @@ class Information extends CI_Controller $data["TOPVIDEO"] = ""; $meta_news_video = get_meta($information->ic_id, 'meta_news_video'); $meta_video_picture = get_meta($information->ic_id, 'meta_video_picture'); - if (!empty ($meta_news_video) && !empty ($meta_video_picture)) { + if (!empty($meta_news_video) && !empty($meta_video_picture)) { $data["TOPVIDEO"] = ''; } @@ -2883,7 +2884,7 @@ class Information extends CI_Controller //额外样式 $data["ADDONCSS"] = ""; $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); - if (!empty ($meta_addon_css)) { + if (!empty($meta_addon_css)) { //引用方式 //$data["ADDONCSS"]= ''; //内联方式 @@ -2892,7 +2893,7 @@ class Information extends CI_Controller } //社媒分享图片 $data["OGIMAGE"] = ""; - if (!empty ($information->ic_photo)) { + if (!empty($information->ic_photo)) { if (strpos($information->ic_photo, "shanghaihighlights.com") != false) { $full_ic_photo = $information->ic_photo; } else { @@ -2904,7 +2905,7 @@ class Information extends CI_Controller //结构化标签 $data["ConstructionCode"] = ""; $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code'); - if (!empty ($meta_construction_code)) { + if (!empty($meta_construction_code)) { $data["ConstructionCode"] = $meta_construction_code; } @@ -2927,7 +2928,7 @@ class Information extends CI_Controller //额外js $data["ADDONJS"] = ""; $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); - if (!empty ($meta_addon_js)) { + if (!empty($meta_addon_js)) { $addonJs .= ''; } //价格js @@ -2968,11 +2969,11 @@ class Information extends CI_Controller $productCode = ""; if ($meta_ct_page_type == "daytripdetail") { //一日游 - if (!empty ($meta_ct_page_type)) { + if (!empty($meta_ct_page_type)) { $productType = $meta_ct_page_type; } $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); - if (!empty ($meta_ct_page_value)) { + if (!empty($meta_ct_page_value)) { $productCode = $meta_ct_page_value; } $addonJs .= ''; @@ -2989,7 +2990,7 @@ class Information extends CI_Controller //线路 $productType = $meta_ct_page_type; $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); - if (!empty ($meta_ct_page_value)) { + if (!empty($meta_ct_page_value)) { $productCode = $meta_ct_page_value; } @@ -3043,17 +3044,17 @@ class Information extends CI_Controller if ($device == 'mobile') { //移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); $bannerImg = '' . $information->ic_title . ''; - if (!empty ($meta_addon_picture_url) && !empty ($meta_addon_picture_text)) { + if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) { $ImgText = ''; - } else if (!empty ($meta_addon_picture_text)) { + } else if (!empty($meta_addon_picture_text)) { $ImgText = ''; } } else { $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $bannerImg = '' . $information->ic_title . ''; - if (!empty ($meta_addon_picture_url) && !empty ($meta_addon_picture_text)) { + if (!empty($meta_addon_picture_url) && !empty($meta_addon_picture_text)) { $ImgText = ''; - } else if (!empty ($meta_addon_picture_text)) { + } else if (!empty($meta_addon_picture_text)) { $ImgText = ''; } } @@ -3080,8 +3081,8 @@ class Information extends CI_Controller } } - if (!empty ($meta_addon_picture)) { - if (!empty ($meta_addon_picture_url)) { + if (!empty($meta_addon_picture)) { + if (!empty($meta_addon_picture_url)) { $data["TOPBANNER"] = ''; } else { $data["TOPBANNER"] = ''; @@ -3130,9 +3131,9 @@ class Information extends CI_Controller //通过内容找到第一张图片 public function set_photo_content($ic_photo, $ic_content) { - if (empty ($ic_photo)) { + if (empty($ic_photo)) { $images = get_image_url_by_source($ic_content); - if (!empty ($images) and !empty ($images[1])) { + if (!empty($images) and !empty($images[1])) { return $images[1][0]; } } else { @@ -3161,7 +3162,7 @@ class Information extends CI_Controller break; case 'rule_this_node_random': //指定节点下随机 $ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id, 'is_path'); - if (!empty ($ir_pointer)) { + if (!empty($ir_pointer)) { $data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids); } break; @@ -3178,18 +3179,18 @@ class Information extends CI_Controller return false; } //读取备用节点 - if (empty ($data) && !empty ($recommand->ir_urls)) { //查不到信息并且备选urls不为空,则随机选一条 + 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); } - if (!empty ($data)) { + if (!empty($data)) { $exclude_ids[] = $data->is_id; $data->desktop_photo = get_meta($data->ic_id, 'meta_addon_picture'); $data->mobile_photo = get_meta($data->ic_id, 'meta_addon_picture_mobile'); - if (empty ($data->mobile_photo)) { - if (!empty ($data->ic_photo)) { + if (empty($data->mobile_photo)) { + if (!empty($data->ic_photo)) { $data->mobile_photo = $this->config->item('site_image_url') . $data->ic_photo; } else { $data->mobile_photo = 'https://data.chinahighlights.com/image/travelguide/article/recommended-info-bottom-cover.jpg'; @@ -3214,7 +3215,7 @@ class Information extends CI_Controller $exclude_ids = array(0); } $result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids); - if (!empty ($result)) { + if (!empty($result)) { $data += $result; } } @@ -3223,9 +3224,9 @@ class Information extends CI_Controller if ($this->config->item('site_code') == 'ah' or $this->config->item('site_code') == 'ch' or $this->config->item('site_code') == 'gh') { //如果是AH CH GH的页面,取消重复检测 $exclude_ids = array(0); } - if (empty ($data[$item->ir_name])) { + if (empty($data[$item->ir_name])) { $result = $this->recommand_information_rule($information, $root_detail, $item, $exclude_ids); - if (!empty ($result)) { + if (!empty($result)) { $data += $result; } } @@ -3245,12 +3246,12 @@ class Information extends CI_Controller 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])) { + if (!empty($random_array[0])) { $data['info_howtoplan'] = $random_array[0]; $data['info_howtoplan_root'] = $data['root_detail']; $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content); } - if (!empty ($random_array[1])) { + if (!empty($random_array[1])) { $data['info_besttime'] = $random_array[1]; $data['info_besttime_root'] = $data['root_detail']; $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content); @@ -3269,7 +3270,7 @@ class Information extends CI_Controller '/travelguide/china-travel-reopen-restrictions.htm', ); $data['info_topthings'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]); - if (!empty ($data['info_topthings'])) { + if (!empty($data['info_topthings'])) { $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1); $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content); } @@ -3286,7 +3287,7 @@ class Information extends CI_Controller '/travelguide/chinese-language/', ); $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]); - if (!empty ($data['info_hotel'])) { + if (!empty($data['info_hotel'])) { $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1); $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content); } @@ -3298,29 +3299,29 @@ class Information extends CI_Controller $destination_url = substr($destination_url, 0, strpos($destination_url, '/', 1) + 1); //how to plan $data['info_howtoplan'] = $this->Information_model->search_by_words($destination_url, array('how', 'plan'), array($data['detail']->is_id)); - if (empty ($data['info_howtoplan'])) { //找不到对应信息则显示备用 + if (empty($data['info_howtoplan'])) { //找不到对应信息则显示备用 $data['info_howtoplan'] = $this->Information_model->Detail('/travelguide/plan-first-trip.htm'); } $data['info_howtoplan_root'] = $this->Information_model->get_detail_by_path($data['info_howtoplan']->is_path, 1); //信息所属分类,获取信息顶级节点内容 - if (!empty ($data['info_howtoplan'])) { + if (!empty($data['info_howtoplan'])) { $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content); } //best time to visit $data['info_besttime'] = $this->Information_model->search_by_words($destination_url, array('best', 'time'), array($data['detail']->is_id)); - if (empty ($data['info_besttime'])) { + if (empty($data['info_besttime'])) { $data['info_besttime'] = $this->Information_model->Detail('/weather/china-best-times.htm'); } $data['info_besttime_root'] = $this->Information_model->get_detail_by_path($data['info_besttime']->is_path, 1); //信息所属分类,获取信息顶级节点内容 - if (!empty ($data['info_besttime'])) { + if (!empty($data['info_besttime'])) { $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content); } //top things to do $data['info_topthings'] = $this->Information_model->search_by_words($destination_url, array('top', 'things'), array($data['detail']->is_id)); - if (empty ($data['info_topthings'])) { + if (empty($data['info_topthings'])) { $data['info_topthings'] = $this->Information_model->Detail('/travelguide/article-top-china-tourist-destination.htm'); } $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1); //信息所属分类,获取信息顶级节点内容 - if (!empty ($data['info_topthings'])) { + if (!empty($data['info_topthings'])) { $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content); } //第四篇,随机推荐下方url @@ -3333,7 +3334,7 @@ class Information extends CI_Controller '/aboutus/company-history.htm', ); $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]); - if (!empty ($data['info_hotel'])) { + if (!empty($data['info_hotel'])) { $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1); $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content); } @@ -3349,10 +3350,10 @@ class Information extends CI_Controller //不用参数提交的原因是可能url带有特殊字符,CI会报错 public function update_cache($static_html_url = false, $delete_only = false) { - $url = !empty ($static_html_url) ? $static_html_url : $this->input->post('cache_url'); + $url = !empty($static_html_url) ? $static_html_url : $this->input->post('cache_url'); $url = str_replace($this->config->item('site_url'), '', $url); $original_url = $url; //原始链接 - $delete_only = !empty ($delete_only) ? $delete_only : $this->input->get_post('delete_only'); + $delete_only = !empty($delete_only) ? $delete_only : $this->input->get_post('delete_only'); switch ($this->config->item('site_code')) { case 'cht': @@ -3404,13 +3405,13 @@ class Information extends CI_Controller $tmp = $url; //判断是否是更新信息 // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了 - if (!empty ($information->ic_content) || !empty ($information->ic_summary) || $meta_pc_amp == 'yes') { + if (!empty($information->ic_content) || !empty($information->ic_summary) || $meta_pc_amp == 'yes') { $url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url; } else { $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url; //$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url; } - if (isset ($information->ic_type) && $information->ic_type == 'product') { + if (isset($information->ic_type) && $information->ic_type == 'product') { $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $tmp; } //int return direct @@ -3457,18 +3458,18 @@ class Information extends CI_Controller $tmp = $url; //判断是否是更新信息 // 产品页面不能生成静态页面,比如/beijing/hotel/只是为了在导航显示一个链接,如果生成了静态页面,网前只会显示一个空白页面了 - if (!empty ($information->ic_content) || !empty ($information->ic_summary) || $meta_pc_amp == 'yes') { + if (!empty($information->ic_content) || !empty($information->ic_summary) || $meta_pc_amp == 'yes') { $url = $this->config->item('site_url') . '/index.php/gh/info/detail/?static_html_url=' . $url; } else { $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $url; //$url = $this->config->item('site_url') . '/index.php/information/detail/?static_html_url=' . $url; } - if (isset ($information->ic_type) && $information->ic_type == 'product') { + if (isset($information->ic_type) && $information->ic_type == 'product') { $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/?static_html_url=' . $tmp; } // GH国际 不发布的时候删除缓存 - if (isset ($information) && !empty ($information) && !$information->ic_status) { + if (isset($information) && !empty($information) && !$information->ic_status) { $url = $this->config->item('site_url') . '/index.php/welcome/update_cache/delete_only?static_html_url=' . $tmp; } @@ -3546,14 +3547,14 @@ class Information extends CI_Controller $update_site = array('jp', 'ru'); //需要更新CDN的站点 //需要更新的url $url = $static_html_url; - if (empty ($url)) { + if (empty($url)) { $url = $this->input->post('cache_url'); } //如果传递进来的url是带有域名,则对域名进行判断 $tempu = parse_url($url); - if (isset ($tempu['host'])) { - $url = isset ($tempu['path']) ? $tempu['path'] : '/'; + if (isset($tempu['host'])) { + $url = isset($tempu['path']) ? $tempu['path'] : '/'; $pad = $tempu['host']; $flag = true; } //如果传递进来的url没有域名,则使用当前站点的信息进行判断