Bugs fixes

This commit is contained in:
Danang Probo Sayekti 2015-07-14 16:09:39 +07:00
commit ffc88888dd
3 changed files with 33 additions and 12 deletions

View file

@ -395,7 +395,7 @@ function get_tag($tag, $page, $perpage, $random)
if (empty($tmp)) {
not_found();
}
$tmp = array_unique($tmp, SORT_REGULAR);
return $tmp = get_posts($tmp, $page, $perpage);
@ -669,7 +669,11 @@ function get_related($tag)
break;
}
echo '</ul>';
} else {
echo '<ul><li>No related post found</li></ul>';
}
}
// Return post count. Matching $var and $str provided.
@ -690,6 +694,24 @@ function get_count($var, $str)
return count($tmp);
}
// Return post count. Matching $var and $str provided.
function get_tagcount($var, $str)
{
$posts = get_post_sorted();
$tmp = array();
foreach ($posts as $index => $v) {
$arr = explode('_', $v[$str]);
$url = $arr[1];
if (strpos($url, "$var") !== false) {
$tmp[] = $v;
}
}
return count($tmp);
}
// Return seaarch result count
function keyword_count($keyword)
{
@ -729,7 +751,7 @@ function recent()
$str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>';
}
if (empty($posts)) {
$str .= '<li>No Posts Found</li>';
$str .= '<li>No recent posts found</li>';
}
$str .= '</ul>';
return $str;