[更新]修改视图行为过滤

This commit is contained in:
Anyon 2017-07-10 11:37:14 +08:00
parent 04d87df49e
commit 60a8c0ff38

View File

@ -57,17 +57,19 @@ class FilterView
{
if (($key = sysconf('tongji_baidu_key'))) {
$script = <<<SCRIPT
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?{$key}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
\n<!-- 百度统计 开始 -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?{$key}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- 百度统计 结束 -->\n\n
SCRIPT;
$params = preg_replace('|</body>|i', "{$script}\n </body>", $params);
$params = preg_replace('|</body>|i', "{$script}</body>", $params);
}
}