@@ -1165,7 +1178,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);
}
@@ -1186,7 +1199,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 {
@@ -1196,7 +1209,7 @@ 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);
}
//设置内容图片缓加载
@@ -1213,12 +1226,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);
}
//设置图片尺寸
@@ -1294,7 +1307,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);
@@ -1319,7 +1332,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);
@@ -1369,13 +1382,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;
@@ -1397,7 +1410,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':
@@ -1453,7 +1466,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,
@@ -1478,11 +1491,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';
@@ -1496,7 +1509,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':
@@ -1506,8 +1519,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;
@@ -1578,18 +1591,18 @@ 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); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = ''; //获取作者信息
$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;
}
}
@@ -1600,7 +1613,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);
}
@@ -1612,13 +1625,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);
@@ -1628,10 +1641,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'])) {
+ if (!empty ($template_recommand['Tips Right'])) {
$template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template);
}
// 右侧列表广告
@@ -1680,7 +1693,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) {
@@ -1702,7 +1715,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 {
@@ -1730,7 +1743,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);
@@ -1750,7 +1763,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);
@@ -1794,7 +1807,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 {
@@ -1804,7 +1817,7 @@ 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);
}
//设置内容图片缓加载
@@ -1813,12 +1826,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);
}
//设置图片尺寸
@@ -1879,7 +1892,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') { //移动端读取移动大图
@@ -1903,15 +1916,15 @@ 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['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;
}
}
@@ -1941,7 +1954,7 @@ 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'])) {
+ if (!empty ($template_recommand['Tips Right'])) {
$template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template);
}
// 右侧列表广告
@@ -2004,7 +2017,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) {
@@ -2015,7 +2028,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);
@@ -2095,7 +2108,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);
@@ -2118,7 +2131,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);
@@ -2138,7 +2151,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);
@@ -2184,14 +2197,14 @@ 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);
}
//设置内容图片缓加载
@@ -2205,12 +2218,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);
}
@@ -2270,8 +2283,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)) . '
';
}
@@ -2326,7 +2339,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"] = "
";
} else {
@@ -2338,7 +2351,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"] = '
';
}
@@ -2352,7 +2365,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"]= '
';
//内联方式
@@ -2361,7 +2374,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 {
@@ -2373,7 +2386,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;
}
@@ -2396,7 +2409,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
@@ -2437,11 +2450,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 .= '';
@@ -2452,7 +2465,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;
}
@@ -2472,7 +2485,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;
@@ -2507,17 +2520,17 @@ class Information extends CI_Controller
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$bannerImg = '

';
- 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 = '
' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
$bannerImg = '

';
- 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 = '
' . $meta_addon_picture_text . '
';
}
}
@@ -2544,8 +2557,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"] = '
' . $bannerImg . $ImgText . $template_TrainSearch . '
';
@@ -2633,8 +2646,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)) . '
';
}
@@ -2659,7 +2672,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"] = "
";
} else {
$data["ISPRODUCT"] = "yes";
@@ -2669,7 +2682,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"] = '
';
}
@@ -2683,7 +2696,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"]= '
';
//内联方式
@@ -2692,7 +2705,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 {
@@ -2704,7 +2717,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;
}
@@ -2727,7 +2740,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
@@ -2768,11 +2781,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 .= '';
@@ -2789,7 +2802,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;
}
@@ -2843,17 +2856,17 @@ class Information extends CI_Controller
if ($device == 'mobile') { //移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$bannerImg = '

';
- 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 = '
' . $meta_addon_picture_text . '
';
}
} else {
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
$bannerImg = '

';
- 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 = '
' . $meta_addon_picture_text . '
';
}
}
@@ -2880,8 +2893,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"] = '
' . $bannerImg . $ImgText . $template_TrainSearch . '
';
@@ -2930,9 +2943,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 {
@@ -2961,7 +2974,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;
@@ -2978,18 +2991,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';
@@ -3014,7 +3027,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;
}
}
@@ -3023,9 +3036,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;
}
}
@@ -3045,12 +3058,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);
@@ -3069,7 +3082,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);
}
@@ -3086,7 +3099,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);
}
@@ -3098,29 +3111,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
@@ -3133,7 +3146,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);
}
@@ -3149,10 +3162,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':
@@ -3204,13 +3217,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
@@ -3256,18 +3269,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;
}
@@ -3345,14 +3358,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没有域名,则使用当前站点的信息进行判断