2013-10-07, 23:06:29
Hello,
how to display DATE next to recent post list from function <?php show_blog_recent_posts(); ?> ???
function show_blog_recent_posts($excerpt=false, $excerpt_length=null, $thumbnail=null, $read_more=null)
{
$Blog = new Blog;
$posts = $Blog->listPosts(true, true);
global $SITEURL,$blogSettings;
if (!empty($posts))
{
echo '<ul>';
$posts = array_slice($posts, 0, $blogSettings["recentposts"], TRUE);
foreach ($posts as $file)
{
$data = getXML($file['filename']);
$url = $Blog->get_blog_url('post') . $data->slug;
$title = strip_tags(strip_decode($data->title));
if($excerpt != false)
{
if($excerpt_length == null)
{
$excerpt_length = $blogSettings["excerptlength"];
}
$excerpt = $Blog->create_excerpt(html_entity_decode($data->content), 0, $excerpt_length);
if($thumbnail != null)
{
if(!empty($data->thumbnail))
{
$excerpt = '<img src="'.$SITEURL.'data/uploads/'.$data->thumbnail.'" class="blog_recent_posts_thumbnail" />'.$excerpt;
}
}
if($read_more != null)
{
$excerpt = $excerpt.'<br/><a href="'.$url.'" class="recent_posts_read_more">'.$read_more.'</a>';
}
echo '<li><a href="'.$url.'">'.$title.'</a><p class="blog_recent_posts_excerpt">'.$excerpt.'</p></li>';
}
else
{
echo "<li><a href=\"$url\">$title</a></li>";
}
}
echo '</ul>';
}
}
Thanks.
how to display DATE next to recent post list from function <?php show_blog_recent_posts(); ?> ???
function show_blog_recent_posts($excerpt=false, $excerpt_length=null, $thumbnail=null, $read_more=null)
{
$Blog = new Blog;
$posts = $Blog->listPosts(true, true);
global $SITEURL,$blogSettings;
if (!empty($posts))
{
echo '<ul>';
$posts = array_slice($posts, 0, $blogSettings["recentposts"], TRUE);
foreach ($posts as $file)
{
$data = getXML($file['filename']);
$url = $Blog->get_blog_url('post') . $data->slug;
$title = strip_tags(strip_decode($data->title));
if($excerpt != false)
{
if($excerpt_length == null)
{
$excerpt_length = $blogSettings["excerptlength"];
}
$excerpt = $Blog->create_excerpt(html_entity_decode($data->content), 0, $excerpt_length);
if($thumbnail != null)
{
if(!empty($data->thumbnail))
{
$excerpt = '<img src="'.$SITEURL.'data/uploads/'.$data->thumbnail.'" class="blog_recent_posts_thumbnail" />'.$excerpt;
}
}
if($read_more != null)
{
$excerpt = $excerpt.'<br/><a href="'.$url.'" class="recent_posts_read_more">'.$read_more.'</a>';
}
echo '<li><a href="'.$url.'">'.$title.'</a><p class="blog_recent_posts_excerpt">'.$excerpt.'</p></li>';
}
else
{
echo "<li><a href=\"$url\">$title</a></li>";
}
}
echo '</ul>';
}
}
Thanks.