<?php 
require "../Run.php";
require "../include/page.inc.php";
echo head('查看详细内容');
$sql="SELECT bbsid,userid,title,content,pic,name,v,time,gro,zip,zan,xi,nu,zipstr FROM bbs WHERE bbsid=
'{$_GET['id']}'";
$view = mysql_query($sql);
if($view && mysql_num_rows($view)>0){
list($bbsid,$userid,$title,$content,$pic,$name,$v,$time,$hgro,$zip,$zan,$xi,$nu,$zipstr) = mysql_fetch_row($view);
function utf8_strlen($string = null) {
preg_match_all("/./us", $string, $match);
return count($match[0]);
}
$conCount =  utf8_strlen($content);
if($_GET['f'] == 'y'){
		$start = ($_GET['p']-1)*9000;
		if($start<0){
			$start = 0;
			}
			$url = 'viewContent.php?f=y&id='.$_GET['id'].'&';
			$page =  page($conCount,9000,$url,'p','view');
			$p = '<div class="showpage">'.$page.'</div>';
		$viewCon = mb_substr($content,$start,9000,"UTF-8");
		$ftip ='<a href="?id='.$bbsid.'">全文</a>';
	}else{
		$viewCon = $content;
		$ftip ='<a href="?id='.$bbsid.'&f=y">分页</a>';
	}
echo '<table class="top_nav_bar"><tr><td class="left"><a href="content.php?cid='.$hgro.'&id='.$bbsid.'">返回</a></td><td class="center">'.$title.'</td><td class="right">'.$ftip.'</td></tr></table>';

echo '<div class="content">'.UBB($viewCon,$wapid).'</div>';
echo $p;
}else{
echo "抱歉 内容获取失败";
}
echo footer(1);
?>