添加文中广告

hotfix/paypal-note
尹诚诚 4 years ago
parent 47a9ce1e3f
commit eb79a978f0

@ -795,12 +795,12 @@ class Information extends CI_Controller
//替换内容中广告 //替换内容中广告
$temp_array = array(); $temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $template, $temp_array); preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $information->ic_content, $temp_array);
if (!empty($temp_array[1])) { if (!empty($temp_array[1])) {
foreach ($temp_array[1] as $key => $item) { foreach ($temp_array[1] as $key => $item) {
$tips_detail = $this->recommends_and_tips_model->tips_detail($item); $tips_detail = $this->recommends_and_tips_model->tips_detail($item);
if ($tips_detail) { 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('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content); $information->ic_content = str_replace('<!--@Content-Recommends-Tour@-->', $this->load->view($template_path . '-recommends-tour', array('recommands' => $template_recommand), TRUE), $information->ic_content);
} }
//替换内容中广告
$temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $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'))) { if (empty(get_meta($information->ic_id, 'meta_product_code'))) {
$addthis_widget = $this->load->view($template_path . '-add-this', false, true); $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'); $lazy_content = $this->html_optimize_lib->set_lazy_loader($information->ic_content, 'https://data.asiahighlights.com/grey.gif');
$template = str_replace('<!--@CUSTOM-CONENT@-->', $lazy_content, $template); $template = str_replace('<!--@CUSTOM-CONENT@-->', $lazy_content, $template);
//替换内容中广告
$temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $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广告代码 //Google广告代码
//if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) { //if (!empty(get_meta($information->ic_id, 'meta_google_ad_content'))) {

Loading…
Cancel
Save