diff --git a/application/controllers/information.php b/application/controllers/information.php index 746f1724..6ffed323 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -408,7 +408,6 @@ class Information extends CI_Controller $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache('mobile', $information_new); $this->make_www_cache('pc', $information_new); - } else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { //读取模板生成PC和移动优先文件 $information_new = $this->Information_model->Detail($this->input->post('is_id')); @@ -419,7 +418,6 @@ class Information extends CI_Controller $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_ct('mobile', $information_new); $this->make_www_cache_ct('pc', $information_new); - } 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)) { @@ -594,8 +592,8 @@ class Information extends CI_Controller //H1模板替换 $data_H1 = array(); - $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1);//信息所属分类,获取信息顶级节点内容 - $data_H1['author'] = $this->Operator_model->get_author_nikename($information->ic_author);//获取作者信息 + $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 + $data_H1['author'] = $this->Operator_model->get_author_nikename($information->ic_author); //获取作者信息 $data_H1['ic_title'] = $information->ic_title; $data_H1['ic_photo'] = $information->ic_photo; $template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE); @@ -610,7 +608,7 @@ class Information extends CI_Controller $template = str_replace('', '', $template); } //顶部全屏大图 - if ($device == 'mobile') {//移动端读取移动大图 + if ($device == 'mobile') { //移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); } else { $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); @@ -676,7 +674,7 @@ class Information extends CI_Controller { $data = array(); - $data['information']=$information; + $data['information'] = $information; switch ($device) { case 'mobile': //获取移动优先的模板,如果有的话 @@ -708,7 +706,7 @@ class Information extends CI_Controller $template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template); //顶部全屏大图 - if ($device == 'mobile') {//移动端读取移动大图 + if ($device == 'mobile') { //移动端读取移动大图 $data['meta_addon_picture'] = get_meta($information->ic_id, 'meta_addon_picture_mobile'); } else { $data['meta_addon_picture'] = get_meta($information->ic_id, 'meta_addon_picture'); @@ -813,7 +811,6 @@ class Information extends CI_Controller //非产品页面 $data["PRODUCTJS"] = ""; if (empty(get_meta($information->ic_id, 'meta_product_code'))) { - } else { // $data["PRODUCTJS"] = ''; } @@ -822,16 +819,15 @@ class Information extends CI_Controller $data["TOPBANNER"] = ""; $ImgText = ""; //图文字 $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); - if ($device == 'mobile') {//移动端读取移动大图 + if ($device == 'mobile') { //移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); $bannerImg = '' . $information->ic_title . ''; - $meta_addon_picture_text = get_meta($information->ic_id,'meta_addon_picture_text'); - if(!empty($meta_addon_picture_url)){ - $ImgText = ''; - }else{ - $ImgText = ''; + $meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text'); + if (!empty($meta_addon_picture_url)) { + $ImgText = ''; + } else { + $ImgText = ''; } - } else { $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $bannerImg = '' . $information->ic_title . ''; @@ -879,12 +875,25 @@ class Information extends CI_Controller //内联方式 $meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css)); $data["ADDONCSS"] = ''; + } + //社媒分享图片 + $data["OGIMAGE"] = ""; + if (!empty($information->ic_photo)) { + $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; + $data["OGIMAGE"] = ''; + } + //结构化标签 + $data["ConstructionCode"] = ""; + $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code'); + if (!empty($meta_construction_code)) { + $data["ConstructionCode"] = $meta_construction_code; } //总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断 $addBaseJs = false; $addonJs = ""; + $meta_ct_page_type = ""; $meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格 $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型 if ($meta_ct_page_price == "yes") { @@ -900,45 +909,33 @@ class Information extends CI_Controller //额外js $data["ADDONJS"] = ""; + $jscdn = ""; + //$jscdn = "//data.chinatravel.com"; $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); if (!empty($meta_addon_js)) { $addonJs .= ''; } //价格js if ($meta_ct_page_price == "yes") { - $addonJs .= ''; + $addonJs .= ''; } //列表js - if (in_array($meta_ct_page_type ,array('daytripindex','tourindex','attractionindex'))) { - $addonJs .= ''; - } - - $data["ADDONJS"] = $addonJs; - //社媒分享图片 - $data["OGIMAGE"] = ""; - if (!empty($information->ic_photo)) { - $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; - $data["OGIMAGE"] = ''; - } + if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) { + $addonJs .= ''; + } - //结构化标签 - $data["ConstructionCode"] = ""; - $meta_construction_code = get_meta($information->ic_id, 'meta_construction_code'); - if (!empty($meta_construction_code)) { - $data["ConstructionCode"] = $meta_construction_code; - } //页面传递参数 $passParam = ""; - if (in_array($meta_ct_page_type ,array( "daytripindex" , "tourindex","attractionindex")) ){ //一日游和线路列表 + if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex"))) { //一日游和线路列表 //产品首页 $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); - if (in_array($meta_ct_page_type,array("attractionindex") )){ + if (in_array($meta_ct_page_type, array("attractionindex"))) { //旧信息id,景点等信息类 - $passParam .= ''; - }else{ + $passParam .= ''; + } else { //城市名称,产品类用 $passParam .= ''; } @@ -948,6 +945,31 @@ class Information extends CI_Controller $passParam .= ''; } + + + //产品详细页 + $productType = ""; + $productCode = ""; + if ($meta_ct_page_type == "daytripdetail") { + //一日游 + 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)) { + $productCode = $meta_ct_page_value; + } + + $data["productType"] = $productType; + $data["productCode"] = $productCode; + $addonJs .= ''; + $addonJs .= ''; + $data["ADDONCSS"] .= ''; + } + + + //页面添加的元素 + $data["ADDONJS"] = $addonJs; $data["passParam"] = $passParam; @@ -1021,8 +1043,8 @@ class Information extends CI_Controller function call_mobile_template_NEXT($template_path, $is_id) { $data['detail'] = $this->Information_model->Detail($is_id); - $data['type_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 0);//信息所属分组,根据分组进行不同推荐 - $data['root_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 1);//信息所属分类,获取信息顶级节点内容 + $data['type_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 0); //信息所属分组,根据分组进行不同推荐 + $data['root_detail'] = $this->Information_model->get_detail_by_path($data['detail']->is_path, 1); //信息所属分类,获取信息顶级节点内容 switch (strtolower($data['type_detail']->ic_url_title)) { case 'inspiration': @@ -1081,10 +1103,10 @@ 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'), $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);//信息所属分类,获取信息顶级节点内容 + $data['info_howtoplan_root'] = $this->Information_model->get_detail_by_path($data['info_howtoplan']->is_path, 1); //信息所属分类,获取信息顶级节点内容 if (!empty($data['info_howtoplan'])) { $data['info_howtoplan']->ic_photo = $this->set_photo_content($data['info_howtoplan']->ic_photo, $data['info_howtoplan']->ic_content); } @@ -1093,7 +1115,7 @@ class Information extends CI_Controller 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);//信息所属分类,获取信息顶级节点内容 + $data['info_besttime_root'] = $this->Information_model->get_detail_by_path($data['info_besttime']->is_path, 1); //信息所属分类,获取信息顶级节点内容 if (!empty($data['info_besttime'])) { $data['info_besttime']->ic_photo = $this->set_photo_content($data['info_besttime']->ic_photo, $data['info_besttime']->ic_content); } @@ -1102,7 +1124,7 @@ class Information extends CI_Controller 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);//信息所属分类,获取信息顶级节点内容 + $data['info_topthings_root'] = $this->Information_model->get_detail_by_path($data['info_topthings']->is_path, 1); //信息所属分类,获取信息顶级节点内容 if (!empty($data['info_topthings'])) { $data['info_topthings']->ic_photo = $this->set_photo_content($data['info_topthings']->ic_photo, $data['info_topthings']->ic_content); } diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index d835cc58..cab1f982 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -886,13 +886,13 @@ 一日游首页