|
|
$db=new DB_sql;
$db->connect();
//取出专题标题开始
$strQuery="select name from zhuanti where id=$zhuanti_id and flag='Y' order by id desc limit 0,1";
$db->query($strQuery);
if ($db->num_rows()!=0) {
$db->next_record();
list($zhuanti_name)=$db->Record;
}
//取出专题标题结束
//取出专题头条开始
$strQuery="select * from bginfo where zhuanti_id=$zhuanti_id and flag='Y' order by id desc limit 0,1";
$db->query($strQuery);
if ($db->num_rows()!=0) {
$db->next_record();
list($id,$zhuanti_id,$img_name,$img_pos,$bginfo,$title_id)=$db->Record;
}
if (trim($img_name)!="") {
$strBginfo="";
}
$strBginfo.=nl2br($bginfo);
if (trim($title_id)!=0) {
$strBginfo.=" >> 详细报道...";
}
//取出专题头条结束
?>
//取出专题中的各个栏目
$strQuery="select id,column_name from column_name where zhuanti_id=$zhuanti_id and flag='Y'";
$db->query($strQuery);
while ($db->next_record()) {
list($id,$column_name)=$db->Record;
$column_list[$id]=$column_name;
}
?>
if (sizeof($column_list)!=0){
while (list($k,$v)=each($column_list)) {?>
|
|
$strQuery="select id,title,post_time from titles where column_id=$k and status='Y' order by id desc";
$db->query($strQuery);
//===取出数据===
$i=0;
while ($db->next_record() && $i<20) {
list($id,$title,$post_time)=$db->Record;
$show_time=substr($post_time,5,5); // $show_time=date("m-d",$post_time);
echo "· $title [$show_time] ";
$i++;
}
if ($db->num_rows()>20){echo " 更多... ";}
?>
|
}//while
}//fi
?>
|