if($keyword) $addwhere = " && $category like '%$keyword%' ";
$sql = "select count(num) from $board_table where db='$board_db' $addwhere";
$row = mysql_fetch_array(mysql_query($sql));
$total = $row[0];
$tdnum = 4;
if(!$item) $item = 2 * $tdnum;
if(!$pageintm) $pageitem = 10;
if(!$page) $page = 1;
$start = ($page - 1) * $item;
$totalpage = ceil($total / $item);
$pnum = $total - (($page-1) * $item);
$sql = "select * from $board_table where db='$board_db' $addwhere order by num desc limit $start, $item";
//echo $sql;
$res = mysql_query($sql);
$cnt = mysql_num_rows($res);
$trnum = ceil($cnt / $tdnum);
echo"
 |
";
for($k=1; $k<=$trnum; $k++){
echo"
";
for($i=1; $i<=$tdnum; $i++){
$row = mysql_fetch_array($res);
if($row){
echo"
| ";
if($i < $tdnum) echo" | ";
} else {
echo"
| ";
if($i < $tdnum) echo" | ";
}
}
echo"
|
|
|
|
|
|
|
";
if($k < $trnum){
echo"
|
|
|
|
|
|
|
|
";
}
echo"
|
";
}
if($total == 0) {
echo"
µî·Ï(°Ë»ö)µÈ °¶·¯¸®°¡ ¾ø½À´Ï´Ù. |
";
}
echo"
";
echo"
|
|
";
$fquery = "ipg=$ipg&lcode=$lcode&mcode=$mcode&scode=$scode";
psk_pagelinkB($totalpage, $pageitem, $page, "$board_img/btn_prev.gif", "$board_img/btn_next.gif", $fquery);
echo"
|
|
|
|
"; print_button("write_form", "btn_write.gif"); echo" |
|
";
?>