[更新]修改视图过滤

This commit is contained in:
Anyon 2017-07-13 18:45:22 +08:00
parent a0f5571595
commit 715de9518b

View File

@ -56,13 +56,14 @@ class FilterView
public function baidu(&$params) public function baidu(&$params)
{ {
if (($key = sysconf('tongji_baidu_key'))) { if (($key = sysconf('tongji_baidu_key'))) {
$https = Request::instance()->isSsl() ? 'https' : 'http';
$script = <<<SCRIPT $script = <<<SCRIPT
\n<!-- 百度统计 开始 --> \n<!-- 百度统计 开始 -->
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function() {
var hm = document.createElement("script"); var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?{$key}"; hm.src = "{$https}://hm.baidu.com/hm.js?{$key}";
var s = document.getElementsByTagName("script")[0]; var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();