/** * * HOW USE IT ? * * Change the line #21 in this file * * Showing the comments counter for the News module > Summary Template : * {capture name=xxx assign=sid}news_{$entry->id}{/capture}{disqus counter=$sid} * * * Showing comments form for the News module > Detail Template : * {capture name=xxx assign=sid}news_{$entry->id}{/capture}{disqus comments=$sid} * * * Licence : GNU General Public License (GPL) * **/ $d_Shortname = ""; //<--- #### CHANGE THIS BY YOU OWN "disqus shortname". More informations on http://disqus.com/ // ### DON'T CHANGE ANYTHING BEYOND THIS LINE ### if(empty($d_Shortname)) { $alert = <<You forgot specify the \$d_Shortname variable in this UDT ! HTML; echo $alert; return; } else if(empty($params['comments']) & empty($params['counter'])) { $alert = <<Exemple of Usage.
Showing the comments counter for the News module > Summary Template :
{capture name=xxx assign=sid}news_{\$entry->id}{/capture}{disqus counter=\$sid}
<a href="{\$entry->moreurl}#disqus_thread" title='see the comments'/> </a>
Showing comments form for the News module > Detail Template :
{capture name=xxx assign=sid}news_{\$entry->id}{/capture}
{disqus comments=\$sid}
The disqus official documentation may also help you :)
HTML; echo $alert; return; } if(!empty($params['comments'])) { $d_identifier = $params['comments']; $script = << blog comments powered by Disqus HTML; echo $script; } elseif(!empty($params['counter'])) { $d_identifier = $params['counter']; $script = << /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = "$d_Shortname"; // required: replace example with your forum shortname var disqus_identifier = "$d_identifier"; /* * * DON'T EDIT BELOW THIS LINE * * */ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); HTML; echo $script; } else { echo '