1개의 게시판에서 분류를 가로로 출력하려면.. 정보
1개의 게시판에서 분류를 가로로 출력하려면..본문
http://dpishop.net/g4/
보시면 윗쪽은 DPI Shop 은 그룹별로 출력한것이고..
밑에 보면 DIY 같은 경우은 한 게시판에서 분류별로 해서 가로로
출력한것인데..어떻게 해야하나요?
팁앤테크에서는 죄다 그루별로 출력한것인지..
제가 못찾은건지..
부탁드릴꼐요~
보시면 윗쪽은 DPI Shop 은 그룹별로 출력한것이고..
밑에 보면 DIY 같은 경우은 한 게시판에서 분류별로 해서 가로로
출력한것인데..어떻게 해야하나요?
팁앤테크에서는 죄다 그루별로 출력한것인지..
제가 못찾은건지..
부탁드릴꼐요~
댓글 전체
네잎클로버님의 최신글 스킨을 조금 수정한 소스입니다.
원본 http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=1744
latest.skin.php
==================================
<?
if (!defined('_GNUBOARD_')) exit;
$icon_h ="<img src='".$latest_skin_path."/icon_head.gif' border=0 align=absmiddle width=20 height=16>";
$cnt = 2;
// 보드이름 출력을 위해 bo_subject, 추가
$row = sql_fetch(" SELECT bo_subject, bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ");
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "";
$str .= "<tr>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
//카테고리별 게시물수 체크
$row1 = sql_fetch(" SELECT count(*) as cat_cnt FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ");
//새글표시(아이콘뉴) 부분
$sql = " SELECT wr_datetime FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' order by wr_datetime desc limit 1 ";
$row2 = sql_fetch_array(mysql_query($sql));
if($row2[wr_datetime] >= date("Y-m-d H:i:s", time() - 24 * 3600)) {
$icon_new = "<img src='$latest_skin_path/icon_new.gif' border=0>";
} else {
$icon_new = "";
}
//출력부분 설정
$str .= "<td style='padding-left:5;'>".$icon_h." <a href='$g4[path]/bbs/board.php?bo_table=$bo_table&page=$page&mode=$mode&sca=$arr[$i]'><b><font color=#0080C0>$arr[$i]</font></b></a><font color=#FF80C0>[".$row1[cat_cnt]."]</font>".$icon_new."</td>";
if ($cnt == 4) { $cnt = 1; $str .= "</tr><tr>"; } //줄바꿈 부분
$cnt++;
}
?>
<!-- 보드이름 출력 추가 -->
<table id="r_tb_latest_cat" width="440" height="" border="0" radius="3" rborder="#bbbbbb" rbgcolor="transparent">
<tr>
<td style='padding-left:10; padding-top:5; padding-bottom:0; background:transparent;'>
<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><b><?=$row[bo_subject]?></b></a>
</td>
</tr>
<tr>
<td valign=top class=>
<table border=0 cellspacing=0 cellpadding=2 width=100% align=center>
<?=$str?><!--실제출력부분-->
</table>
</td>
</tr>
</table>
<script>roundTable("r_tb_latest_cat");</script>
원본 http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=1744
latest.skin.php
==================================
<?
if (!defined('_GNUBOARD_')) exit;
$icon_h ="<img src='".$latest_skin_path."/icon_head.gif' border=0 align=absmiddle width=20 height=16>";
$cnt = 2;
// 보드이름 출력을 위해 bo_subject, 추가
$row = sql_fetch(" SELECT bo_subject, bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ");
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "";
$str .= "<tr>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
//카테고리별 게시물수 체크
$row1 = sql_fetch(" SELECT count(*) as cat_cnt FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ");
//새글표시(아이콘뉴) 부분
$sql = " SELECT wr_datetime FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' order by wr_datetime desc limit 1 ";
$row2 = sql_fetch_array(mysql_query($sql));
if($row2[wr_datetime] >= date("Y-m-d H:i:s", time() - 24 * 3600)) {
$icon_new = "<img src='$latest_skin_path/icon_new.gif' border=0>";
} else {
$icon_new = "";
}
//출력부분 설정
$str .= "<td style='padding-left:5;'>".$icon_h." <a href='$g4[path]/bbs/board.php?bo_table=$bo_table&page=$page&mode=$mode&sca=$arr[$i]'><b><font color=#0080C0>$arr[$i]</font></b></a><font color=#FF80C0>[".$row1[cat_cnt]."]</font>".$icon_new."</td>";
if ($cnt == 4) { $cnt = 1; $str .= "</tr><tr>"; } //줄바꿈 부분
$cnt++;
}
?>
<!-- 보드이름 출력 추가 -->
<table id="r_tb_latest_cat" width="440" height="" border="0" radius="3" rborder="#bbbbbb" rbgcolor="transparent">
<tr>
<td style='padding-left:10; padding-top:5; padding-bottom:0; background:transparent;'>
<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><b><?=$row[bo_subject]?></b></a>
</td>
</tr>
<tr>
<td valign=top class=>
<table border=0 cellspacing=0 cellpadding=2 width=100% align=center>
<?=$str?><!--실제출력부분-->
</table>
</td>
</tr>
</table>
<script>roundTable("r_tb_latest_cat");</script>
아~ 감사합니다..^^ 잘되네요
스크랩해여~