您的位置:澳门402永利com > 关于计算机 > destoon完结后面部分增多你是第几人访员的主意

destoon完结后面部分增多你是第几人访员的主意

发布时间:2019-09-23 20:45编辑:关于计算机浏览(159)

    日常会看到有的网址有附近 您是第位访客字样的计数总结,这里大家来促成把那些总结成效丰硕到destoon的底层,呈现你是第几问访谈者 的意义。此处的计数器与网址流量总结有分别,记录的是刷新次数,却非收视返听记录访谈者的IP,对于须要真正实行总计的爱侣能够特别全面代码以满足本身需要。

    上面就来说一下切实的贯彻形式:

    开采尾巴部分footer.htm的文书,找到<a href="{$MODULE[1][linkurl]}" rel="external nofollow" >再次回到首页</a>,在后头加上这段代码:

    <script language="JavaScript">
    <!--
    var caution = false
    function setCookie(name, value, expires, path, domain, secure) {
        var curCookie = name + "=" + escape(value) +
            ((expires) ? "; expires=" + expires.toGMTString() : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "")
        if (!caution || (name + "=" + escape(value)).length <= 4000)
            document.cookie = curCookie
        else
            if (confirm("Cookie exceeds 4KB and will be cut!"))
                document.cookie = curCookie
    }
    function getCookie(name) {
        var prefix = name + "="
        var cookieStartIndex = document.cookie.indexOf(prefix)
        if (cookieStartIndex == -1)
            return null
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
        if (cookieEndIndex == -1)
            cookieEndIndex = document.cookie.length
        return (document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
    }
    function deleteCookie(name, path, domain) {
        if (getCookie(name)) {
            document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT"
        }
    }
    function fixDate(date) {
        var base = new Date(0)
        var skew = base.getTime()
        if (skew > 0)
            date.setTime(date.getTime() - skew)
    }
    var now = new Date()
    fixDate(now)
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)
    var visits = getCookie("counter")
    if (!visits)
        visits = 1
    else
        visits = parseInt(visits) + 1
    setCookie("counter", visits, now)
    document.write("您是第 " + visits + " 个来到本站访客")
    // -->
    </script>
    

    本文由澳门402永利com发布于关于计算机,转载请注明出处:destoon完结后面部分增多你是第几人访员的主意

    关键词: