<?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');
}

$oneT = template('show_article');
$ubb = new Ubb();
$ones = $DB->query("SELECT * FROM `".$mysql_prefix."blog` WHERE `draft`=0 AND `id` = ".$id);
if($DB->num_rows($ones) == 0) {
	$oneT->assign("id",0);
	$oneT->assign("title","日志不存在或者已经被删除");
} else {
	while($oneRe = $DB->fetch_array($ones))
	{
		$subtitle = $oneRe['subtitle'];
		$content = $oneRe['content'];
		
		if ($oneRe['ishtml'] != 1)
		{
		
			$content = str_replace(" ","&nbsp;",$content);
			if(intval($oneRe['allow_face']))
			{
				$content = qqface($content,"",$blogurl);
			}
			
			$content = str_replace("[separator]","",$content);
			$ubb->setString($content);
			$content = $ubb->parse();
		}
		
		
		$date = obdate($config['date_format'],$oneRe['date']);
		$path = $makehtml ? getHtmlPath($id) : "index.php?id=".$id;
		$oneT->assign($ads);
		$oneT->assign("id",$oneRe['id']);
		$oneT->assign("title",$oneRe['title']);
		$oneT->assign("subtitle",$subtitle);
		$oneT->assign("date",$date);
		$oneT->assign("content",$content);
		$oneT->assign("path",$blogurl.$path);
		$oneT->assign("blogurl",$blogurl);
		$oneT->assign("show_viewcount",$show_viewcount);
		$articleName = $oneRe['title'];
	}
}
$main = $oneT->result();
?>