게시판 카테고리 스킨 만드는 방법에 대한 문의입니다. 정보
게시판 카테고리 스킨 만드는 방법에 대한 문의입니다.본문
안녕하세요? 지금 그누보드를 이용해서 홈페이지를 구축중에 있는데 아무리 해봐도 잘 몰라서 질문을 드립니다.
한 게시판에 카테고리를 생성하고 그 카테고리를 메뉴로 만들어서 해당하는 리스트만을 출력하는 스킨을 만드려구 하는데 잘 안되어 질문드리고자 합니다.

그누보다 basic_old 스킨의 list.skin.php에서 해당하는 부분을 올립니다.
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#B0ADF5></td></tr>
<tr bgcolor=#F8F8F9 height=30 align=center>
<td width=50>¹øÈ£</td>
<? if ($is_category) { ?><td width=70>ºÐ·ù</td><?}?>
<? if ($is_checkbox) { ?><td width=40><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td>Á¦¸ñ</td>
<td width=110>±Û¾´ÀÌ</td>
<td width=40><?=subject_sort_link('wr_datetime', $qstr2, 1)?>³¯Â¥</a></td>
<td width=40><?=subject_sort_link('wr_hit', $qstr2, 1)?>Á¶È¸</a></td>
<td width=40 title='¸¶Áö¸· ÄÚ¸àÆ? ¾´ ½Ã°£'><?=subject_sort_link('wr_last', $qstr2, 1)?>ÃÖ±Ù</a></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>̵̧</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>ºñÃßõ</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#B0ADF5></td></tr>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#B0ADF5></td></tr>
<tr bgcolor=#F8F8F9 height=30 align=center>
<td width=50>¹øÈ£</td>
<? if ($is_category) { ?><td width=70>ºÐ·ù</td><?}?>
<? if ($is_checkbox) { ?><td width=40><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td>Á¦¸ñ</td>
<td width=110>±Û¾´ÀÌ</td>
<td width=40><?=subject_sort_link('wr_datetime', $qstr2, 1)?>³¯Â¥</a></td>
<td width=40><?=subject_sort_link('wr_hit', $qstr2, 1)?>Á¶È¸</a></td>
<td width=40 title='¸¶Áö¸· ÄÚ¸àÆ? ¾´ ½Ã°£'><?=subject_sort_link('wr_last', $qstr2, 1)?>ÃÖ±Ù</a></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>̵̧</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>ºñÃßõ</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#B0ADF5></td></tr>
<!-- ¸ñ·Ï -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=28 align=center>
<td>
<?
if ($list[$i][is_notice]) // °øÁö»çÇ×
echo "<img src=\"$board_skin_path/img/notice_icon.gif\" width=30 height=16>";
else if ($wr_id == $list[$i][wr_id]) // ÇöÀçÀ§Ä¡
echo "<font color='#2C8CB9'><strong>{$list[$i][num]}</strong>";
else
echo "{$list[$i][num]}";
?></td>
<? if ($is_category) { ?><td><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><span class=small><?=$list[$i][ca_name]?></span></font></a></td><? } ?>
<? if ($is_checkbox) { ?><td><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all;'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
//echo "<font color='#AF6BE3'><strong>{$list[$i][subject]}</strong></font>";
echo "<font color='#333333'><strong>{$list[$i][subject]}</strong></font>";
else
{
$style1 = $style2 = "";
// ÃֽűÛÀº °ËÁ¤
//if ($list[$i][icon_new]) $style1 = "color:#222222;";
// ÄÚ¸àÆ? ¾ø´Â°Í¸¸ ±½°Ô
//if (!$list[$i][comment_cnt]) $style2 = "color:#268800;";
echo "<span style='$style1 $style2'>{$list[$i][subject]}</span>";
}
echo "</a>";
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=28 align=center>
<td>
<?
if ($list[$i][is_notice]) // °øÁö»çÇ×
echo "<img src=\"$board_skin_path/img/notice_icon.gif\" width=30 height=16>";
else if ($wr_id == $list[$i][wr_id]) // ÇöÀçÀ§Ä¡
echo "<font color='#2C8CB9'><strong>{$list[$i][num]}</strong>";
else
echo "{$list[$i][num]}";
?></td>
<? if ($is_category) { ?><td><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><span class=small><?=$list[$i][ca_name]?></span></font></a></td><? } ?>
<? if ($is_checkbox) { ?><td><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all;'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
//echo "<font color='#AF6BE3'><strong>{$list[$i][subject]}</strong></font>";
echo "<font color='#333333'><strong>{$list[$i][subject]}</strong></font>";
else
{
$style1 = $style2 = "";
// ÃֽűÛÀº °ËÁ¤
//if ($list[$i][icon_new]) $style1 = "color:#222222;";
// ÄÚ¸àÆ? ¾ø´Â°Í¸¸ ±½°Ô
//if (!$list[$i][comment_cnt]) $style2 = "color:#268800;";
echo "<span style='$style1 $style2'>{$list[$i][subject]}</span>";
}
echo "</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;color:#ff6600;'>{$list[$i][comment_cnt]}</span></a>";
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;color:#ff6600;'>{$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']}>"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?></td>
<td><nobr style='display:block; overflow:hidden; width:105px;'><?=$list[$i][name]?></nobr></td>
<td><?=$list[$i][datetime2]?></td>
<td><?=$list[$i][wr_hit]?></td>
<td><?=$list[$i][last2]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#E7E7E7></td></tr>
<?}?>
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?></td>
<td><nobr style='display:block; overflow:hidden; width:105px;'><?=$list[$i][name]?></nobr></td>
<td><?=$list[$i][datetime2]?></td>
<td><?=$list[$i][wr_hit]?></td>
<td><?=$list[$i][last2]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#E7E7E7></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>°Ô½Ã¹°ÀÌ ¾ø½À´Ï´Ù.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#5C86AD height=1></td></tr>
</table>
<tr><td colspan=<?=$colspan?> bgcolor=#5C86AD height=1></td></tr>
</table>
댓글 전체
근데 제가 드림위버에서 작업을 하는데 글자들이 깨져 보이는 이유는 왜 그런가요?
웹에서는 잘 보이는데 자꾸만 깨져 보이네요.
웹에서는 잘 보이는데 자꾸만 깨져 보이네요.
utf-8으로 인코딩된 파일을 쓰고 계시군요.
카테고리 목록뽑기 최신글
http://www.sir.co.kr/bbs/tb.php/g4_skin/1744
카테고리 목록을 뽑아서 메뉴로 쓰세요 자주쓰는 소스 유용합니다.
유니코드는 rawurlencode 추가
<a href='$g4[path]/bbs/board.php?bo_table=$bo_table&sca=".rawurlencode($arr[$i])."'>$arr[$i]</a>
http://www.sir.co.kr/bbs/tb.php/g4_skin/1744
카테고리 목록을 뽑아서 메뉴로 쓰세요 자주쓰는 소스 유용합니다.
유니코드는 rawurlencode 추가
<a href='$g4[path]/bbs/board.php?bo_table=$bo_table&sca=".rawurlencode($arr[$i])."'>$arr[$i]</a>
http://pkgtest.mireene.com/gnu/bbs/board.php?bo_table=mproduct&sca=shop&sfl=wr_1&stx=10&sop=and&ssp=10&ssq=1&ssr=
위위 주소형식을 생각해 보세요.. 답이 나올지......
일단 한개의 테이블로 다차원개념의 불류개념을 적용하였습니다.
원리는 아래와 같습니다.
1. 여분필드 wr_1 을 분류에 사용합니다.
2. write.skin.php 에 분류 등록시 wr_1 에는 분류에 사용될 분류값(필드)의 고유아이디를 적용합니다.
- 예) aaa 라는 분류명의 고유 아이디가 11 이라고 가정할때, write.skin.php 여분필드 wr_1 에 select option 삽입이 11 로 약속을 합니다... 그러면.. 등록된 게시글의 여분필드 wr_1 에는 11이라는 숫자가 들어값니다.
3. list.skin.php 에서
board.php?bo_table=mproduct&sca=shop&sfl=wr_1&stx=11
이런형식의 링크주소를 선택합니다. 즉 wr_1 콜롬이 11인 필드를(ca_name 이 shop) 를 불러오게 되는거죠.
소스는 이미 오픈되었습니다. 참고하시면 많은 도움되리라 생각됩니다.
위위 주소형식을 생각해 보세요.. 답이 나올지......
일단 한개의 테이블로 다차원개념의 불류개념을 적용하였습니다.
원리는 아래와 같습니다.
1. 여분필드 wr_1 을 분류에 사용합니다.
2. write.skin.php 에 분류 등록시 wr_1 에는 분류에 사용될 분류값(필드)의 고유아이디를 적용합니다.
- 예) aaa 라는 분류명의 고유 아이디가 11 이라고 가정할때, write.skin.php 여분필드 wr_1 에 select option 삽입이 11 로 약속을 합니다... 그러면.. 등록된 게시글의 여분필드 wr_1 에는 11이라는 숫자가 들어값니다.
3. list.skin.php 에서
board.php?bo_table=mproduct&sca=shop&sfl=wr_1&stx=11
이런형식의 링크주소를 선택합니다. 즉 wr_1 콜롬이 11인 필드를(ca_name 이 shop) 를 불러오게 되는거죠.
소스는 이미 오픈되었습니다. 참고하시면 많은 도움되리라 생각됩니다.
코맨트 달아주신 분들 정말 감사합니다. 제가 너무 모르는게 많네요.
제가 좀 봐주시고 가르쳐 달라고 올린 소스가 죄송하게도 깨져 잘 안보이네요.
안깨진 소스 다시 올려봅니다. 한번만 봐주세요.
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#B0ADF5></td></tr>
<tr bgcolor=#F8F8F9 height=30 align=center>
<td width=50>번호</td>
<? if ($is_category) { ?><td width=70>분류</td><?}?>
<? if ($is_checkbox) { ?><td width=40><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td>제목</td>
<td width=110>글쓴이</td>
<td width=40><?=subject_sort_link('wr_datetime', $qstr2, 1)?>날짜</a></td>
<td width=40><?=subject_sort_link('wr_hit', $qstr2, 1)?>조회</a></td>
<td width=40 title='마지막 코멘트 쓴 시간'><?=subject_sort_link('wr_last', $qstr2, 1)?>최근</a></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#B0ADF5></td></tr>
<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=28 align=center>
<td>
<?
if ($list[$i][is_notice]) // 공지사항
echo "<img src=\"$board_skin_path/img/notice_icon.gif\" width=30 height=16>";
else if ($wr_id == $list[$i][wr_id]) // 현재위치
echo "<font color='#2C8CB9'><strong>{$list[$i][num]}</strong>";
else
echo "{$list[$i][num]}";
?></td>
<? if ($is_category) { ?><td><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><span class=small><?=$list[$i][ca_name]?></span></font></a></td><? } ?>
<? if ($is_checkbox) { ?><td><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all;'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
//echo "<font color='#AF6BE3'><strong>{$list[$i][subject]}</strong></font>";
echo "<font color='#333333'><strong>{$list[$i][subject]}</strong></font>";
else
{
$style1 = $style2 = "";
// 최신글은 검정
//if ($list[$i][icon_new]) $style1 = "color:#222222;";
// 코멘트 없는것만 굵게
//if (!$list[$i][comment_cnt]) $style2 = "color:#268800;";
echo "<span style='$style1 $style2'>{$list[$i][subject]}</span>";
}
echo "</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;color:#ff6600;'>{$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];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?></td>
<td><nobr style='display:block; overflow:hidden; width:105px;'><?=$list[$i][name]?></nobr></td>
<td><?=$list[$i][datetime2]?></td>
<td><?=$list[$i][wr_hit]?></td>
<td><?=$list[$i][last2]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#E7E7E7></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#5C86AD height=1></td></tr>
</table>
제가 좀 봐주시고 가르쳐 달라고 올린 소스가 죄송하게도 깨져 잘 안보이네요.
안깨진 소스 다시 올려봅니다. 한번만 봐주세요.
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#B0ADF5></td></tr>
<tr bgcolor=#F8F8F9 height=30 align=center>
<td width=50>번호</td>
<? if ($is_category) { ?><td width=70>분류</td><?}?>
<? if ($is_checkbox) { ?><td width=40><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td>제목</td>
<td width=110>글쓴이</td>
<td width=40><?=subject_sort_link('wr_datetime', $qstr2, 1)?>날짜</a></td>
<td width=40><?=subject_sort_link('wr_hit', $qstr2, 1)?>조회</a></td>
<td width=40 title='마지막 코멘트 쓴 시간'><?=subject_sort_link('wr_last', $qstr2, 1)?>최근</a></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#B0ADF5></td></tr>
<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=28 align=center>
<td>
<?
if ($list[$i][is_notice]) // 공지사항
echo "<img src=\"$board_skin_path/img/notice_icon.gif\" width=30 height=16>";
else if ($wr_id == $list[$i][wr_id]) // 현재위치
echo "<font color='#2C8CB9'><strong>{$list[$i][num]}</strong>";
else
echo "{$list[$i][num]}";
?></td>
<? if ($is_category) { ?><td><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><span class=small><?=$list[$i][ca_name]?></span></font></a></td><? } ?>
<? if ($is_checkbox) { ?><td><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all;'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
//echo "<font color='#AF6BE3'><strong>{$list[$i][subject]}</strong></font>";
echo "<font color='#333333'><strong>{$list[$i][subject]}</strong></font>";
else
{
$style1 = $style2 = "";
// 최신글은 검정
//if ($list[$i][icon_new]) $style1 = "color:#222222;";
// 코멘트 없는것만 굵게
//if (!$list[$i][comment_cnt]) $style2 = "color:#268800;";
echo "<span style='$style1 $style2'>{$list[$i][subject]}</span>";
}
echo "</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;color:#ff6600;'>{$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];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo $nobr_end;
?></td>
<td><nobr style='display:block; overflow:hidden; width:105px;'><?=$list[$i][name]?></nobr></td>
<td><?=$list[$i][datetime2]?></td>
<td><?=$list[$i][wr_hit]?></td>
<td><?=$list[$i][last2]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#E7E7E7></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#5C86AD height=1></td></tr>
</table>
답글 써주신분들 감사합니다.
제가 너무 몰라서 요즘 맨땅에 헤딩하는 심정으로 하고 있습니다.
좀 더 해보겠습니다.
제가 너무 몰라서 요즘 맨땅에 헤딩하는 심정으로 하고 있습니다.
좀 더 해보겠습니다.