From 8ebc302f18b97ad7f51e8bff42b89fb41c950820 Mon Sep 17 00:00:00 2001 From: candice Date: Thu, 29 Apr 2021 10:29:45 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=93=81=E7=89=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/mobile_first/ah-pc.php | 9 ++++++++- application/views/mobile_first/ah.php | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/application/views/mobile_first/ah-pc.php b/application/views/mobile_first/ah-pc.php index d0187390..5cc70866 100644 --- a/application/views/mobile_first/ah-pc.php +++ b/application/views/mobile_first/ah-pc.php @@ -171,7 +171,14 @@ - +
+

Why Travel with Asia Highlights

+ +
diff --git a/application/views/mobile_first/ah.php b/application/views/mobile_first/ah.php index 85406cd1..59c519c8 100644 --- a/application/views/mobile_first/ah.php +++ b/application/views/mobile_first/ah.php @@ -172,6 +172,14 @@ +
+

Why Travel with Asia Highlights

+ +
From c49cce08333011fff7e80884608b248bea74049f Mon Sep 17 00:00:00 2001 From: candice Date: Thu, 29 Apr 2021 10:39:55 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=93=81=E7=89=8C=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/mobile_first/ah-pc.php | 17 +++++++++-------- application/views/mobile_first/ah.php | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/application/views/mobile_first/ah-pc.php b/application/views/mobile_first/ah-pc.php index 5cc70866..7fa5062c 100644 --- a/application/views/mobile_first/ah-pc.php +++ b/application/views/mobile_first/ah-pc.php @@ -169,16 +169,17 @@
+
+

Why Travel with Asia Highlights

+
    +
  • Tailor-made experience: All of your ideas/needs will be carefully considered to create your ideal trip.
  • +
  • Worry-free planning: Every step of your trip, you will be looked after by your 1:1 travel consultant based in Asia.
  • +
  • No-risk booking: We refund as much as we can and adapt flexibly to unexpected changes.
  • +
+
-
-

Why Travel with Asia Highlights

-
    -
  • Tailor-made experience: All of your ideas/needs will be carefully considered to create your ideal trip.
  • -
  • Worry-free planning: Every step of your trip, you will be looked after by your 1:1 travel consultant based in Asia.
  • -
  • No-risk booking: We refund as much as we can and adapt flexibly to unexpected changes.
  • -
-
+ diff --git a/application/views/mobile_first/ah.php b/application/views/mobile_first/ah.php index 59c519c8..c3dfc9c5 100644 --- a/application/views/mobile_first/ah.php +++ b/application/views/mobile_first/ah.php @@ -168,11 +168,7 @@
- - - -
-
+

Why Travel with Asia Highlights

  • Tailor-made experience: All of your ideas/needs will be carefully considered to create your ideal trip.
  • @@ -181,6 +177,10 @@
