최신글에서 카테고리 나오고 카테고리의 글갯수 써주기 정보
최신글에서 카테고리 나오고 카테고리의 글갯수 써주기관련링크
본문
게시판 A가 있고 카테고리가 가 | 나 | 다 | 라 | 마 가 있다면
최신글에서 카테고리명 보여주고 카테고리별로 게시물 수를 보여주고 싶어요.
------------------------------------------------------
밑에 소스는 제가 최신글 코너에서 다운받아 홈피에 올린건데
카테고리 명 옆에 가(25) 나(34) 라(223) .... 이런식으로 카테고리별 게시물 수를 써주고 싶은데
도저히 할수가 없네요.
-------------------------------------------------------
<?
################스킨 함수###############
function latest_category($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options=""){//게시판에서 카테고리별 최신글 추출
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 전체이름
$sql2 = " select bo_category_list from $g4[board_table] where bo_table = '$bo_table' order by bo_table ";
$result2 = sql_fetch($sql2);
$cat_row = explode("|", $result2[bo_category_list]);
for ($j=0; $j<count($cat_row); $j++) { //@@@@@@@@@@@@@@@@@@@
$sql = " select * from $tmp_write_table where ca_name='".$cat_row[$j]."' and wr_is_comment = 0".$GLOBALS["ssh_wr_nogood"]." order by wr_id desc limit 0, $rows "; //##add06-04-12
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
$k++;
} //@@@@@@@@@@@@@@@@@@@@@@
return $content;
}
################스킨함수###############
?>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" background="<?=$latest_skin_path?>/img/top_bar_bg.gif">
<tr>
<td height=28><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'> <font color="#333333"><b><?=$cat_row[$j]?></b></font></a></td>
<td height=28 background="<?=$latest_skin_path?>/img/top_bar_divi.gif" width="14"> </td>
<td align="right"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&sca=<?=$cat_row[$j]?>'>More</a> </td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td height=5></td></tr></table>
<table width=100% cellpadding=0 cellspacing=0 style="table-layout: fixed;">
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td align=center>
<table width=95% style="table-layout: fixed;">
<tr>
<td height=20><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<nobr>
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:9pt; color:#FF4200;'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i][subject]}</font>";
echo "</a>";
//##add06-04-12
$qry=" SELECT count(*) as coment_cnt FROM $tmp_write_table WHERE wr_parent=".$list[$i][wr_parent]." and wr_is_comment >0 $ssh_wr_nogood ";
$cnt_val= sql_fetch($qry);
if ($cnt_val[coment_cnt]>0) {$list[$i][comment_cnt]="(".$cnt_val[coment_cnt].")";}
//##add06-04-12
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i][icon_new];
?>
</nobr>
</td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
-------------------------------------------------------------------------
위 소스는 latest.skin.php 소스 이구요,
실제 모습은
http://love.canvaslab.net/b2.php 입니다.
각 게시판별로 카테고리와 게시물은 나오는데 카테고리 옆에 게시물 수를 꼭 보여주고 싶습니다.
최신글에서 카테고리명 보여주고 카테고리별로 게시물 수를 보여주고 싶어요.
------------------------------------------------------
밑에 소스는 제가 최신글 코너에서 다운받아 홈피에 올린건데
카테고리 명 옆에 가(25) 나(34) 라(223) .... 이런식으로 카테고리별 게시물 수를 써주고 싶은데
도저히 할수가 없네요.
-------------------------------------------------------
<?
################스킨 함수###############
function latest_category($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options=""){//게시판에서 카테고리별 최신글 추출
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 전체이름
$sql2 = " select bo_category_list from $g4[board_table] where bo_table = '$bo_table' order by bo_table ";
$result2 = sql_fetch($sql2);
$cat_row = explode("|", $result2[bo_category_list]);
for ($j=0; $j<count($cat_row); $j++) { //@@@@@@@@@@@@@@@@@@@
$sql = " select * from $tmp_write_table where ca_name='".$cat_row[$j]."' and wr_is_comment = 0".$GLOBALS["ssh_wr_nogood"]." order by wr_id desc limit 0, $rows "; //##add06-04-12
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
$k++;
} //@@@@@@@@@@@@@@@@@@@@@@
return $content;
}
################스킨함수###############
?>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" background="<?=$latest_skin_path?>/img/top_bar_bg.gif">
<tr>
<td height=28><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'> <font color="#333333"><b><?=$cat_row[$j]?></b></font></a></td>
<td height=28 background="<?=$latest_skin_path?>/img/top_bar_divi.gif" width="14"> </td>
<td align="right"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&sca=<?=$cat_row[$j]?>'>More</a> </td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td height=5></td></tr></table>
<table width=100% cellpadding=0 cellspacing=0 style="table-layout: fixed;">
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td align=center>
<table width=95% style="table-layout: fixed;">
<tr>
<td height=20><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<nobr>
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:9pt; color:#FF4200;'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i][subject]}</font>";
echo "</a>";
//##add06-04-12
$qry=" SELECT count(*) as coment_cnt FROM $tmp_write_table WHERE wr_parent=".$list[$i][wr_parent]." and wr_is_comment >0 $ssh_wr_nogood ";
$cnt_val= sql_fetch($qry);
if ($cnt_val[coment_cnt]>0) {$list[$i][comment_cnt]="(".$cnt_val[coment_cnt].")";}
//##add06-04-12
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i][icon_new];
?>
</nobr>
</td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
-------------------------------------------------------------------------
위 소스는 latest.skin.php 소스 이구요,
실제 모습은
http://love.canvaslab.net/b2.php 입니다.
각 게시판별로 카테고리와 게시물은 나오는데 카테고리 옆에 게시물 수를 꼭 보여주고 싶습니다.
댓글 전체
크롬에선 완전 깨집니다. 사이트가..형태가 ...
게시판에 전체글수 말씀하시는건지;
게시판에 전체글수 말씀하시는건지;
게시판의 카테고리별 글 갯수입니다. 카테고리명1(23)카테고리명2(33).. 이런식으로요