Disqus为动态页面加载相同的注释

Sta*_*ley 7 javascript disqus

我有一个动态页面,可以加载不同的想法.我正在使用disqus作为评论,但是disqus继续为每个想法加载相同的评论.

这是网站.http://tech-in.org/submitted_ideas/index.php.

这是我的代码

<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
     if( typeof DISQUS != 'undefined' ) { 
      DISQUS.reset({ 
        reload: true, 
         config: function () { 
           this.page.identifier = '<?php echo $title; ?>'; 
           this.page.url = 'http://tech-in.org/submitted_ideas/idea.php?id=<?php echo $idea_id; ?>'; 
         } 
       }); 
    } 
    var disqus_shortname = 'techinorg'; // required: replace example with your forum shortname
    var disqus_identifier = '<?php echo $title; ?>';
    var disqus_url = 'http://tech-in.org/submitted_ideas/idea.php?id=<?php echo $idea_id; ?>';
    var disqus_title = document.getElementById('disqus_post_title').innerHTML;
    var disqus_message = document.getElementById('disqus_post_message').innerHTML;


    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
Run Code Online (Sandbox Code Playgroud)

请帮助解决导致错误的原因以及我该怎么做才能解决它

che*_*ken 5

Disqus根据disqus_identifier您指定的内容决定加载哪些注释.加载不同的"想法"时,请确保提供disqus_identifier与该想法相对应的唯一"想法" .(目前还不清楚$titlePHP脚本中代表什么,这是当前被分配给的disqus_identifier.)


Jak*_*kub 5

看起来您的标识符不够独特,请参阅此处的参考文档:http://docs.disqus.com/help/14/

它指出:

当访问Disqus启用Disqus页面时,Disqus使用此标识符来确定要加载的相应注释线程.如果找不到相应的线程,则会创建一个新线程.Disqus标识符保持线程和页面关联.