r

최근게시물에 코멘트 제외 또는 코멘트만 조회하는 스킨

· 2005-07-12 (화) 17:18:48 · 4939 · 13

최근게시물에서 코멘트 제외 또는 코멘트만 처리하는것과 관련하여
new.skin.php 파일을 다음 처럼 만드시면 됩니다.
별도의 스킨 디렉토리를 만드시어 올려두시면 되겠습니다.

그리고 다음 1,2는 코멘트를 제외 또는 코멘트만 출력하는 방법입니다.
1. 코멘트를 제외한 최근게시물 처리시
	if($list[$i][wr_comment] <= 0) { 	// 코멘트가 아닌것만 출력해라
2. 코멘트만 최근게시물로 처리시
	if($list[$i][wr_comment] > 0) { 	// 코멘트만 출력해라

ps. 첨부파일과 아래의 소스는 동일한 것입니다.

// ############################## 다음라인부터 소스 시작입니다 ##############################
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<style>
.n_title1 { font-family:돋움; font-size:9pt; color:#FFFFFF; }
.n_title2 { font-family:돋움; font-size:9pt; color:#5E5E5E; }
</style>

</style>

<!-- 분류 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td height=30>
        <?=$group_select?>
        <script language="JavaScript">
        function group_change(fld)
        {
            document.location.href = "./new.php?gr_id="+fld.value;
        }
        document.getElementById("gr_id").value = "<?=$gr_id?>";
        </script>
    </td>
</tr>
</table>
<!-- 분류 끝 -->

<!-- 제목 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="4" height="33" bgcolor="#7BB2D6"><img src="<?=$new_skin_path?>/img/list_top_01.gif" width="4" height="33"></td>
    <td width="100" align="center" bgcolor="#7BB2D6" height="30"><font class=n_title1><strong>그룹</strong></font></td>
    <td width="5" align="center" valign="middle" bgcolor="#7BB2D6"><img src="<?=$new_skin_path?>/img/list_top_02.gif" width="5" height="33"></td>
    <td width="5" align="center" valign="middle" bgcolor="#EEEEEE"><img src="<?=$new_skin_path?>/img/list_top_03.gif" width="5" height="33"></td>
    <td width="100" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>게시판</strong></font></td>
    <td width="" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>제목</strong></font></td>
    <td width="120" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>이름</strong></font></td>
    <td width="60" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>일시</strong></font></td>
    <td width="4" bgcolor="#EEEEEE"><img src="<?=$new_skin_path?>/img/list_top_04.gif" width="4" height="33"></td>
</tr>
<?
for ($i=0; $i<count($list); $i++)
{
	if($list[$i][wr_comment] <= 0) { 	// 코멘트가 아닌것만 출력해라
		// 만약 코멘트인것만 출력하고자 할경우 위의 부등호를 ">" 로 바꾸시면 됩니다.

	    $gr_subject = cut_str($list[$i][gr_subject], 10);
	    $bo_subject = cut_str($list[$i][bo_subject], 10);
	    $wr_subject = get_text(cut_str($list[$i][wr_subject], 40));

	    echo <<<HEREDOC
<tr>
    <td align="center" height="30" colspan=3><a href='./group.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
    <td align="center" colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
    <td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
    <td align="center">{$list[$i][name]}</td>
    <td align="center" colspan=2>{$list[$i][datetime2]}</td>
</tr>
<tr>
    <td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
	} 	// 코멘트가 아닌것만 출력해라
}
?>

<? if ($i == 0) { ?>
<tr><td colspan="9" height=50 align=center>게시물이 없습니다.</td></tr>
<? } ?>
<tr>
    <td colspan="9" height="30" align="center"><?=$write_pages?></td>
</tr>
</table>
// ############################## 위라인까지 소스 끝입니다 ##############################

첨부파일

new.skin.php (3 KB) 102회 2005-07-12 17:57
|

댓글 13개

2005-07-15 (금) 17:19:08
크~~~~!
머리 아프게 하는 부분인데 시원하게 설명해 주셨군요.
감사합니다.
팁텍에도 올려 주시면 다음에 찾을때 덜 헤맬것 같군요. ^^
잘 쓸게요~
고생하셨습니다.
코드들이 '군기'가 자~알 들었네요.
깔끔하니 보기가 좋습니다.^^
2005-07-13 (수) 01:47:32
만세. 감사합니다. 고맙게 잘 쓰겠습니다.
감사합니다
2005-11-27 (일) 13:40:48
감사합니다
감사^^
감사합니다
감사합니다 감사합니다
굿
2007-07-20 (금) 02:44:41
감사합니다 ^ㅡ^
코멘트만 표기
ㄳ
댓글을 작성하시려면 로그인이 필요합니다.

그누4 스킨

5,847건

스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다. 스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y 그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.

+
분류 제목 글쓴이 날짜 조회
쪽지 05-07-14 조회 5,047
게시판 05-07-14 조회 1.2만
게시판 05-07-14 조회 5,606
최신글 05-07-14 조회 5,310
쪽지 05-07-13 조회 8,041
최신글 05-07-12 조회 4,940
회원통합스킨 05-07-12 조회 1.2만
최신글
mmando
05-07-12 조회 7,950
게시판 05-07-12 조회 8,419