mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 03:26:20 +05:30
Fix RSS bugs.
Fix RSS bugs due to code changes.
This commit is contained in:
parent
e666497cf0
commit
785f07c907
2 changed files with 8 additions and 6 deletions
|
|
@ -19,10 +19,7 @@ get('/index', function () {
|
|||
$page = $page ? (int)$page : 1;
|
||||
$perpage = config('posts.perpage');
|
||||
|
||||
$posts = get_posts($page);
|
||||
|
||||
// Extract a specific page with results
|
||||
$posts = array_slice($posts, ($page-1) * $perpage, $perpage);
|
||||
$posts = get_posts($page, $perpage);
|
||||
|
||||
$total = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ function get_post_names(){
|
|||
// Get the names of all the
|
||||
// posts (newest first):
|
||||
|
||||
$_cache = array_reverse(glob('content/*/blog/*.md', GLOB_NOSORT));
|
||||
$_cache = glob('content/*/blog/*.md', GLOB_NOSORT);
|
||||
}
|
||||
|
||||
return $_cache;
|
||||
|
|
@ -56,6 +56,7 @@ function get_author_names(){
|
|||
return $_cache;
|
||||
}
|
||||
|
||||
// usort function. Sort by date.
|
||||
function cmp($a, $b) {
|
||||
return $a->date == $b->date ? 0 : ( $a->date < $b->date ) ? 1 : -1;
|
||||
}
|
||||
|
|
@ -115,6 +116,10 @@ function get_posts($page = 1, $perpage = 0){
|
|||
}
|
||||
|
||||
usort($tmp,'cmp');
|
||||
|
||||
// Extract a specific page with results
|
||||
$tmp = array_slice($tmp, ($page-1) * $perpage, $perpage);
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
|
|
@ -372,7 +377,7 @@ function tag_cloud() {
|
|||
echo '<h3>Tags</h3>';
|
||||
echo '<ul class="taglist">';
|
||||
foreach ($tag_collection as $tag => $count){
|
||||
echo '<li class="item"><a href="' . site_url() . 'tag/' . $tag . '">' . $tag . '</a> <span class="count">(' . $count . ')</span></li>';
|
||||
echo '<li class="item"><a href="' . site_url() . 'tag/' . $tag . '">' . ucfirst($tag) . '</a> <span class="count">(' . $count . ')</span></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue