增加 ezoic 识别

hotfix/paypal-note
Jimmy Liow 3 years ago
parent 6a6e6d150c
commit 048d000245

@ -664,11 +664,12 @@ class Information extends CI_Controller
$template = str_replace('<!--@TRAIN-SEARCH@-->', $template_TrainSearch, $template); $template = str_replace('<!--@TRAIN-SEARCH@-->', $template_TrainSearch, $template);
} }
//非产品页面
$meta_product_code = get_meta($information->ic_id, 'meta_product_code'); $meta_product_code = get_meta($information->ic_id, 'meta_product_code');
$meta_google_ad_article = get_meta($information->ic_id, 'meta_google_ad_article');
//非产品页面
if (empty($meta_product_code)) { if (empty($meta_product_code)) {
$ads_by_google = !empty(get_meta($information->ic_id, 'meta_google_ad_article')); $ads_by_google = !empty($meta_google_ad_article);
//H1模板替换 //H1模板替换
$data_H1 = array(); $data_H1 = array();
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容 $data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
@ -835,6 +836,19 @@ 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);
} }
// 未勾选In Article 广告时,加入标签 <meta name="ezoic" content="noads"/>,让 ezoic 识别出该页面不展示广告。
if (empty($meta_google_ad_article)) {
$information->ic_content = str_replace(
'<!--@Meta-Ezoic-NoAds@-->',
'<meta name="ezoic" content="noads"/>',
$information->ic_content);
} else {
$information->ic_content = str_replace(
'<!--@Meta-Ezoic-NoAds@-->',
'',
$information->ic_content);
}
//替换内容中广告 //替换内容中广告
$temp_array = array(); $temp_array = array();
preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $information->ic_content, $temp_array); preg_match_all('^<!--@TIPS-[A-Z]+-([0-9]+)@-->^', $information->ic_content, $temp_array);

@ -9,6 +9,7 @@
<meta name="apple-mobile-web-app-title" content="China Highlights - Since 1998!"> <meta name="apple-mobile-web-app-title" content="China Highlights - Since 1998!">
<meta name="keywords" content="<!--@KEYWORDS@-->"> <meta name="keywords" content="<!--@KEYWORDS@-->">
<meta name="description" content="<!--@DESCRIPTION@-->"> <meta name="description" content="<!--@DESCRIPTION@-->">
<!--@Meta-Ezoic-NoAds@-->
<!--@OG:IMAGE@--> <!--@OG:IMAGE@-->
<link rel="canonical" href="<!--@CANONICAL@-->"> <link rel="canonical" href="<!--@CANONICAL@-->">
<link rel="shortcut icon" href="https://data.chinahighlights.com/favicon.ico"> <link rel="shortcut icon" href="https://data.chinahighlights.com/favicon.ico">

@ -5,6 +5,9 @@
<title><!--@TITLE@--></title> <title><!--@TITLE@--></title>
<meta name="keywords" content="<!--@KEYWORDS@-->"> <meta name="keywords" content="<!--@KEYWORDS@-->">
<meta name="description" content="<!--@DESCRIPTION@-->"> <meta name="description" content="<!--@DESCRIPTION@-->">
<meta content="width=device-width,minimum-scale=1,initial-scale=1" name="viewport">
<!--@Meta-Ezoic-NoAds@-->
<!--@OG:IMAGE@-->
<link rel="canonical" href="<!--@CANONICAL@-->"> <link rel="canonical" href="<!--@CANONICAL@-->">
<link rel="preconnect" href="https://data.chinahighlights.com"> <link rel="preconnect" href="https://data.chinahighlights.com">
<link rel="preconnect" href="https://images.chinahighlights.com"> <link rel="preconnect" href="https://images.chinahighlights.com">
@ -13,8 +16,6 @@
<link rel="dns-prefetch" href="https:/www.googletagmanager.com"> <link rel="dns-prefetch" href="https:/www.googletagmanager.com">
<link rel="dns-prefetch" href="https://www.googleadservices.com"> <link rel="dns-prefetch" href="https://www.googleadservices.com">
<link rel="dns-prefetch" href="https://www.google-analytics.com"> <link rel="dns-prefetch" href="https://www.google-analytics.com">
<meta content="width=device-width,minimum-scale=1,initial-scale=1" name="viewport">
<!--@OG:IMAGE@-->
<link rel="shortcut icon" href="https://data.chinahighlights.com/favicon.ico"> <link rel="shortcut icon" href="https://data.chinahighlights.com/favicon.ico">
<!--@MAIN-CSS@--> <!--@MAIN-CSS@-->
<!--@ADDON-CSS@--> <!--@ADDON-CSS@-->

Loading…
Cancel
Save