From 3545e692bcb7fbce914b6cfa8d6c03d01b23b446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Fri, 15 Oct 2021 14:06:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=B8=AD?= =?UTF-8?q?=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 16 ++++++++++++---- .../third_party/recommend/views/bind.php | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 87172bd4..fe71420b 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -420,8 +420,8 @@ class Information extends CI_Controller //读取模板生成PC和移动优先文件 $recommand_information = $this->recommand_information($information); $information_new = $this->Information_model->Detail($this->input->post('is_id')); - $this->make_www_cache_ah('mobile', $information_new,$recommand_information); - $this->make_www_cache_ah('pc', $information_new,$recommand_information); + $this->make_www_cache_ah('mobile', $information_new, $recommand_information); + $this->make_www_cache_ah('pc', $information_new, $recommand_information); } else if (strcasecmp($site_code, "gh") == 0 && !empty($auto_update_cache)) { $information_new = $this->Information_model->Detail($this->input->post('is_id')); $this->make_www_cache_gh($information_new); @@ -785,6 +785,10 @@ class Information extends CI_Controller $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } + //文中广告 + if (!empty($template_recommand['Tips Content']) && strpos($information->ic_content, '') !== false) { + $information->ic_content = str_replace('', $template_recommand['Tips Content']->it_content, $information->ic_content); + } //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { @@ -987,12 +991,16 @@ class Information extends CI_Controller //推荐信息或者产品 //信息推荐 - $template_recommand =$recommand_information;// $this->recommand_information($information); + $template_recommand = $recommand_information;// $this->recommand_information($information); $template = str_replace('', $this->load->view($template_path . '-next', array('recommands' => $template_recommand), TRUE), $template); //广告,改叫tips,防止被插件屏蔽 if (!empty($template_recommand['Tips Right'])) { $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } + //文中广告 + if (!empty($template_recommand['Tips Content']) && strpos($information->ic_content, '') !== false) { + $information->ic_content = str_replace('', $template_recommand['Tips Content']->it_content, $information->ic_content); + } //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content); @@ -1409,7 +1417,7 @@ class Information extends CI_Controller $data = $this->Information_model->random(1, $root_information->is_path, $exclude_ids); break; case 'rule_this_node_random'://指定节点下随机 - $ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id,'is_path'); + $ir_pointer = $this->Information_model->Detail($recommand->ir_pointer_is_id, 'is_path'); if (!empty($ir_pointer)) { $data = $this->Information_model->random(1, $ir_pointer->is_path, $exclude_ids); } diff --git a/application/third_party/recommend/views/bind.php b/application/third_party/recommend/views/bind.php index f17378dd..08228b45 100644 --- a/application/third_party/recommend/views/bind.php +++ b/application/third_party/recommend/views/bind.php @@ -112,6 +112,25 @@ +
+

<!--@TIPS-CONTENT@-->

+
+
+
+
+
文中广告
+
+ ir_rule . '
' . $recommends['Tips Content']->ir_keyword; ?> +
+
+
+
+ +

<!--@Content-Recommends-Tour@-->

From 47a9ce1e3f825fd62759af0ef17f08264afa630e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Fri, 15 Oct 2021 14:27:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=B8=AD?= =?UTF-8?q?=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 22 ++++++++++--------- .../third_party/recommend/views/bind.php | 19 ---------------- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index fe71420b..cd934257 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -784,12 +784,6 @@ class Information extends CI_Controller if (!empty($template_recommand['Tips Right'])) { $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } - - //文中广告 - if (!empty($template_recommand['Tips Content']) && strpos($information->ic_content, '') !== false) { - $information->ic_content = str_replace('', $template_recommand['Tips Content']->it_content, $information->ic_content); - } - //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content); @@ -799,6 +793,18 @@ class Information extends CI_Controller $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content); } + //替换内容中广告 + $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); + } + } + } + //顶部全屏大图 if ($device == 'mobile') { //移动端读取移动大图 $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); @@ -997,10 +1003,6 @@ class Information extends CI_Controller if (!empty($template_recommand['Tips Right'])) { $template = str_replace('', "
" . $template_recommand['Tips Right']->it_content . "
", $template); } - //文中广告 - if (!empty($template_recommand['Tips Content']) && strpos($information->ic_content, '') !== false) { - $information->ic_content = str_replace('', $template_recommand['Tips Content']->it_content, $information->ic_content); - } //文中的信息推荐 if (strpos($information->ic_content, '') !== false) { $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-article', array('recommands' => $template_recommand), TRUE), $information->ic_content); diff --git a/application/third_party/recommend/views/bind.php b/application/third_party/recommend/views/bind.php index 08228b45..f17378dd 100644 --- a/application/third_party/recommend/views/bind.php +++ b/application/third_party/recommend/views/bind.php @@ -112,25 +112,6 @@ -
-

<!--@TIPS-CONTENT@-->

-
-
-
-
-
文中广告
-
- ir_rule . '
' . $recommends['Tips Content']->ir_keyword; ?> -
-
-
-
- -

<!--@Content-Recommends-Tour@-->

From eb79a978f02b2ca65701997d630f49ba37d031d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Fri, 15 Oct 2021 16:05:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=B8=AD?= =?UTF-8?q?=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 27 +++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index cd934257..dcb39055 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -795,12 +795,12 @@ class Information extends CI_Controller //替换内容中广告 $temp_array = array(); - preg_match_all('^^', $template, $temp_array); + preg_match_all('^^', $information->ic_content, $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); + $information->ic_content = str_replace($temp_array[0][$key], $tips_detail->it_content, $information->ic_content); } } } @@ -1012,6 +1012,18 @@ class Information extends CI_Controller $information->ic_content = str_replace('', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content); } + //替换内容中广告 + $temp_array = array(); + preg_match_all('^^', $information->ic_content, $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) { + $information->ic_content = str_replace($temp_array[0][$key], $tips_detail->it_content, $information->ic_content); + } + } + } + //非产品页面 if (empty(get_meta($information->ic_id, 'meta_product_code'))) { $addthis_widget = $this->load->view($template_path . '-add-this', false, true); @@ -1043,17 +1055,6 @@ 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'))) {