diff --git a/application/config/config.php b/application/config/config.php index 2c1ee505..94749e0c 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -425,6 +425,7 @@ $config['site'] = array( 'bht' => array('site_code' => 'bht', 'site_id' => 6565, 'site_lgc' => '1', 'site_image_url' => '', 'site_url' => 'https://www.beijinghighlights.com', 'site_authors' => array('cj')), 'trippest' => array('site_code' => 'trippest', 'site_id' => 145, 'site_lgc' => '1', 'site_image_url' => '', 'site_url' => 'https://www.trippest.com', 'site_authors' => array('cj'), 'site_user' => array(',ycc,zp,')), 'shanghai' => array('site_code' => 'shanghai', 'site_id' => 96, 'site_lgc' => '107', 'site_url' => 'http://www.shanghaihighlights.com/', 'site_image_url' => 'https://images.shanghaihighlights.com', 'site_authors' => array('ll', 'D'), 'site_user' => ',ycc,vz,bhn,J,wj,ll,D,ZP,lyy,'), + 'beijing' => array('site_code' => 'beijing', 'site_id' => 98, 'site_lgc' => '106', 'site_url' => 'http://www.mybeijingchina.com/', 'site_image_url' => 'https://images.mybeijingchina.com', 'site_authors' => array('ll', 'D'), 'site_user' => ',ycc,vz,bhn,J,wj,ll,D,ZP,lyy,'), ); //静态文件生成路径 @@ -760,6 +761,7 @@ $config['css_source_gh'] = 'https://data.globalhighlights.com/css/gh-global.css' $config['css_source_ct'] = 'https://data.chinatravel.com/css/min.php?f=/css/css3/bootstrap/bootstrap.css,/css/css3/style.css,/css/css3/destination-details.css'; $config['css_source_chinatravel'] = 'https://data.chinatravel.com/css/newcss3/base.css'; $config['css_source_shanghai'] = 'https://data.shanghaihighlights.com/css/css3/base.css'; +$config['css_source_beijing'] = 'https://www.mybeijingchina.com/css/css3/base.css'; $config['css_source_ts'] = 'https://www.trainspread.com/css/bootstrap.min.css'; //静态文件生成路径 @@ -775,6 +777,7 @@ $config['cache']['ah']['cache_path'] = 'D:\wwwcache\asiahighlights.com'; $config['cache']['gh']['cache_path'] = 'D:\wwwcache\globalhighlights.com'; $config['cache']['chinatravel']['cache_path'] = 'D:\wwwcache\mobile-first\chinatravel.com'; $config['cache']['shanghai']['cache_path'] = 'D:\wwwcache\mobile-first\shanghaihighlights.com'; +$config['cache']['beijing']['cache_path'] = 'D:\wwwcache\mobile-first\mybeijingchina.com'; //静态文件更新接口 $config['cache']['jp']['cache_api'] = '/info.php/information/update_cache/'; diff --git a/application/controllers/information.php b/application/controllers/information.php index d55eb765..b9cdd114 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -728,6 +728,9 @@ class Information extends CI_Controller } 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, "beijing") == 0 && !empty($auto_update_cache)) { + $information_new = $this->Information_model->Detail($this->input->post('is_id')); + $this->make_www_cache_bj($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)) { @@ -820,6 +823,8 @@ class Information extends CI_Controller // $this->make_www_cache_ct('mobile', $information); } else if ($this->config->item('site_code') == 'shanghai') { $this->make_www_cache_sh($information); + } else if ($this->config->item('site_code') == 'beijing') { + $this->make_www_cache_bj($information); } else if ($this->config->item('site_code') == 'gh') { $this->make_www_cache_gh('pc', $information, $recommand_information); $this->make_www_cache_gh('mobile', $information, $recommand_information); @@ -3219,6 +3224,341 @@ class Information extends CI_Controller } + /** + * 北京站mybeijingchina.com + */ + public function make_www_cache_bj($information){ + $data = array(); + + #region 公用数据 + $apiurl = "http://202.103.68.104:61/info.php"; //本地测试 + //$apiurl = "https://ct.mycht.cn/info.php"; //网前 + + //先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。 + $data["TITLE"] = $information->ic_seo_title; + $data["DESCRIPTION"] = $information->ic_seo_description; + $data["KEYWORDS"] = $information->ic_seo_keywords; + $data["CANONICAL"] = $this->config->item('site_url') . $information->ic_url; + $meta_ct_page_type = ""; + $meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型 + $meta_product_code = get_meta($information->ic_id, 'meta_product_code'); //绑定的产品编号 + $template_path = 'mobile_first/' . $this->config->item('site_code'); //模板位置 + + //面包屑 + $crumb = ""; + $crumb_data = $this->Information_model->get_path_exclude_ct($information->is_id, $information->is_path); + if (count($crumb_data) > 0) { //至少有一个父类面包屑才显示 + $crumb = "
Home"; + foreach ($crumb_data as $index => $item) { + $crumb .= '' . $item['ic_url_title'] . ''; + } + $crumb .= "
"; + } + $data["crumb"] = $crumb; + + //作者字符串,信息页或者城市天气页加载 2022-7-26 + $str_author = ""; + $author = $this->Operator_model->get_author_nikename($information->ic_author); + if ((empty($meta_product_code) && !($meta_ct_page_type !== false && $meta_ct_page_type != "")) || $meta_ct_page_type == "weatherpage") { + $OPI_FirstName = !empty($author) ? $author->OPI_FirstName : 'author nickname'; + $str_author = '
Written by ' . $OPI_FirstName . ' Updated ' . date("M. j, Y", strtotime($information->ic_datetime)) . '
'; + } + + + /* 详细内容 */ + $ic_content = $information->ic_content; + + /** 替换H1加面包屑,加作者 */ + $ic_content = preg_replace('/