+ +
+ + From 301a68f88fa0c5bb4c4ab0e462a1d1c5df614845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Fri, 30 Apr 2021 16:16:00 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0=E7=BC=93=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 12 +++++-- application/libraries/html_optimize_lib.php | 36 +++++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 73acae9e..8a65b5d7 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -423,7 +423,7 @@ class Information extends CI_Controller } 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)) { - $update_info_log = $this->update_cache($ic_url); + //$update_info_log = $this->update_cache($ic_url); } else if (strcasecmp($site_code, "cht") != 0 && strcasecmp($site_code, "gm") != 0 && strcasecmp($site_code, "ah") != 0) { //非cht站点并且非GM并且非AH $update_info_log = $this->update_cache($ic_url); } else if (strcasecmp($site_code, "ct") == 0 && !empty($auto_update_cache)) { @@ -649,7 +649,10 @@ class Information extends CI_Controller if (!empty($meta_addon_js)) { $template = str_replace('', '', $template); } - $template = str_replace('', $information->ic_content, $template); + //设置内容图片缓加载 + $lazy_content=$this->html_optimize_lib->set_lazy_loader($information->ic_content,'https://data.chinahighlights.com/grey.gif'); + $template = str_replace('', $lazy_content, $template); + //Google广告代码 //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { $template = str_replace('', '', $template); @@ -755,7 +758,10 @@ class Information extends CI_Controller if (!empty($meta_addon_js)) { $template = str_replace('', '', $template); } - $template = str_replace('', $information->ic_content, $template); + //设置内容图片缓加载 + $lazy_content=$this->html_optimize_lib->set_lazy_loader($information->ic_content,'https://data.asiahighlights.com/grey.gif'); + $template = str_replace('', $lazy_content, $template); + //Google广告代码 //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { $template = str_replace('', '', $template); diff --git a/application/libraries/html_optimize_lib.php b/application/libraries/html_optimize_lib.php index 4f8b51a3..7c92ec4f 100644 --- a/application/libraries/html_optimize_lib.php +++ b/application/libraries/html_optimize_lib.php @@ -20,8 +20,26 @@ class html_optimize_lib $this->CI->load->library('simple_html_dom_lib'); } +//开启了延迟加载 + public function set_lazy_loader($html, $grey_pic) + { + + $html_object = str_get_html($html); + + foreach ($html_object->find('img') as $image) { + $img_src = $image->src; + if (!empty($image->originalsrc)) { + $img_src = $image->originalsrc; + } + $image->src = $grey_pic; + $image->loader = 'lazy'; + $image->originalsrc = $img_src; + } + + return $html_object->save(); + } - //获取图片尺寸 + //获取图片尺寸,$lazy_loader是否开启延迟加载 public function set_image_size($html) { $html_object = str_get_html($html); @@ -34,9 +52,9 @@ class html_optimize_lib $img_src = $image->originalsrc; } //图片已经设置了尺寸的不再修改 - if (empty($image->width) && (strpos($img_src, '//data.') !== false || strpos($img_src, '//images.') !== false)) {//以data或者images开头的域名才能获取尺寸 + if (empty($image->width) && (strpos($img_src, '//data.') !== false || strpos($img_src, '//images.') !== false)) {//以data或者images开头的域名才能获取尺寸 $img_src_urls = parse_url(trim($img_src)); - $request_size[$img_src_urls['host']][] =$img_src_urls['path']; + $request_size[$img_src_urls['host']][] = $img_src_urls['path']; } } @@ -48,7 +66,7 @@ class html_optimize_lib if (!empty($size_data)) { $size_data = json_decode($size_data); foreach ($size_data as $size_item) { - $size_item->photo = "https://".$host . $size_item->photo;//这个作为索引,找到对应url的尺寸 + $size_item->photo = "https://" . $host . $size_item->photo;//这个作为索引,找到对应url的尺寸 $image_sizes[$size_item->photo] = $size_item; } } @@ -62,12 +80,12 @@ class html_optimize_lib $img_src = $image->originalsrc; } //图片已经设置了尺寸的不再修改 - if (empty($image->width) && (strpos($img_src, '//data.') !== false || strpos($img_src, '//images.') !== false)) {//以data或者images开头的域名才能获取尺寸 + if (empty($image->width) && (strpos($img_src, '//data.') !== false || strpos($img_src, '//images.') !== false)) {//以data或者images开头的域名才能获取尺寸 $img_src_urls = parse_url(trim($img_src)); - $img_index="https://".$img_src_urls['host'] . $img_src_urls['path']; - if(!empty($image_sizes[$img_index])){ - $image->width=$image_sizes[$img_index]->width; - $image->height=$image_sizes[$img_index]->height; + $img_index = "https://" . $img_src_urls['host'] . $img_src_urls['path']; + if (!empty($image_sizes[$img_index])) { + $image->width = $image_sizes[$img_index]->width; + $image->height = $image_sizes[$img_index]->height; } } From 91e8a9e2504b7ed015106ed96d523325660545d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Thu, 6 May 2021 14:54:41 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=B8=AD=E5=B9=BF=E5=91=8A=E7=AE=A1=E7=90=86=E5=92=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 12 ++++++++++++ application/models/recommends_and_tips_model.php | 1 + .../third_party/recommend/controllers/tips.php | 2 ++ .../recommend/models/infoTips_model.php | 1 + .../third_party/recommend/views/tips_info.php | 9 ++++++++- .../third_party/recommend/views/welcome.php | 15 +++++++++------ 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 8a65b5d7..92d48090 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -762,6 +762,18 @@ class Information extends CI_Controller $lazy_content=$this->html_optimize_lib->set_lazy_loader($information->ic_content,'https://data.asiahighlights.com/grey.gif'); $template = str_replace('', $lazy_content, $template); + //替换内容中广告 + $temp_array=array(); + preg_match_all('^^', $template, $temp_array); + 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){ + $template = str_replace($temp_array[0][$key], $tips_detail->it_content, $template); + } + } + } + //Google广告代码 //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { $template = str_replace('', '', $template); diff --git a/application/models/recommends_and_tips_model.php b/application/models/recommends_and_tips_model.php index fd35e0b5..fd0e4a10 100644 --- a/application/models/recommends_and_tips_model.php +++ b/application/models/recommends_and_tips_model.php @@ -40,6 +40,7 @@ class recommends_and_tips_model extends CI_Model it.it_id ,it.it_title ,it.it_expires + ,it.it_code ,it.it_content ,it.it_sitecode ,it.it_datetime diff --git a/application/third_party/recommend/controllers/tips.php b/application/third_party/recommend/controllers/tips.php index 9fb699fd..dccf2cd0 100644 --- a/application/third_party/recommend/controllers/tips.php +++ b/application/third_party/recommend/controllers/tips.php @@ -27,6 +27,7 @@ class Tips extends CI_Controller $infoTip->it_title = '新广告'; $infoTip->it_expires = time(); $infoTip->it_content = ''; + $infoTip->it_code = ''; $infoTip->it_datetime = time(); $infoTip->it_sitecode = $this->config->item('site_code'); $infoTip->it_id = $this->infoTips_model->add('infoTips', $infoTip); @@ -75,6 +76,7 @@ class Tips extends CI_Controller $infoTip = new StdClass; $infoTip->it_title = $this->input->post('it_title'); $infoTip->it_expires = strtotime($this->input->post('it_expires')); + $infoTip->it_code = $this->input->post('it_code'); $infoTip->it_content = $this->input->post('it_content'); $infoTip->it_datetime = time(); $infoTip->it_id = $this->infoTips_model->update('infoTips', $infoTip, 'it_id=' . $it_id); diff --git a/application/third_party/recommend/models/infoTips_model.php b/application/third_party/recommend/models/infoTips_model.php index 67b7e637..4745e170 100644 --- a/application/third_party/recommend/models/infoTips_model.php +++ b/application/third_party/recommend/models/infoTips_model.php @@ -32,6 +32,7 @@ class infoTips_model extends CI_Model it.it_id ,it.it_title ,it.it_expires + ,it.it_code ,it.it_content ,it.it_sitecode ,it.it_datetime diff --git a/application/third_party/recommend/views/tips_info.php b/application/third_party/recommend/views/tips_info.php index 3f6419f5..ac998d19 100644 --- a/application/third_party/recommend/views/tips_info.php +++ b/application/third_party/recommend/views/tips_info.php @@ -33,13 +33,20 @@
-
+
+
+
+ + +
+
diff --git a/application/third_party/recommend/views/welcome.php b/application/third_party/recommend/views/welcome.php index 386773c8..4c8efefa 100644 --- a/application/third_party/recommend/views/welcome.php +++ b/application/third_party/recommend/views/welcome.php @@ -1,16 +1,17 @@
-
+
-
+

广告管理

- - + + + @@ -21,10 +22,12 @@ + - + + @@ -35,7 +38,7 @@
#标题#标题代码 过期时间
it_title; ?> it_code); ?> it_expires); ?>
添加广告
-
+

