Question2Answer的统计添加

来源:互联网 发布:51单片机的引脚功能 编辑:程序博客网 时间:2024/06/01 08:45

第一步、上http://www.cnzz.com网站,注册账号,然后填写你的网站信息,获取到它的脚本。

第二步、复制它的脚本到你的网页的脚本中。例如:

找到/qa-include/qa-theme-base.php文件,对下面函数进行修改即可。


                function attribution()

                {

                        // Hi there. I'd really appreciate you displaying this link on your Q2A site. Thank you - Gideon


                        $this->output(

                                '<div class="qa-attribution">',

                                'Powered by <a href="http://www.question2answer.org/">Question2Answer</a>',

                                '</div>'

                        );


                        // forlong401 adds them for tongji.这里省略一些个人信息,<script>这个标签内的就是从CNZZ拷贝过来的源码脚本。注意,如果出现单引号“'”那么你需要添加反斜杠\来进行转义。

                        $this->output(

                                '<div class="cnzz-attribution">',

                                '<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");</script>',

                                '</div>'

                        );



0 0
原创粉丝点击