(.*)<\/h1>/i', $crumb . "\r\n" . '

$1

' . "\r\n" . $str_author . "\r\n", $ic_content, 1); + + //图片加延迟 + $ic_content = $this->html_optimize_lib->set_lazy_loader($ic_content, 'https://www.mybeijingchina.com/image/grey.gif'); + + $ic_content = $this->html_optimize_lib->set_image_size($ic_content); + + + + //非产品页面 + $data["PRODUCTJS"] = ""; + $data["ISPRODUCT"] = "no"; //判断是否是产品页 + $data["addthis_widget"] = ""; + $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)) { + $data["FloatIcon"] = "
Create My Trip
"; + } else { + $data["ISPRODUCT"] = "yes"; + } + + //顶部视频 + $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)) { + $data["TOPVIDEO"] = ''; + } + + //主样式表,内联模式 + $apiweb="http://202.103.68.104:84"; //本地测试 + //$apiweb = "https://www.mybeijingchina.com"; + $cssUrl = $apiweb . "/css/css3/base.css?v=" . time(); + $main_css_string = compress_css(GET_HTTP($cssUrl)); + $data["MAINCSS"] = ''; + + //额外样式 + $data["ADDONCSS"] = ""; + $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); + if (!empty($meta_addon_css)) { + //引用方式 + //$data["ADDONCSS"]= ''; + //内联方式 + $meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css)); + $data["ADDONCSS"] = ''; + } + //社媒分享图片 + $data["OGIMAGE"] = ""; + if (!empty($information->ic_photo)) { + if (strpos($information->ic_photo, "mybeijingchina.com") != false) { + $full_ic_photo = $information->ic_photo; + } else { + $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_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格 + + if ($meta_ct_page_price == "yes") { + $addBaseJs = true; + } else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") { + $addBaseJs = true; + } + + if ($addBaseJs) { + $addonJs = ''; + } + /// ----- 总JS判断完成----- + + //额外js + $data["ADDONJS"] = ""; + $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 .= ''; + } + + //列表js + if (in_array($meta_ct_page_type, array('daytripindex', 'tourindex', 'attractionindex'))) { + $addonJs .= ''; + } + + //天气 + if (in_array($meta_ct_page_type, array('weatherpage'))) { + $addonJs .= ''; + } + + //页面传递参数 + $passParam = ""; + if (in_array($meta_ct_page_type, array("daytripindex", "tourindex", "attractionindex", "weatherpage"))) { //一日游和线路列表 + //产品首页 + $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); + + if (in_array($meta_ct_page_type, array("attractionindex"))) { + //旧信息id,景点等信息类 + $passParam .= ''; + } else { + //城市名称,产品类用 + $passParam .= ''; + } + + //加信息平台的is_id + $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; + } + $addonJs .= ''; + //$addonJs .= ''; + $data["ADDONCSS"] .= ''; + + //一日游表单的替换 + $DayTripData["productCode"] = $productCode; + $template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容 + //使用simple_html_dom_lib库来进行表单添加 + $ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail); + } + if ($meta_ct_page_type == "tourdetail") { + //线路 + $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; + } + + //获取cli_sn + $tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/apibj/getCliSn/?param=" . $productCode)); + $data["clisn"] = $tourdata->clisn; + + //调取模板 + $dataform["TourCode"] = $productCode; + $dataform["CLI_SN"] = $tourdata->clisn; + $dataform["TourName"] = $information->ic_title; + + + } + + //表单页 + if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail"))) { + $productType = $meta_ct_page_type; + $addonJs .= ''; + $data["ADDONCSS"] .= ''; + } + + if ($meta_ct_page_type == "daytripform") { + $productType = $meta_ct_page_type; + $addonJs .= ''; + $data["ADDONCSS"] .= ''; + } + + $data["productType"] = $productType; + $data["productCode"] = $productCode; + + //页面添加的元素 + $data["ADDONJS"] = $addonJs; + $data["passParam"] = $passParam; + + //页面详细内容放最后,这样上面都可以进行内容的替换,比如一日游表单 + $data["CUSTOMCONENT"] = $ic_content; + + #endregion + + #region 移动端和PC端差别处理区域 + $arrDevice = array("mobile", "pc"); + foreach ($arrDevice as $device) { + //顶部全屏大图 + $data["TOPBANNER"] = ""; + $ImgText = ""; //图文字 + $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); + $meta_addon_picture_text = get_meta($information->ic_id, 'meta_addon_picture_text'); + 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)) { + $ImgText = ''; + } 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)) { + $ImgText = ''; + } else if (!empty($meta_addon_picture_text)) { + $ImgText = ''; + } + } + + // 搜索框 + $template_TrainSearch = ""; + if ($information->ic_url == "/china-trains/hometest" || $information->ic_url == "/china-trains") { + //火车票首页 + $template_TrainSearch = $this->load->view($template_path . '-train-index', null, true); + $ImgText = ""; + //火车票移动端去掉头部图片,保证搜索框CLS + if ($device == 'mobile') { + $meta_addon_picture = ""; + $data["TOPBANNER"] = ''; + } + } else if ($information->ic_url == "/china-flights") { + //机票首页 + $template_TrainSearch = $this->load->view($template_path . '-flight-index', null, true); + $ImgText = ""; + //飞机票移动端去掉头部图片,保证搜索框CLS + if ($device == 'mobile') { + $meta_addon_picture = ""; + $data["TOPBANNER"] = ''; + } + } + + if (!empty($meta_addon_picture)) { + if (!empty($meta_addon_picture_url)) { + $data["TOPBANNER"] = ''; + } else { + $data["TOPBANNER"] = ''; + } + } + + + if ($meta_ct_page_type == "tourdetail") { //线路表单,左右结构,用标签来做 + $dataform['device'] = $device; + $template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true); + $ic_content = str_replace('', $template_form_tourqi, $ic_content); + $data["CUSTOMCONENT"] = $ic_content; + } + + //两种设备分别调用两种模板 ,静态化 + switch ($device) { + case 'mobile': + //获取移动优先的模板,如果有的话 + $template_path = 'mobile_first/' . $this->config->item('site_code'); + if (is_file(APPPATH . 'views/' . $template_path . EXT)) { + $template = $this->load->view($template_path, $data, true); + $html_path_ext = '-mobile.htm'; + } else { + return false; + } + break; + case 'pc': + //获取PC的模板,如果有的话 + $template_path = 'mobile_first/' . $this->config->item('site_code'); + if (is_file(APPPATH . 'views/' . $template_path . '-pc' . EXT)) { + $template = $this->load->view($template_path . '-pc', $data, true); + $html_path_ext = '-pc.htm'; + } else { + return false; + } + break; + default: + } + + //生成静态文件 + $html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url; + $html_path = str_replace("\\", "/", $html_path); + if (substr($html_path, -1, 1) == '/') { + $html_path = $html_path . 'index.htm'; + } + $html_path .= $html_path_ext; + create_folder_by_path(dirname($html_path)); + file_put_contents($html_path, $template, LOCK_EX); + } + #endregion + + } + //通过内容找到第一张图片 public function set_photo_content($ic_photo, $ic_content) { diff --git a/application/helpers/info_helper.php b/application/helpers/info_helper.php index f3ed7513..67d5d4ec 100644 --- a/application/helpers/info_helper.php +++ b/application/helpers/info_helper.php @@ -103,7 +103,7 @@ function is_mobile_first() { $CI = &get_instance(); $sitecode = $CI->config->item('site_code'); - if ($sitecode == 'ch' || $sitecode == 'ah' || $sitecode == 'chinatravel' || $sitecode == 'gh' || $sitecode == 'shanghai') { + if ($sitecode == 'ch' || $sitecode == 'ah' || $sitecode == 'chinatravel' || $sitecode == 'gh' || $sitecode == 'shanghai' || $sitecode=='beijing') { return true; } else { return false; diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 90a71f86..a2fae644 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -842,7 +842,7 @@ - ic_sitecode == 'chinatravel' || $information->ic_sitecode == 'shanghai') { + ic_sitecode == 'chinatravel' || $information->ic_sitecode == 'shanghai' || $information->ic_sitecode == 'beijing') { ?>
@@ -2501,7 +2501,7 @@ 忽略URL重复
- config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'gh', 'ct', 'chinatravel', 'shanghai'))) { ?> + config->item('site_code'), array('ch', 'cht', 'gm', 'ah', 'gh', 'ct', 'chinatravel', 'shanghai','beijing'))) { ?>
- config->item("site_code")=="chinatravel" || $this->config->item("site_code")=="shanghai" ){ ?> + config->item("site_code")=="chinatravel" || $this->config->item("site_code")=="shanghai" || $this->config->item("site_code")=="beijing" ){ ?>
diff --git a/application/views/mobile_first/beijing-daydetail-form.php b/application/views/mobile_first/beijing-daydetail-form.php new file mode 100644 index 00000000..6c1b0d88 --- /dev/null +++ b/application/views/mobile_first/beijing-daydetail-form.php @@ -0,0 +1,49 @@ +
+
+
+
+
+

from US $ p/p

+

Price details

+
+
+

1Select Trave Date

+
+ +
+ +
+
+

2Number of Travelers

+
+ +
+ +
+
+
Book Now + +
+
+ +
+
+
+
+ diff --git a/application/views/mobile_first/beijing-form-tourqi-new.php b/application/views/mobile_first/beijing-form-tourqi-new.php new file mode 100644 index 00000000..fac9f466 --- /dev/null +++ b/application/views/mobile_first/beijing-form-tourqi-new.php @@ -0,0 +1,359 @@ + + + +
+
+
+
+

Price is based on a 2-person tour with 4-star hotels in low season.

+
+
+

from US $ p/p

+
+
+
+
+

*How Many People In Your Group?

+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+

*What's Your Hotel Preference?

+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+

I prefer to be contacted via:

+
+
+ +
+ +
+ +
+
+

Inquire This Tour

+ + + + + +

Your travel consultant will reach you within 1 working day.

+
+
+ +
+
diff --git a/application/views/mobile_first/beijing-pc.php b/application/views/mobile_first/beijing-pc.php new file mode 100644 index 00000000..fb9d6d0b --- /dev/null +++ b/application/views/mobile_first/beijing-pc.php @@ -0,0 +1,146 @@ + + + + + + <?php echo $TITLE ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+
+

We are here to help you...
+ start planning your tailor-made China tour with 1-1 help from our travel advisors.

+

Create Your Trip

+
+
+
+ + + +
+
+
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/mobile_first/beijing.php b/application/views/mobile_first/beijing.php new file mode 100644 index 00000000..f74ab06f --- /dev/null +++ b/application/views/mobile_first/beijing.php @@ -0,0 +1,125 @@ + + + + + <?php echo $TITLE ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+ + + +
+ + +
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/media/popselectpicture.php b/media/popselectpicture.php index b7575822..4630d924 100644 --- a/media/popselectpicture.php +++ b/media/popselectpicture.php @@ -85,6 +85,9 @@ case 'shanghai': $media_site_code = 'shanghai'; break; + case 'beijing': + $media_site_code = 'beijing'; + break; default: $media_site_code = 'ch'; } diff --git a/wysiwyg/ckfinder/config.php b/wysiwyg/ckfinder/config.php index 6f9c49a4..e2c2896a 100644 --- a/wysiwyg/ckfinder/config.php +++ b/wysiwyg/ckfinder/config.php @@ -107,6 +107,9 @@ switch ($sitecode) { case 'shanghai': $site_url = 'https://data.shanghaihighlights.com'; break; + case 'beijing': + $site_url = 'https://www.mybeijingchina.com'; + break; default: $site_url = ''; } diff --git a/wysiwyg/ckfinder/安装说明.txt b/wysiwyg/ckfinder/安装说明.txt index 88b07cf9..a2880d3a 100644 --- a/wysiwyg/ckfinder/安装说明.txt +++ b/wysiwyg/ckfinder/安装说明.txt @@ -17,4 +17,8 @@ mklink /D "D:\wwwroot\uploader-file\ch\pic" "D:\wwwroot\origin-www.chinahighligh //shanghai mklink /D "D:\wwwroot-ct\uploader-file\shanghai\image" "D:\wwwroot-ct\shanghaihighlights.com\image" -mklink /D "D:\wwwroot-ct\uploader-file\shanghai\pic" "D:\wwwroot-ct\shanghaihighlights.com\pic" \ No newline at end of file +mklink /D "D:\wwwroot-ct\uploader-file\shanghai\pic" "D:\wwwroot-ct\shanghaihighlights.com\pic" + +//beijing +mklink /D "D:\wwwroot-ct\uploader-file\beijing\image" "D:\wwwroot-ct\mybeijingchina.com\images" +mklink /D "D:\wwwroot-ct\uploader-file\beijing\pic" "D:\wwwroot-ct\mybeijingchina.com\pic" \ No newline at end of file