disqus got lost while refactoring
[mdref/mdref] / views / layout.phtml
index 43463ca9f7a5c61328870298921972cceeb76395..2a7d3d18a0fdc7453867854dc335999734efe3ad 100644 (file)
@@ -3,11 +3,10 @@
        <head>
                <meta charset="utf-8">
                <title>
-                       <?php if ($title) : ?>
-                               <?= $title ?> - mdref
-                       <?php else: ?>
-                               mdref
+                       <?php if (!empty($title)) : ?>
+                               <?= $title ?> -
                        <?php endif; ?>
+                       mdref
                </title>
                <base href="<?= $baseUrl ?>">
                <link rel="stylesheet" href="index.css">
                        <?php include __DIR__."/index.phtml" ?>
                <?php endif; ?>
 
+               <?php if ($_SERVER["SERVER_NAME"] != "localhost2") : ?>
                <div id="disqus_thread"></div>
+               <script>
+                       var disqus_shortname = 'mdref';
+                       var disqus_identifier = '<?=$permUrl?>';
+                       (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" ?>