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
Disqus decides which comments to load based on the
disqus_identifier
you specify. When a different "idea" is loaded, ensure that you provide a uniquedisqus_identifier
that corresponds to that idea. (It's not clear what$title
represents in your PHP script, which is what is currently being assigned todisqus_identifier
.)