<?php
/*
+--------------------------------------------------------+
| O-BLOG - PHP Blog System                               |
| Copyright (c) 2004 phpBlog.CN                          |
| Support : http://www.phpBlog.cn                        |
| Author : ShiShiRui (shishirui@163.com)                 |
|--------------------------------------------------------+
*/
//error_reporting(7);

if (!defined('BLOG')) {
	die('Access Denied');
}

$hotestBlogs = $DB->query("SELECT * FROM `".$mysql_prefix."blog` WHERE `draft`=0 ORDER BY `viewcount` DESC LIMIT 0 , ".$showNum);
while($hotestBlogRe = $DB->fetch_array($hotestBlogs))
{
	$date = $hotestBlogRe['date'];
	$path = getHtmlPath($hotestBlogRe['id']);
	$path = ($makehtml) ? $path : "index.php?id=".$hotestBlogRe['id'];
	$hotestBlog[] = array(
		"id" => $hotestBlogRe['id'],
		"path" => $blogurl.$path,
		"title" => cn_substr($hotestBlogRe['title'],$lastblog_cut_char),
		"alltitle" => $hotestBlogRe['title']
	);
}

$hotestBlogT = template("lastblog");
$hotestBlogT->assign($ads);
$hotestBlogT->assign('blogurl',$blogurl);
$hotestBlogT->assign("lastblog",$hotestBlog);
$hotestblog_data = $hotestBlogT->result();
unset($hotestBlogT,$hotestBlog,$hotestBlogs);

?>