【问题标题】:Addind DISCUS commenting system to your site将 DISQUS 评论系统添加到您的站点
【发布时间】:2016-05-21 11:13:52
【问题描述】:

我们可以将 DISCUSS 评论系统添加到自定义 PHP 网站吗?我知道如何在 wordpress 网站上添加它,但我想知道我是否可以将 DISCUS 与用 PHP 定制的网站集成

【问题讨论】:

标签: php comments blogs


【解决方案1】:

是的Disqus 它真的很容易安装在任何网站上:) 您只需将此代码放入您的网站:

HTML

<div id="disqus_thread"></div>
<script>
    /**
     *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
     *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
     */
    /*
    var disqus_config = function () {
        this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };
    */
    (function() {  // REQUIRED CONFIGURATION VARIABLE: EDIT THE SHORTNAME BELOW
        var d = document, s = d.createElement('script');

        s.src = '//EXAMPLE.disqus.com/embed.js';  // IMPORTANT: Replace EXAMPLE with your forum shortname!

        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>

【讨论】:

  • 我有这段代码,但请告诉我我必须在这段代码中进行哪些更改才能使其与我的网站一起使用。
【解决方案2】:

转到https://disqus.com/admin/create 并注册新站点,然后单击“通用代码”并将其添加到您的站点,如示例所示。 另外,检查disqus configuration variables

【讨论】:

  • 我有这段代码,但请告诉我我必须在这段代码中进行哪些更改才能使其与我的网站一起使用
  • 这是默认的,只需粘贴到您的站点并将 PAGE_URL 和 PAGE_IDENTIFIER 更改为您自己的(url 必须是绝对的,页面标识符必须是唯一的)。但是,如果您想要其他功能,请查看disqus configuration variables
猜你喜欢
  • 2011-08-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-13
  • 1970-01-01
  • 2014-03-11
  • 2015-12-10
  • 2011-05-23
相关资源
最近更新 更多