diff --git a/application/config/config.php b/application/config/config.php index 275104a3..63ca6df6 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -726,6 +726,7 @@ $config['cache']['vac']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaje-a-china.c $config['cache']['ru']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinahighlights.ru'; $config['cache']['it']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaggio-in-cina.it'; $config['cache']['ch']['cache_path'] = 'D:\wwwcache\chinahighlights.com'; +$config['cache']['ah']['cache_path'] = 'D:\wwwcache\asiahighlights.com'; $config['cache']['chinatravel']['cache_path'] = 'D:\wwwcache\mobile-first\chinatravel.com'; //静态文件更新接口 diff --git a/application/controllers/information.php b/application/controllers/information.php index 9e492a32..8b2d3580 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -139,35 +139,6 @@ class Information extends CI_Controller } } - //移动优先的编辑 - public function edit_mobile($is_id) - { - //查询结构信息 - $Structure = $this->InfoStructures_model->Detail($is_id); - if ($Structure == FALSE) { - show_404(); - } - - //查询结构根节点 - $rootStructure = $this->InfoStructures_model->GetParent($Structure->is_path, 1); - //没有根节点就从它本身开始查询 - if ($rootStructure == false) { - $rootStructure_ID = $Structure->is_id; - } else { - $rootStructure_ID = $rootStructure->is_id; - } - - //查询结构列表信息 - $data['informationList'] = $this->Information_model->StructureList($rootStructure_ID); - - //信息内容 - $data['information'] = $this->Information_model->Detail($is_id); - - $this->load->view('bootstrap3/header', $data); - $this->load->view('mobile_first/editor'); - $this->load->view('bootstrap3/footer'); - - } public function edit($is_id) { @@ -329,16 +300,12 @@ class Information extends CI_Controller //获取移动优先的模板,如果有的话 //增加判断站点,每个站点需要读取的模板不一样。 20210311 zp - if ($this->config->item('site_code')=="ch"){ + if (is_mobile_first()) { $mobile_first_template_path = 'mobile_first/' . $this->config->item('site_code'); if (is_file(APPPATH . 'views/' . $mobile_first_template_path . EXT)) { - $mobile_template_H1 = $this->call_mobile_template_H1($mobile_first_template_path, $data['information']->is_path, $data['information']->ic_author, $data['information']->ic_title, $data['information']->ic_photo);//H1模板替换 $data['mobile_first_template'] = $this->load->view($mobile_first_template_path, '', TRUE); - if (empty(get_meta($data['information']->ic_id, 'meta_product_code'))) { - $data['mobile_first_template'] = str_replace('', $mobile_template_H1, $data['mobile_first_template']); - } //主样式表,内联模式 - $main_css_string=compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css')); + $main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css')); $data['mobile_first_template'] = str_replace('', '', $data['mobile_first_template']); //查找是否有静态文件 if ($this->html_file_helper('find', $data['information']->ic_url)) { @@ -350,7 +317,7 @@ class Information extends CI_Controller } //CT判断是否生成静态文件 - if ($this->config->item("site_code")=="chinatravel"){ + if ($this->config->item("site_code") == "chinatravel") { //查找是否有静态文件 if ($this->html_file_helper('find', $data['information']->ic_url)) { $data['has_html_file'] = true; @@ -363,75 +330,6 @@ class Information extends CI_Controller $this->load->view('bootstrap3/footer'); } - /** - * public function redirect($jumpUrl){ - * - * header('HTTP/1.1 301 Moved Permanently'); - * - * header($jumpUrl);// 301 跳转到设置的 url - * - * exit(); - * - * } */ - public function test_proxy($url = false) - { - $curl = curl_init(); - //curl_setopt($curl,CURLOPT_URL, "http://graph.facebook.com/?id=http://www.chinahighlights.com"); - //curl_setopt($curl,CURLOPT_URL, 'http://graph.facebook.com/?id=http://www.mybeijingchina.com/beijing-attractions/beihai-park/'); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_HEADER, 0); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1); - curl_setopt($curl, CURLOPT_PROXY, "120.24.227.23:33333"); - $request = curl_exec($curl); - curl_close($curl); - return $request; - //echo $request; - } - - // 分享数 lzq - public function statistical_sharing() - { - - //$info_ic = $this->Information_model->get_ic_url_by_code('mbj'); - $info_ic = $this->Information_model->get_ic_url(); - $ic_id = $info_ic->ic_id; - $ic_url = $info_ic->ic_url; - $ic_sitecode = $info_ic->ic_sitecode; - $site = $this->config->item('site'); - - if (!empty($ic_url)) { - - $result = $this->Information_model->update_ic_date_by_code($ic_id); - //var_dump($site['mbj']['site_url']); - //$wz_url = 'http://graph.facebook.com/?id='.$site['mbj']['site_url'].$ic_url; - $complete_url = 'http://graph.facebook.com/?id=' . $site[$ic_sitecode]['site_url'] . $ic_url; - //echo $wz_url; - $api_return = $this->test_proxy($complete_url); - $api_return = json_decode($api_return); - if (empty($api_return->shares)) { - var_dump($api_return); - $shares = 0; - } else { - var_dump($api_return); - $shares = $api_return->shares; - } - - //echo $asd->shares; - $result2 = $this->Information_model->insert_url_to_csi($info_ic->ic_url, $ic_id, $info_ic->ic_sitecode, $shares); - } - - //$sstt = $this->config->item('site'); - //foreach($infolist as $k=>$v){ - // $aabb[] = $v->ic_sitecode; - //} - //$url_count = $this->Information_model->get_count_by_code('mbj'); - //$surl = site_url('/information/fengxiangshu'); - //redirect($surl,'refresh',301); - - $this->load->view('bootstrap3/header'); - $this->load->view('bootstrap3/statistical_sharing'); - } public function edit_save() { @@ -510,12 +408,18 @@ 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, "chinatravel") == 0 && !empty($auto_update_cache)){ + + } else if (strcasecmp($site_code, "ah") == 0 && !empty($auto_update_cache)) { + //读取模板生成PC和移动优先文件 + $information_new = $this->Information_model->Detail($this->input->post('is_id')); + $this->make_www_cache_ah('mobile', $information_new); + $this->make_www_cache_ah('pc', $information_new); + } 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('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)) { @@ -596,10 +500,10 @@ class Information extends CI_Controller } if ($this->html_file_helper('find', $information->ic_url)) { //用于批量更新,CH和chinatravel分开 ,20210317 zp - if ($this->config->item('site_code') == 'ch'){ + if ($this->config->item('site_code') == 'ch') { $this->make_www_cache('pc', $information); $this->make_www_cache('mobile', $information); - }else if ($this->config->item('site_code') == 'chinatravel'){ + } else if ($this->config->item('site_code') == 'chinatravel') { $this->make_www_cache_ct('pc', $information); $this->make_www_cache_ct('mobile', $information); } @@ -687,27 +591,35 @@ class Information extends CI_Controller $template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template); //非产品页面 if (empty(get_meta($information->ic_id, 'meta_product_code'))) { - $template_H1 = $this->call_mobile_template_H1($template_path, $information->is_path, $information->ic_author, $information->ic_title, $information->ic_photo);//H1模板替换 + + //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['ic_title'] = $information->ic_title; + $data_H1['ic_photo'] = $information->ic_photo; + $template_H1 = $this->load->view($template_path . '-h1', $data_H1, TRUE); $template = str_replace('', $template_H1, $template); + //信息推荐 $template_NEXT = $this->call_mobile_template_NEXT($template_path, $information->is_id); $template = str_replace('', $template_NEXT, $template); - $addthis_widget=$this->load->view($template_path.'-add-this', false,true); + $addthis_widget = $this->load->view($template_path . '-add-this', false, true); $template = str_replace('', $addthis_widget, $template); } else { $template = str_replace('', '', $template); } //顶部全屏大图 - if($device=='mobile'){//移动端读取移动大图 + if ($device == 'mobile') {//移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); - }else{ + } else { $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); } $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); if (!empty($meta_addon_picture)) { - if(!empty($meta_addon_picture_url)){ - $template = str_replace('', '
' . $information->ic_title . '
', $template); - }else{ + if (!empty($meta_addon_picture_url)) { + $template = str_replace('', '
' . $information->ic_title . '
', $template); + } else { $template = str_replace('', '
' . $information->ic_title . '
', $template); } } @@ -718,14 +630,115 @@ class Information extends CI_Controller $template = str_replace('', '
', $template); } //主样式表,内联模式 - $main_css_string=compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css')); + $main_css_string = compress_css(GET_HTTP('https://proxy-data.chinahighlights.com/css/mobile-first.css')); $template = str_replace('', '', $template); //额外样式 $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); if (!empty($meta_addon_css)) { //引用方式 $template = str_replace('', '', $template); //内联方式 - $meta_addon_css_string=compress_css(GET_HTTP($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)) { + $template = str_replace('', '', $template); + } + $template = str_replace('', $information->ic_content, $template); + //Google广告代码 + //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { + $template = str_replace('', '', $template); + //} + if (!empty(get_meta($information->ic_id, 'meta_google_ad_article'))) { + $in_article_google = $this->load->view($template_path . '-google-ad', false, true); + $template = str_replace('', $in_article_google, $template); + } + //社媒分享图片 + if (!empty($information->ic_photo)) { + $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; + $template = str_replace('', '', $template); + } + //设置图片尺寸 + $template = $this->html_optimize_lib->set_image_size($template); + // /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm + $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); + } + + function make_www_cache_ah($device, $information) + { + + $data = array(); + $data['information']=$information; + 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, '', 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', '', TRUE); + $html_path_ext = '-pc.htm'; + } else { + return false; + } + break; + default: + } + + //替换模板中的标签 + $template = str_replace('', $information->ic_seo_title, $template); + $template = str_replace('', $information->ic_seo_description, $template); + $template = str_replace('', $information->ic_seo_keywords, $template); + $template = str_replace('', $this->config->item('site_url') . $information->ic_url, $template); + + //顶部全屏大图 + 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'); + } + $data['meta_addon_picture_url'] = get_meta($information->ic_id, 'meta_addon_picture_url'); + $template_H1 = $this->load->view($template_path . '-h1', $data, TRUE); + $template = str_replace('', $template_H1, $template); + + + //非产品页面 + /* + if (empty(get_meta($information->ic_id, 'meta_product_code'))) { + //信息推荐 暂时不用,未来用广告系统替代 + $template_NEXT = $this->call_mobile_template_NEXT($template_path, $information->is_id); + $template = str_replace('', $template_NEXT, $template); + $addthis_widget = $this->load->view($template_path . '-add-this', false, true); + $template = str_replace('', $addthis_widget, $template); + } else { + $template = str_replace('', '', $template); + } + */ + + //主样式表,内联模式 + $main_css_string = compress_css(GET_HTTP('https://proxy-data.asiahighlights.com/css/mobile-first.css')); + $template = str_replace('', '', $template); + //额外样式 + $meta_addon_css = get_meta($information->ic_id, 'meta_addon_css'); + if (!empty($meta_addon_css)) { + //内联方式 + $meta_addon_css_string = compress_css(GET_HTTP($meta_addon_css)); $template = str_replace('', '', $template); } //额外js @@ -736,10 +749,10 @@ class Information extends CI_Controller $template = str_replace('', $information->ic_content, $template); //Google广告代码 //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { - $template = str_replace('', '', $template); + $template = str_replace('', '', $template); //} if (!empty(get_meta($information->ic_id, 'meta_google_ad_article'))) { - $in_article_google=$this->load->view($template_path.'-google-ad', false,true); + $in_article_google = $this->load->view($template_path . '-google-ad', false, true); $template = str_replace('', $in_article_google, $template); } //社媒分享图片 @@ -748,7 +761,7 @@ class Information extends CI_Controller $template = str_replace('', '', $template); } //设置图片尺寸 - $template=$this->html_optimize_lib->set_image_size($template); + $template = $this->html_optimize_lib->set_image_size($template); // /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm $html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url; $html_path = str_replace("\\", "/", $html_path); @@ -763,24 +776,25 @@ class Information extends CI_Controller /** * @description: CT用的生成静态文件方法.有些内容的替换,CT这边不一样,需要单独处理 zp * @param {type} $device='mobile' or 'pc' - * @return: - * @Date Changed: + * @return: + * @Date Changed: */ - function make_www_cache_ct($device,$information){ + function make_www_cache_ct($device, $information) + { $data = array(); //先准备数据,CT采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。 $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; - + /* 详细内容 */ $ic_content = $information->ic_content; // /**替换详细内容里面的价格 - /* 直接使用fetch来动态获取价格,这样不用替换标签,直接录标签 - // * // 一日游价格标签, "" 或者 逗号后面是人数 - // * //精华线路标签"" - // */ + /* 直接使用fetch来动态获取价格,这样不用替换标签,直接录标签 + // * // 一日游价格标签, "" 或者 逗号后面是人数 + // * //精华线路标签"" + // */ // $ic_content = preg_replace_callback('//i',function($match){ // //处理一日游每次配备 // $matchItem = $match[1]; @@ -791,140 +805,136 @@ class Information extends CI_Controller // $matchItem = $match[1]; // return '';; // },$ic_content); - - //$ic_content = '
'.$ic_content.'
'; //兼容拷贝过来的内容样式 - $data["CUSTOMCONENT"]=$ic_content; - - + //$ic_content = '
'.$ic_content.'
'; //兼容拷贝过来的内容样式 + $data["CUSTOMCONENT"] = $ic_content; - //非产品页面 - $data["PRODUCTJS"]=""; - if (empty(get_meta($information->ic_id, 'meta_product_code'))) { + //非产品页面 + $data["PRODUCTJS"] = ""; + if (empty(get_meta($information->ic_id, 'meta_product_code'))) { } else { - // $data["PRODUCTJS"] = ''; + // $data["PRODUCTJS"] = ''; } //顶部全屏大图 - $data["TOPBANNER"] =""; + $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 . ''; - }else{ + $bannerImg = '' . $information->ic_title . ''; + } else { $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $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 = ''; } - } + } if (!empty($meta_addon_picture)) { - if(!empty($meta_addon_picture_url)){ - $data["TOPBANNER"] = ''; - }else{ - $data["TOPBANNER"] = ''; + if (!empty($meta_addon_picture_url)) { + $data["TOPBANNER"] = ''; + } else { + $data["TOPBANNER"] = ''; } } - //顶部视频 - $data["TOPVIDEO"]=""; + //顶部视频 + $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"]=''; + $data["TOPVIDEO"] = ''; } //主样式表,内联模式 //$apiweb="http://202.103.68.104"; //本地测试 - $apiweb="https://data.chinatravel.com"; - if ($device=="mobile"){ - $cssUrl = $apiweb."/css/newcss3/base.css"; - }else{ - $cssUrl=$apiweb."/css/newcss3/base.css"; - } - $main_css_string=compress_css(GET_HTTP($cssUrl)); - $data["MAINCSS"] = ''; - + $apiweb = "https://data.chinatravel.com"; + if ($device == "mobile") { + $cssUrl = $apiweb . "/css/newcss3/base.css"; + } else { + $cssUrl = $apiweb . "/css/newcss3/base.css"; + } + $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["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"] = ''; - } + } //总JS:为了方便以后js好维护,必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js,所以必须在这里进行判断 $addBaseJs = false; $addonJs = ""; $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"){ - $addBaseJs=true; - }else if ($meta_ct_page_type!==false && $meta_ct_page_type!=""){ - $addBaseJs=true; + if ($meta_ct_page_price == "yes") { + $addBaseJs = true; + } else if ($meta_ct_page_type !== false && $meta_ct_page_type != "") { + $addBaseJs = true; } - if ($addBaseJs){ - $addonJs=''; + if ($addBaseJs) { + $addonJs = ''; } /// ----- 总JS判断完成----- //额外js - $data["ADDONJS"]=""; + $data["ADDONJS"] = ""; $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); if (!empty($meta_addon_js)) { - $addonJs .=''; + $addonJs .= ''; } //价格js - if ($meta_ct_page_price=="yes"){ + if ($meta_ct_page_price == "yes") { $addonJs .= ''; } //列表js - if ($meta_ct_page_type=="daytripindex" || $meta_ct_page_type=="tourindex"){ + if ($meta_ct_page_type == "daytripindex" || $meta_ct_page_type == "tourindex") { $addonJs .= ''; } - $data["ADDONJS"]=$addonJs; + $data["ADDONJS"] = $addonJs; //社媒分享图片 - $data["OGIMAGE"]=""; + $data["OGIMAGE"] = ""; if (!empty($information->ic_photo)) { $full_ic_photo = $this->config->item('site_image_url') . $information->ic_photo; - $data["OGIMAGE"]= ''; + $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; + $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 ($meta_ct_page_type=="daytripindex" || $meta_ct_page_type=="tourindex"){ + if ($meta_ct_page_type == "daytripindex" || $meta_ct_page_type == "tourindex") { //产品首页 - $meta_ct_page_value = get_meta($information->ic_id,'meta_ct_page_value'); - $passParam .= ''; + $meta_ct_page_value = get_meta($information->ic_id, 'meta_ct_page_value'); + $passParam .= ''; //加信息平台的is_id - $passParam .= ''; + $passParam .= ''; } $data["passParam"] = $passParam; - //两种模板 switch ($device) { case 'mobile': @@ -950,7 +960,7 @@ class Information extends CI_Controller default: } - + //生成静态文件 $html_path = $this->config->item('cache')[$this->config->item('site_code')]['cache_path'] . $information->ic_url; $html_path = str_replace("\\", "/", $html_path); @@ -960,11 +970,8 @@ class Information extends CI_Controller $html_path .= $html_path_ext; create_folder_by_path(dirname($html_path)); file_put_contents($html_path, $template, LOCK_EX); - - - - - + + // //Google广告代码 // if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { // $template = str_replace('', '', $template); @@ -973,7 +980,7 @@ class Information extends CI_Controller // $in_article_google=$this->load->view($template_path.'-google-ad', false,true); // $template = str_replace('', $in_article_google, $template); // } - + // //设置图片尺寸 // //$template=$this->html_optimize_lib->set_image_size($template); // // /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm @@ -981,15 +988,6 @@ class Information extends CI_Controller } - function call_mobile_template_H1($mobile_first_template_path, $is_path, $ic_author, $ic_title, $ic_photo) - { - $data['infocategory'] = $this->Information_model->get_detail_by_path($is_path, 1);//信息所属分类,获取信息顶级节点内容 - $data['author'] = $this->Operator_model->get_author_nikename($ic_author);//获取作者信息 - $data['ic_title'] = $ic_title; - $data['ic_photo'] = $ic_photo; - return $this->load->view($mobile_first_template_path . '-h1', $data, TRUE); - } - //通过内容找到第一张图片 function set_photo_content($ic_photo, $ic_content) { @@ -1063,10 +1061,10 @@ class Information extends CI_Controller case 'planing-1(guide)': case 'planning-2 (decision tips)': case 'destination': //url的第一段表示地区,根据第一段来搜索相关数据如/beijing/ 而不是根据is_parent_id因为可能信息和线路是在不同的分类下 - $destination_url=trim($data['detail']->ic_url); - $destination_url=substr($destination_url,0,strpos($destination_url,'/',1)+1); + $destination_url = trim($data['detail']->ic_url); + $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); + $data['info_howtoplan'] = $this->Information_model->search_by_words($destination_url, array('how', 'plan'), $data['detail']->is_id); if (empty($data['info_howtoplan'])) {//找不到对应信息则显示备用 $data['info_howtoplan'] = $this->Information_model->Detail('/travelguide/plan-first-trip.htm'); } @@ -1075,7 +1073,7 @@ class Information extends CI_Controller $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'),$data['detail']->is_id); + $data['info_besttime'] = $this->Information_model->search_by_words($destination_url, array('best', 'time'), $data['detail']->is_id); if (empty($data['info_besttime'])) { $data['info_besttime'] = $this->Information_model->Detail('/weather/china-best-times.htm'); } @@ -1084,7 +1082,7 @@ class Information extends CI_Controller $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'),$data['detail']->is_id); + $data['info_topthings'] = $this->Information_model->search_by_words($destination_url, array('top', 'things'), $data['detail']->is_id); if (empty($data['info_topthings'])) { $data['info_topthings'] = $this->Information_model->Detail('/travelguide/article-top-china-tourist-destination.htm'); } @@ -1101,7 +1099,7 @@ class Information extends CI_Controller '/aboutus/no-shops.htm', '/aboutus/company-history.htm' ); - $data['info_hotel']=$this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]); + $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]); 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); diff --git a/application/views/mobile_first/ah-h1.php b/application/views/mobile_first/ah-h1.php new file mode 100644 index 00000000..1c48d534 --- /dev/null +++ b/application/views/mobile_first/ah-h1.php @@ -0,0 +1,15 @@ +
+ +
+ <?php echo !empty($information->ic_title)?$information->ic_title:'H1 title asiahighlights mobile first template'; ?> + +
+
+

