카테고리(분류)별 최신글 뽑아오기에서 질문.. 정보
카테고리(분류)별 최신글 뽑아오기에서 질문..본문
게시판 카테고리(관리자모드 '분류'에서 지정한) 호출방법을 여러 팁들과 질답을 통해 적용시켜
반(50%)은 성공을 했습니다.
문제는 카테고리별로 내용출력은 되는데 카테고리 '제목'과 'more'가 적용되지 않습니다.
각 관련 소스를 올려드릴테니 좀 도와주세요~ ^^ ;;
(/lib/latest.lib.php 와 해당 latest.skin.php)
◈.. /lib/latest.lib.php 중에서
// 특정 카테고리 추출
function latest_cate($skin_dir="", $bo_table, $rows=10, $subject_len=40, $ca_name) // latest_cate <-요 문구 주목
{
global $g4;
$arry = explode('|', $ca_name);
$ca_name = trim($arry[0]);
$sql_cate = " and (ca_name = '$ca_name' ";
for ($i=1; $i<count($arry); $i++)
{
$ca_name = trim($arry[$i]);
$sql_cate .= " or ca_name = '$ca_name' ";
}
$sql_cate .= ")";
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$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; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 $sql_cate order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
} //여기까지 ?>
◈ 해당 latest.skin.php 에서..
<table border="0" width="100%">
<tr>
<td width="100%" style="border-bottom-width:2; border-bottom-style:solid;"> <img src="<?=$latest_skin_path?>/img/z58.gif" border="0">
<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$cat_row[$j]?></a> </strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&sca=<?=$cat_row[$j]?>'>More</a> </td>
</tr>
<tr>
<tr>
<td width="100%"><? for ($i=0; $i<count($list); $i++) { ?></td>
</tr>
<tr>
<td colspan=2 style="border-top-width:1; border-bottom-width:1; border-top-style:none; border-bottom-style:dotted;">
<img src="<?=$latest_skin_path?>/img/icon.gif" border="0">
<font size="1" color="#00CC00">
<?
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:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:??; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";
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'];
?>
</font></td>
</tr>
<tr>
<td width="100%">
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align=center height=50><font color=#6A6A6A>게시물이 없읍니다.</font>
</td>
</tr>
<? } ?>
</table>
고수님들!! 제발 도와주십시오..
반(50%)은 성공을 했습니다.
문제는 카테고리별로 내용출력은 되는데 카테고리 '제목'과 'more'가 적용되지 않습니다.
각 관련 소스를 올려드릴테니 좀 도와주세요~ ^^ ;;
(/lib/latest.lib.php 와 해당 latest.skin.php)
◈.. /lib/latest.lib.php 중에서
// 특정 카테고리 추출
function latest_cate($skin_dir="", $bo_table, $rows=10, $subject_len=40, $ca_name) // latest_cate <-요 문구 주목
{
global $g4;
$arry = explode('|', $ca_name);
$ca_name = trim($arry[0]);
$sql_cate = " and (ca_name = '$ca_name' ";
for ($i=1; $i<count($arry); $i++)
{
$ca_name = trim($arry[$i]);
$sql_cate .= " or ca_name = '$ca_name' ";
}
$sql_cate .= ")";
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$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; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 $sql_cate order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
} //여기까지 ?>
◈ 해당 latest.skin.php 에서..
<table border="0" width="100%">
<tr>
<td width="100%" style="border-bottom-width:2; border-bottom-style:solid;"> <img src="<?=$latest_skin_path?>/img/z58.gif" border="0">
<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$cat_row[$j]?></a> </strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&sca=<?=$cat_row[$j]?>'>More</a> </td>
</tr>
<tr>
<tr>
<td width="100%"><? for ($i=0; $i<count($list); $i++) { ?></td>
</tr>
<tr>
<td colspan=2 style="border-top-width:1; border-bottom-width:1; border-top-style:none; border-bottom-style:dotted;">
<img src="<?=$latest_skin_path?>/img/icon.gif" border="0">
<font size="1" color="#00CC00">
<?
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:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:??; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";
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'];
?>
</font></td>
</tr>
<tr>
<td width="100%">
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align=center height=50><font color=#6A6A6A>게시물이 없읍니다.</font>
</td>
</tr>
<? } ?>
</table>
고수님들!! 제발 도와주십시오..
댓글 전체

<?=$cat_row[$j]?>에서 $j를 돌리는 for문은 어디에 있나요.
ㅜㅜ 잘 모르겠어요. 여기저기 질문답변들에 있는 소스들을 짜집기 한거라..
어떻게 돌아가는건지는 잘몰라요..
어떤 방식으로 해야하는지.. 갈켜주세요 ~
어떻게 돌아가는건지는 잘몰라요..
어떤 방식으로 해야하는지.. 갈켜주세요 ~
