query($sql.$sql_limit); // gen table ======================================== $allTable=''; $perRow=1; $tdWidth=(100/$perRow).'%'; $total=mysql_affected_rows(); $i=0; while ($row = $db->fetch_array($result)) { /* // get more information from other table $tbname_p="fund_product"; $sql2 = "SELECT id FROM `".$tbname_p."` where display='1' and category_id='".$row[id]."' order by date desc "; $temp1=$db->getrow($sql2); $file=get_attachment($tbname_p,$temp1[id],"attachment"); $photo1=get_attachment($tbname,$row[id],"photo1"); // ======= */ $photo1=''; $photo1=add_prefix(get_attachment($tbname,$row[id],"coverphoto")); $file1=''; $file1=get_attachment($tbname,$row[id],"file1"); $date=date("d-m-Y",$row[mydate]); /* $description=$row[content]; if(strlen($description)>150){ $description=substr($description,0,150)."..."; } $description=nl2br($description);*/ $i++; // content detail $mylink=$row[text]; if($mylink==""){ $mylink='news_info_detail.php?id='.$row["id"]; $mytarget=''; }else{ /* $mytarget=' target="_blank" ';*/ } $photolist=''; $filelist=''; for($k=1;$k<=10;$k++){ $this_photo=(get_attachment($tbname,$row[id],"photo".$k)); if($this_photo!=""){ $this_photo_s=add_prefix($this_photo); $this_photo_m=add_prefix($this_photo,"m"); $photolist.=''; } if($k<=5){ $file=(get_attachment($tbname,$row[id],"file".$k)); $sql2=" SELECT path ,file_name ,real_name FROM `attachment` WHERE table_name='news' and col_name='file".$k."' and table_id='".$row[id]."' "; $temp2=$db->getrow($sql2); if($temp2["real_name"]!=""){ $filelist.=''.$temp2["real_name"].''; } } } $print_div.='
'.$date.'
'.$row[name].'
'.nl2br($row[content]).'
'.$photolist.'
'.$filelist.'
'; // td style $allTable.=' '; // add empty row if(($i) % $perRow==0 && ($i)<$total){ //$allTable.=''; $allTable.=''; } } // add empty td if( $total<$perRow){ for($x=$total;$x<$perRow;$x++){ $allTable.=''; } } $allTable.='
'.$mycontent.'

 
'; // ======================================== include("paging.php"); ?> OneWorld Learning