query($sql); if($row = $db->fetch_array($rst)) { return $row['content']; } } if($info_state=="content") { $sql="select * from info where class_id = $class_id order by state desc, sortnum desc limit 1"; $rst = $db->query($sql); if($row = $db->fetch_array($rst)) { make_content($row); } } else if($info_state=="pic") { $page_size="6"; $start_seri=($page_id-1)*$page_size; $condition=" class_id = $class_id and state<>0 order by state desc,sortnum desc limit $start_seri,$page_size"; $condition2=" class_id = $class_id and state<>0"; $info=getInfoArray($db,$condition); $record=$db->getCount("info",$condition2); $page_num=ceil($record/$page_size); make_pic_list($info,$page_id,$page_num,$class_id,$record,"info.php?class_id="); } else if($info_state=="list") { $page_size="18"; $start_seri=($page_id-1)*$page_size; $condition=" class_id = $class_id and state<>0 order by state desc,sortnum desc limit $start_seri,$page_size"; $condition2=" class_id = $class_id and state<>0"; $info=getInfoArray($db,$condition); $record=$db->getCount("info",$condition2); $page_num=ceil($record/$page_size); make_news_list($info,$page_id,$page_num,$class_id,$record); } else { if($old_class_id!="102") { $sql="select * from info where class_id = $class_id order by state desc, sortnum desc limit 1"; $rst = $db->query($sql); if($row = $db->fetch_array($rst)) { make_content($row); } } } if($old_class_id=="102") { //echo getClassContent($db,$base_id); $sql="select * from info_class where id like '".$base_id."___' order by sortnum asc"; $rst = $db->query($sql); $info=array(); while($row = $db->fetch_array($rst)) { $row['content']=utf8substr(htmlspecialchars(strip_tags($row['content'])),300); $info[]=$row; } //make_pictxt_list($info); } ?>