public static function addCountJS($shortname, $extraVars = NULL) { if (self::$addCountJS) { $script = "\n\t\t\t var disqus_shortname = '" . $shortname . "'; // required: replace example with your forum shortname\n\t\t\t " . $extraVars . "\n\t\t\t\n\t\t\t (function () {\n\t\t\t var s = document.createElement('script'); s.async = true;\n\t\t\t s.type = 'text/javascript';\n\t\t\t s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';\n\t\t\t (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);\n\t\t\t }());\n\t\t\t"; Requirements::customScript($script); self::$addCountJS = false; } }
function disqusCountLink() { $config = SiteConfig::current_site_config(); if ($config->disqus_shortname) { DisqusCount::addCountJS($config->disqus_shortname, $this->owner->disqusLocaleJsVar() . $this->owner->disqusDeveloperJsVar()); } return '<a href="' . $this->owner->absoluteLink() . '#disqus_thread" title="' . $this->owner->Title . '" data-disqus-identifier="' . $this->disqusIdentifier() . '">' . _t("Disqus.COMMENTS", "Comments") . '</a>'; }