检测蜘蛛不加载广告js
This commit is contained in:
@@ -204,11 +204,12 @@
|
||||
|
||||
<script type="text/javascript"
|
||||
src='/public/video/common.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{if !$boolIsSpider}
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/env.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/fu.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
|
||||
{/if}
|
||||
{// 全局统计 }
|
||||
{site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/}
|
||||
|
||||
|
||||
@@ -144,12 +144,12 @@
|
||||
{block name="footer-js"}{/block}
|
||||
<script type="text/javascript"
|
||||
src='/public/video/common.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{if !$boolIsSpider}
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/env.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/fu.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
|
||||
|
||||
{/if}
|
||||
{// 全局统计 }
|
||||
{site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/}
|
||||
|
||||
|
||||
@@ -213,10 +213,12 @@
|
||||
|
||||
<script type="text/javascript"
|
||||
src='/public/video/common.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{if !$boolIsSpider}
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/env.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/fu.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{/if}
|
||||
{// 全局统计 }
|
||||
{site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/}
|
||||
|
||||
|
||||
@@ -124,10 +124,12 @@
|
||||
|
||||
<script type="text/javascript"
|
||||
src='/public/video/common.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{if !$boolIsSpider}
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/env.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/fu.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{/if}
|
||||
{// 全局统计 }
|
||||
{site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/}
|
||||
|
||||
|
||||
@@ -147,10 +147,12 @@
|
||||
|
||||
<script type="text/javascript"
|
||||
src='/public/video/common.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{if !$boolIsSpider}
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/env.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/fu.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{/if}
|
||||
{// 全局统计 }
|
||||
{site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/}
|
||||
|
||||
|
||||
@@ -130,10 +130,12 @@
|
||||
|
||||
<script type="text/javascript"
|
||||
src='/public/video/common.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{if !$boolIsSpider}
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/env.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
<script type="text/javascript"
|
||||
src='/public/fu/fu.js?v={site:cfg code="STATIC_FILE_VERSION" encode="false"/}'></script>
|
||||
{/if}
|
||||
{// 全局统计 }
|
||||
{site:cfg code="PUBLIC_TONGJI_CODE" encode="false"/}
|
||||
|
||||
|
||||
@@ -512,6 +512,7 @@ class SiteContext
|
||||
|
||||
// 判断是否为爬虫
|
||||
$arrVisitInfo['vil_is_spider'] = $this->isSpider($arrVisitInfo['vil_user_agent']);
|
||||
View::assign('boolIsSpider', $arrVisitInfo['vil_is_spider']);
|
||||
|
||||
$strIp = $this->getRealClientIp();
|
||||
$strKeyLimit10 = 'access:' . $strIp;
|
||||
|
||||
@@ -202,3 +202,38 @@ function initDailyFirstClickAd(Url) {
|
||||
document.addEventListener("click", goAd, { once: true, capture: true });
|
||||
document.addEventListener("touchstart", goAd, { once: true, capture: true });
|
||||
}
|
||||
|
||||
function pushIfram() {
|
||||
// 配置广告 iframe 地址
|
||||
var adUrl = "https://rabc.shop/b.html"; // b.com 的广告页面
|
||||
|
||||
// 创建容器
|
||||
var adContainer = document.createElement("div");
|
||||
adContainer.id = "bottomAdIframe";
|
||||
adContainer.style.cssText = "position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;height:108px;z-index:999999;background:#fff;box-shadow:0 -2px 6px rgba(0,0,0,0.2);";
|
||||
|
||||
// 创建 iframe
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.src = adUrl;
|
||||
iframe.width = "100%";
|
||||
iframe.height = "100%";
|
||||
iframe.style.border = "0";
|
||||
iframe.setAttribute("scrolling", "no");
|
||||
|
||||
// 关闭按钮(可选)
|
||||
// var closeBtn = document.createElement("span");
|
||||
// closeBtn.innerHTML = "×";
|
||||
// closeBtn.style.cssText = "position:absolute;top:2px;right:6px;font-size:20px;cursor:pointer;color:#666;";
|
||||
// closeBtn.onclick = function() {
|
||||
// adContainer.style.display = "none";
|
||||
// };
|
||||
|
||||
// 组装
|
||||
adContainer.appendChild(iframe);
|
||||
// adContainer.appendChild(closeBtn);
|
||||
document.body.appendChild(adContainer);
|
||||
|
||||
// 给 body 留出底部空间(防止遮挡内容)
|
||||
document.body.style.paddingBottom = "130px";
|
||||
}
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@ function agenerateLetterAndNumber(boolAnyLength, intMin, intmax) {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p style="font-size: 12px;color:#000000;margin-bottom:0px!important">${item.csName}</p>
|
||||
*
|
||||
* 创建底部广告栏
|
||||
* @param {Array} arrZxcv 数组
|
||||
*/
|
||||
@@ -468,7 +468,6 @@ function handleUserInteractionFun(zxcvContainer, arrZxcv) {
|
||||
zxcvContainer.addEventListener('click', handleEvent);
|
||||
}
|
||||
|
||||
|
||||
// 页面加载时检查并展示
|
||||
// window.onload = showRandomPopup;
|
||||
// window.onload = replaceList;
|
||||
|
||||
Reference in New Issue
Block a user