ic_title)?$information->ic_title:'H1 title asiahighlights mobile first template'; ?>

+
+
+
+ + +
diff --git a/application/views/mobile_first/ah-pc.php b/application/views/mobile_first/ah-pc.php new file mode 100644 index 00000000..09ed466d --- /dev/null +++ b/application/views/mobile_first/ah-pc.php @@ -0,0 +1,383 @@ + + + + + + + <!--@TITLE@--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ Hoi An Woman +
+ + + +
+

Visit Vietnam with Asia Highlights

+

Asia Highlights welcomes the chance to help you design your perfect trip to Vietnam. + Check out the following links to learn more about our tours and get a head start on planning your + hassle-free vacation today!

+ + + + +

Related Articles

+ + + +
+ +
+ + + + + +
+ + We are here to help you...
start planning your tailor-made Asia tour with 1-1 + help from our travel advisors. + + Create Your Trip + +
+
+ +
+
+ +
+ +
+
About Us
+
At Asia Highlights, we create your kind of journey – your dates, + destinations, at your pace. Not just any journey, but the unique trip with exceptional + experience you're looking for. more + ... +
+ + Rated + 4.8 out of 5 | Excellent +
+
+ + +
+ +
+ + +
+ +
Featured on
+ Medias + + +
+ + +
+ + +
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/mobile_first/ah.php b/application/views/mobile_first/ah.php new file mode 100644 index 00000000..56e7174e --- /dev/null +++ b/application/views/mobile_first/ah.php @@ -0,0 +1,348 @@ + + + + + <!--@TITLE@--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ Hoi An Woman +
+ +
+ + + +
+

Visit Vietnam with Asia Highlights

+

Asia Highlights welcomes the chance to help you design your perfect trip to Vietnam. Check out + the following links to learn more about our tours and get a head start on planning your hassle-free vacation + today!

+
+ xxx + +
+
+ xxx + +
+
+ xxx + +
+ +

Related Articles

+ + + +
+ + + + + + + + + + + + + + + + \ No newline at end of file