Browse Source

Add disqus recent comments

Add disqus recent comments to the core.
pull/31/merge
Danang Probo Sayekti 11 years ago
parent
commit
2591e69497
3 changed files with 59 additions and 1 deletions
  1. +48
    -0
      system/includes/functions.php
  2. +6
    -1
      themes/logs/css/style.css
  3. +5
    -0
      themes/logs/layout.html.php

+ 48
- 0
system/includes/functions.php View File

@ -848,6 +848,54 @@ EOF;
} }
} }
// Disqus recent comments
function recent_comments(){
$disqus = config('disqus.shortname');
$script = <<<EOF
<script type="text/javascript">
var heading ='<h3>Comments</h3>';
document.write(heading);
</script>
<script type="text/javascript" src="http://{$disqus}.disqus.com/recent_comments_widget.js?num_items=5&hide_avatars=0&avatar_size=48&excerpt_length=200&hide_mods=0"></script>
<style>
li.dsq-widget-item {
border-bottom: 1px solid #ebebeb;
margin:0;
margin-bottom:10px;
padding:0;
padding-bottom:10px;
}
a.dsq-widget-user {
font-weight:normal;
}
img.dsq-widget-avatar {
margin-right:10px;
}
.dsq-widget-comment {
display:block;
padding-top:5px;
}
.dsq-widget-comment p {
display:block;
margin:0;
}
p.dsq-widget-meta {
padding-top:5px;
margin:0;
}
#dsq-combo-widget.grey #dsq-combo-content .dsq-combo-box {
background: transparent;
}
#dsq-combo-widget.grey #dsq-combo-tabs li {
background: none repeat scroll 0 0 #DDDDDD;
}
</style>
EOF;
if (!empty($disqus)) {
return $script;
}
}
// Google Publisher (Google+ page). // Google Publisher (Google+ page).
function publisher(){ function publisher(){
$publisher = config('google.publisher'); $publisher = config('google.publisher');


+ 6
- 1
themes/logs/css/style.css View File

@ -585,7 +585,7 @@ ul li, ol li{
margin:0; margin:0;
} }
.about, .social, .archive, .tagcloud {
.about, .social, .archive, .comments, .tagcloud {
margin-bottom:2em; margin-bottom:2em;
} }
@ -793,6 +793,11 @@ table.post-list td a {
margin-bottom:1em; margin-bottom:1em;
} }
pre {
white-space: pre-wrap;
word-wrap:break-word;
}
} }
@media all and (max-width: 360px) { @media all and (max-width: 360px) {


+ 5
- 0
themes/logs/layout.html.php View File

@ -47,6 +47,11 @@
<div class="archive"> <div class="archive">
<?php echo archive_list()?> <?php echo archive_list()?>
</div> </div>
<?php if(disqus()):?>
<div class="comments">
<?php echo recent_comments() ?>
</div>
<?php endif;?>
<div class="tagcloud"> <div class="tagcloud">
<?php echo tag_cloud()?> <?php echo tag_cloud()?>
</div> </div>


Loading…
Cancel
Save