tweaks+disqus
authorMichael Wallner <mike@php.net>
Thu, 7 Nov 2013 13:32:16 +0000 (14:32 +0100)
committerMichael Wallner <mike@php.net>
Thu, 7 Nov 2013 13:32:16 +0000 (14:32 +0100)
index.css
index.js
index.php

index 9b36eb64b59af0747ad45828c14a30a1bb36c3a3..994405e42381e17d2f994f8252a495db2cd90eaa 100644 (file)
--- a/index.css
+++ b/index.css
@@ -63,7 +63,8 @@ p, pre {
 }
 
 blockquote {
-       border: 1px solid #800000;
+       border-top: 1px solid #800000;
+       border-bottom: 1px solid #800000;
        background: #ffe4e1;
        margin: 2em 0;
 }
@@ -134,6 +135,11 @@ li h3 a:hover {
        text-decoration: underline;
 }
 
+#disqus_thread {
+       margin-top: 8em;
+       margin-right: 2em;
+}
+
 footer {
        font-size: smaller;
        text-align: center;
index 5f384ca09d2d24129d0dab53bbd93eeb76cbf57e..feaf66e439f9a8286f859980bdc553544ae6f2cb 100644 (file)
--- a/index.js
+++ b/index.js
@@ -31,6 +31,7 @@ function type(s, nn) {
        case "int":
        case "float":
        case "string":
+       case "resource":
        case "array":
        case "object":
        case "callable":
index 7ae8e478efa5eac7432ab39c0d68dd2e4b524cd4..192c9ea89a6251a677cadc870347df5d06dcf6ba 100644 (file)
--- a/index.php
+++ b/index.php
@@ -263,12 +263,26 @@ ob_start($s);
        <?php else: ?>
                <?php md($p, $s); ?>
        <?php endif; ?>
+       
+       <div id="disqus_thread"></div>
+       
        <footer>
                <a href="VERSION">Version</a>
                <a href="AUTHORS">Authors</a>
                <a href="LICENSE">License</a>
        </footer>
        <script src="index.js"></script>
+       <?php if ($_SERVER["SERVER_NAME"] != "localhost") : ?>
+    <script>
+        var disqus_shortname = 'mdref';
+        var disqus_identifier = '<?=$p?>';
+        (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; ?>
 </body>
 </html>
 <?php