Browse Source

Recent posts lists

Add options recent.count to the recent posts list functions so we can
change it using config.ini
pull/189/head
Danang Probo Sayekti 10 years ago
parent
commit
558263ade1
2 changed files with 9 additions and 4 deletions
  1. +8
    -1
      system/includes/functions.php
  2. +1
    -3
      themes/logs/post.html.php

+ 8
- 1
system/includes/functions.php View File

@ -630,10 +630,17 @@ function keyword_count($keyword)
return count($tmp); return count($tmp);
} }
// Return recent posts lists
function recent() function recent()
{ {
$count = config('recent.count');
if (empty($count)) {
$count = 5;
}
$str = '<ul>'; $str = '<ul>';
$posts = get_posts(null, 1, 5);
$posts = get_posts(null, 1, $count);
foreach ($posts as $post) { foreach ($posts as $post) {
$str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>'; $str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>';
} }


+ 1
- 3
themes/logs/post.html.php View File

@ -1,9 +1,7 @@
<?php if (!empty($breadcrumb)): ?> <?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div> <div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div>
<?php endif; ?> <?php endif; ?>
<?php if (login()) {
echo tab($p);
} ?>
<?php if (login()) { echo tab($p); } ?>
<div class="post" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"> <div class="post" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting">
<div class="main"> <div class="main">
<a name="more"></a> <a name="more"></a>


Loading…
Cancel
Save