//獲得相關(guān)文章,參數(shù)1為分類id,參數(shù)2為顯示條數(shù).都不是必須的參數(shù),默認(rèn)顯示未分類的6條數(shù)據(jù)
function getgxtext($fenlei,$shuliang){
$fl = isset($fenlei) ? $fenlei : -1;
$sl = isset($shuliang) ? $shuliang : 6;
$db = MySql::getInstance();
$sql = "SELECT * FROM ".DB_PREFIX."blog WHERE? hide='n' and checked='y' and sortid = ".$fl." order by gid desc limit ".$sl."";
$strs = $db->query($sql);
while($row = $db->fetch_array($strs)){
echo "
".subString($row['title'],0,30)."
";
}
}
?>