Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disqus Loading the same comments for dynamic pages

I have a dynamic page that loads different ideas. I am using disqus for the comments, but disqus keeps loading the same comments for each idea.

Here is the website. http://tech-in.org/submitted_ideas/index.php.

Here is my code

<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>

Please kindly help with what is causing the error and what can i do to resolve it

like image 276
Stanley Avatar asked Jan 20 '12 16:01

Stanley


2 Answers

Disqus decides which comments to load based on the disqus_identifier you specify. When a different "idea" is loaded, ensure that you provide a unique disqus_identifier that corresponds to that idea. (It's not clear what $title represents in your PHP script, which is what is currently being assigned to disqus_identifier.)

like image 115
cheeken Avatar answered Sep 28 '22 05:09

cheeken


Looks like your identifier is not unique enough, see reference documentation here: http://docs.disqus.com/help/14/

It states:

When Disqus-enabled pages are visited, Disqus uses this identifier to determine the appropriate comment thread to load. If the appropriate thread could not be found, a new thread is created. Disqus identifiers keep threads and pages associated.

like image 27
Jakub Avatar answered Sep 28 '22 05:09

Jakub