load disqus only on request
[mdref/mdref] / views / layout.phtml
index e4d438d51e4c654aaeda248225ab85d6d1911c69..e49d520fe8a9c66509d00ab6f77c69bc9e85ac31 100644 (file)
                        <?php include __DIR__."/index.phtml" ?>
                <?php endif; ?>
 
-               <?php if (@$_SERVER["SERVER_NAME"] != "localhost") : ?>
-
-                       <div id="disqus_thread"></div>
+                       <div id="disqus_thread"><button id="disqus_activator">Show <span> </span> Comment(s)</button></div>
                        <script>
                                var disqus_shortname = 'mdref';
                                var disqus_identifier = '<?=$ref?>';
-                               (function() {
-                                       var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
-                                       dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
-                                       (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
-                               })();
                        </script>
-               <?php endif; ?>
 
                        <footer>
                                <?php include __DIR__."/footer.phtml" ?>