广告和信息推荐绑定设置

is_level == 0) { ?> From 7bbfc81869ee40b3a9d3159074f5aafaa3ee7159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Thu, 6 May 2021 15:24:59 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=AF=E4=BB=A5=E9=80=89=E6=8B=A9=E6=9C=88?= =?UTF-8?q?=E4=BB=BD=E5=92=8C=E5=B9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/recommend/views/tips_info.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/third_party/recommend/views/tips_info.php b/application/third_party/recommend/views/tips_info.php index ac998d19..f0f9b053 100644 --- a/application/third_party/recommend/views/tips_info.php +++ b/application/third_party/recommend/views/tips_info.php @@ -15,7 +15,9 @@ $(function () { $("#it_expires").datepicker({ - showButtonPanel: true + showButtonPanel: true, + changeMonth:true, + changeYear:true }); }) From 87ae9f301da8529da59c5e7f6119c1d1f5d809a9 Mon Sep 17 00:00:00 2001 From: candice Date: Fri, 7 May 2021 14:09:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=96=B0=E7=AA=97=E5=8F=A3=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/mobile_first/ah-pc.php | 92 ++++++++++++------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/application/views/mobile_first/ah-pc.php b/application/views/mobile_first/ah-pc.php index 7fa5062c..e406b1ef 100644 --- a/application/views/mobile_first/ah-pc.php +++ b/application/views/mobile_first/ah-pc.php @@ -51,18 +51,18 @@ @@ -76,18 +76,18 @@ Best Time to Visit
@@ -96,19 +96,19 @@ Top Things to Do
@@ -116,27 +116,27 @@
- - +