<?php 
  function listubb($type,$where,$f,$list,$limit){
    $sql="SELECT articleid,cid,gro,title,v,content,time FROM article WHERE {$type}='{$where}' ORDER BY {$list} DESC LIMIT {$limit}";
	/*执行数据查询语句*/  
    $result=mysql_query($sql);      
	if($result && mysql_num_rows($result)>0){
	$i=0;
	while(list($articleid,$cid,$gro,$title,$v,$content,$time)=mysql_fetch_row($result)){
	   $sql="SELECT cn,class FROM class WHERE cid=
	   '{$cid}'";
	   $reslut=mysql_query($sql);
	  /*数据验证*/
	  if($reslut && mysql_num_rows($reslut)>0){
	  list($cn,$class)=mysql_fetch_row($reslut);
			 };
       if($f==0){
	   echo '<li>[<a href="'.$gro.'.php?cid='.$cid.'&" target="_blank">'.$cn.'</a>]
	   <a href="'.$gro.'.php?action=view&cid='.$cid.'&id='.$articleid.'&" target="_blank">'.$title.'</a></li>';
	   }elseif($f==1){
	   echo '<a href="article/content.php?cid='.$cid.'&id='.$articleid.'&" target="_blank">'.$title.'</a>';
	   }elseif($f==2){
	   echo '<table style="width:100%;height:15px;"><tr><td style=width:10px;>•</td><td><a href="'.$gro.'.php?action=view&cid='.$cid.'&id='.$articleid.'&">'.$title.'</a></td>';
	   echo "<td align=\"right\" valign=\"middle\" style=\"color:#999;line-height:15px;\" ><div >".$time."</div></td>";
	   echo "</tr></table>";
	   }elseif($f==3){
	   echo '<li><a href="'.$gro.'.php?action=view&cid='.$cid.'&id='.$articleid.'&" target="_blank" >'.$title.'</a></li>';
	   };
	
    };
}else{
echo "此栏目暂无记录！";
    };
  }

?>