Browse Source

Merge pull request #96 from Kanti/master

Add recent posts widget by @Kanti and @fahmi182.
pull/98/head
Danang Probo Sayekti 11 years ago
parent
commit
6f45bbb519
5 changed files with 31 additions and 2 deletions
  1. +15
    -0
      system/includes/functions.php
  2. +1
    -0
      themes/clean/layout.html.php
  3. +1
    -0
      themes/default/layout.html.php
  4. +10
    -2
      themes/logs/css/style.css
  5. +4
    -0
      themes/logs/layout.html.php

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

@ -626,6 +626,21 @@ function keyword_count($keyword) {
return count($tmp);
}
function recent() {
$str = '<ul>';
$posts = get_posts(null, 1, 5);
foreach($posts as $post)
{
$str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>';
}
if(empty($posts))
{
$str .= '<li>No Posts Found</li>';
}
$str .= '</ul>';
return $str;
}
// Return an archive list, categorized by year and month.
function archive_list() {


+ 1
- 0
themes/clean/layout.html.php View File

@ -27,6 +27,7 @@
</div>
<div class="social"><?php echo social() ?></div>
<div class="menu"><?php echo menu() ?></div>
<div class="recent"><h3>Recent Posts</h3><?php echo recent() ?></div>
<div class="archive"><?php echo archive_list()?></div>
<div class="tagcloud"><?php echo tag_cloud()?></div>
<div class="copyright"><?php echo copyright() ?></div>


+ 1
- 0
themes/default/layout.html.php View File

@ -50,6 +50,7 @@
<div class="container">
<footer id="footer">
<div class="footer-column">
<div class="recent column"><div class="inner"><h3>Recent Posts</h3><?php echo recent()?></div></div>
<div class="archive column"><div class="inner"><?php echo archive_list()?></div></div>
<div class="tagcloud column"><div class="inner"><?php echo tag_cloud()?></div></div>
<div class="social column"><div class="inner"><h3>Follow</h3><?php echo social()?></div></div>


+ 10
- 2
themes/logs/css/style.css View File

@ -582,8 +582,16 @@ ul li, ol li{
margin:0;
}
.about, .social, .archive, .comments, .tagcloud {
margin-bottom:2em;
.about, .social, .archive, .comments, .tagcloud, .recent {
margin-bottom: 2em;
}
.recent li:before {
content: "►";
font-size: 12px;
-webkit-font-smoothing: antialiased;
margin-right: 5px;
color: #21759B;
}
/*-------------------------


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

@ -49,6 +49,10 @@
<h3>Follow</h3>
<?php echo social() ?>
</div>
<div class="recent">
<h3>Recent Posts</h3>
<?php echo recent() ?>
</div>
<div class="archive">
<?php echo archive_list()?>
</div>


Loading…
Cancel
Save