Source of file DisqusCount.php
Size: 0,968 Bytes - Last Modified: 2021-12-23T10:36:37+00:00
/var/www/docs.ssmods.com/process/src/code/DisqusCount.php
12345678910111213141516171819202122232425262728293031323334353637 | <?php /** * Control Disqus Count JS * * @package silverstripe-disqus-module * @author Pavol Ondráš <admin_silverstripe.sk> * @notice SilverStripe.sk is not affiliated with the company SilverStripe Ltd. * @date April 2011 */ class DisqusCount { protected static $addCountJS = true; public static function addCountJS($shortname,$extraVars = NULL) { if (self::$addCountJS) { $script = " var disqus_shortname = '".$shortname."'; // required: replace example with your forum shortname ".$extraVars." (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = 'https://' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); "; Requirements::customScript($script); self::$addCountJS = false; } } } // EOF |