//取出专题标题开始
$strQuery="select name from zhuanti where id=$zhuanti_id and flag='Y' order by id desc limit 0,1";
//echo $strQuery;
$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.=" >> 详细报道...";
}
//取出专题头条结束
?>
if ($zhuanti_id==128)
{echo "";
}
else
{echo $zhuanti_name;
}
?>
|
|
//取出专题中的各个栏目
$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){
echo "";
$j=0;
while (list($k,$v)=each($column_list)) {
if ($j%2==0) {
?>
|
|
$strQuery="select titles.id,titles.title,titles.post_time,content.fromto from
titles,content where titles.id=content.title_id and titles.column_id=$k and titles.status='Y' order by id desc";
$db->query($strQuery);
//===取出数据===
if ($zhuanti_id==128)
{
$i=0;
while ($db->next_record() && $i<10) {
list($id,$title,$post_time,$fromto)=$db->Record;
$show_time=substr($post_time,5,5); // $show_time=date("m-d",$post_time);
echo "· [$fromto]
$title [$show_time] ";
$i++;
}
}
else
{
$i=0;
while ($db->next_record() && $i<10) {
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()>10){echo " 更多...";}
$j++;
?>
|
|
}else {?>
|
$strQuery="select titles.id,titles.title,titles.post_time,content.fromto from
titles,content where titles.id=content.title_id and titles.column_id=$k and titles.status='Y' order by id desc";
$db->query($strQuery);
// echo $strQuery;
//===取出数据===
if ($zhuanti_id==128)
{
$i=0;
while ($db->next_record() && $i<10) {
list($id,$title,$post_time,$fromto)=$db->Record;
$show_time=substr($post_time,5,5); // $show_time=date("m-d",$post_time);
// echo"$fromto";
echo "· [$fromto]
$title [$show_time] ";
$i++;
}
}
else
{
$i=0;
while ($db->next_record() && $i<10) {
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()>10){echo " 更多...";}
$j++;
?>
|
|
}//fi
}//while
}//fi
?>
|