Last active
December 19, 2015 19:58
-
-
Save benlk/6009835 to your computer and use it in GitHub Desktop.
Disqus-based comments system for @dropplets. Based on https://gist.github.com/jazzsequence/5144026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php ?> | |
<div id="disqus_thread"></div> | |
<!-- Disqus comment code from http://disqus.com/admin/universalcode/ --> | |
<script type="text/javascript" src="<?php print($template_dir_url); ?>custom/comments-disqus-js.js"> | |
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ | |
var disqus_shortname = 'benlk'; // required: replace example with your forum shortname | |
/* * * More information available at http://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables */ | |
var disqus_identifier = <?php echo( "'" . $slug . "'" ) ?>; // optional . this line sets a unique identifier that disqus uses to track comments by post. Change it to something else if you want to. | |
var disqus_title = <?php echo( "'" . $post_title . "'" ) ?>; // this sets the post title, for Disqus\' purposes. | |
var disqus_url = <?php echo ( "'" . $post_link . "'" ) ?>; // this sets the post URL, for Disqus\' purposes. | |
var disqus_category_id = <?php echo ( "'" . $post_category . "'" ) ?>; // this sets the post category, for Disqus\' purposes. | |
/* * * DON'T EDIT BELOW THIS LINE * * */ | |
(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> | |
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | |
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Add this line to your post.php to get the Disqus comments. | |
In this example, comments-disqus.php is placed in the theme folder, not in any subdirectory. | |
Other options include: | |
'folder-within-theme-folder/comments-disqus.php' | |
'/folder-at-the-root-of-the-site/comments-disqus.php' | |
$blog_url . 'comments-disqus.php' if Dropplets is not installed in the domain root directory | |
--> | |
<?php /* do Disqus comments stuff */ include('comments-disqus.php'); ?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment