연혁 게시판 페이지 중복에 관해 궁금한게 있어요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

연혁 게시판 페이지 중복에 관해 궁금한게 있어요 정보

연혁 게시판 페이지 중복에 관해 궁금한게 있어요

본문

게시물 갯수가 30개 입니다. 관리자 화면에 들어가 한 페이지당 게시물 갯수를 15로 하면 2페이지로 나눠져야 정상인데 그렇게 되지 않고 페이지 수는 2개로 나눠지는데 화면에는 각각 30개씩의 게시물이 중복되어서 보이네요;
쉽게 얘기해서 1페이지 2페이지를 눌러도 똑같이 30개씩 게시물이 나옵니다. 이럴때는 어떤부분을 수정해야 되나요. 알려주시면 감사하겠습니다.
  • 복사

댓글 전체

<meta name="generator" content="Namo WebEditor(Trial)">
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>

?>

<style>
div.item_text { color:#636363; width:100%; padding:0 10px 0 10px; margin-top:3px; }
div.item_text2 { color:#636363; padding:0 10px 10px; margin-top:10px; margin-bottom:5px; float:left;}
div.item_text strong { font-weight:bold; color:#000000; font-family:돋움; font-size:12px; }
.year_img { float:left; }
.year_text { padding:0 10px 30px 10px;}

.history_area{}
.history_area .title{height:42px; border-bottom:2px solid #b1b1b1; margin:5px 0 10px 0; padding:0;  position:relative;}
.history_area .title h2{display:inline; float:left; letter-spacing:-1px; margin:0 0 5px 0; padding-bottom:5px; font-weight:bold; font-size:30px; border-bottom:2px solid #353535;  position:relative;}
.history_area .title h2 a{color:#3F627D;}
.history_area .title span{display:inline; float:left; font:10px tahoma; margin-top:2px;margin-right:5px;}
.history_area .title span a{ color:#777; }
.history_list {display:inline;border-bottom-width:1; border-bottom-color:#9999CC;}
.history_item {border-bottom-width:1; border-bottom-color:#9999CC; margin-top:10px; margin-bottom:10px;border-bottom-style:dotted;}
</style>

<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0" border="0">
<tr><td height="5"></td></tr>
<tr><td>
 <!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<div style="float:left;">
            <!--
<form name="fcategory" method="get" style="margin:0px;">
            <? if ($is_category) { ?>
            <select name=sca onchange="location='<?=$category_location?>'+this.value;">
            <option value=''>전체</option>
            <?=$category_option?>
            </select>
            <? } ?>
            </form>
-->
        </div>
        <div style="float:right;">
            <? if ($rss_href) { ?><a href='<?=$rss_href?>'><img src='<?=$board_skin_path?>/img/btn_rss.gif' border='0' align="absmiddle"></a><?}?>
            <? if ($admin_href) { ?>
<a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" border='0' title="관리자" align="absmiddle"></a><?}?>
        </div>
</td></tr>
<tr>
<td align="right" class="listBC" style="padding-bottom:3px;" height="42">
       
        <? if ($list_href) { ?>
        <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" align="absmiddle" border='0'></a>
        <? } ?>
        <? if ($is_checkbox) { ?>
        <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align="absmiddle" border='0'></a>
        <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" align="absmiddle" border='0'></a>
        <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" align="absmiddle" border='0'></a>
        <? } ?>
        <? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif"  align="absmiddle" border='0'></a><? } ?>
        </td><td height="5"></td>
</tr>
<tr><td>
<!-- 제목 -->
<form name="fboardlist" method="post" style="margin:0;">
<input type='hidden' name='bo_table' value='<?=$bo_table?>'>
<input type='hidden' name='sfl'  value='<?=$sfl?>'>
<input type='hidden' name='stx'  value='<?=$stx?>'>
<input type='hidden' name='spt'  value='<?=$spt?>'>
<input type='hidden' name='page' value='<?=$page?>'>
<input type='hidden' name='sw'  value=''>
<?

//카테고리를 읽는다.
$sql = " SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ";
    $row = sql_fetch($sql);
    $arr = explode("|", $row[bo_category_list]); // 구분자가 | 로 되어 있음
for ($i=0; $i<count($arr); $i++) { //카테고리 루프 시작
//각 카테고리 별로 글을 읽어와서 뿌려준다.
$his_year = trim($arr[$i]);
?>
<table width=100%>
 <tr>
 <td width='50%' style='padding:0px 10px;' valign='top'>
<div class="history_area">
<div class="title">
<? if($bo_table) {
    // $img = "<img src=$board_skin_path/img/year_".$his_year.".gif>";
    $year = "<span style='font-size:28px;font-family:Arial;letter-spacing:-1px; color:#000000;'><h2><i>$his_year</i></h2></span>";
    echo $year;
    } // 연혁불러오기?>
</div>
</div>
</td>
</tr></table>
<?
$sql1 = " SELECT wr_id,wr_subject,wr_content FROM $write_table WHERE ca_name = '$arr[$i]' ORDER BY wr_subject asc";
$row1 = mysql_query($sql1);
for ($j=0; $ca=mysql_fetch_array($row1); $j++) { //글별 루프 시작
//echo $ca['wr_subject']."<br>".$ca['wr_content']."<br><br>";
$his_date = $ca['wr_subject']; //날짜
$his_content = conv_content($ca['wr_content'],true); //내용
//해당 카테고리별 포함된 글들
?>
<div class="item_text">
<table cellspacing="0" cellpadding="0" border="0" width="97%">
<tr>
<td width="30"><? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? }?></td>
<td width="80" align="right"><b><?=$his_date?></b></td>
<td width="10">&nbsp;</td>
    <td class="history_list">
<div class="history_item">
<?=$his_content?>&nbsp;&nbsp;<? if ($is_admin == "super" || $is_admin == "group")  { ?>
    <a href='<?=$g4[path]?>/bbs/board.php?bo_table=<?=$bo_table?>&wr_id=<?=$ca['wr_id']?>'>[내용]</a>
<a href='<?=$g4[path]?>/bbs/write.php?bo_table=<?=$bo_table?>&w=u&wr_id=<?=$ca['wr_id']?>'>[수정]</a>
<a href="javascript:del('./delete.php?bo_table=<?=$bo_table?>&wr_id=<?=$ca[wr_id]?>&page=');">[삭제]</a>
      <? } ?>
    </div>
    </td>
        </tr>
    </table>
</div>
<?
} //글별 루프 끝
?>
<br class='clear' />
<?
} //카테고리 루프 끝
?>

<br class='clear' />
</form>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
  <td colspan="4" align="center" style="padding-bottom:10px;">
 
      <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/page_search_prev.gif' border='0' align=absmiddle title='이전검색'></a>"; } ?>
<?
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        //echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        //$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><span style=\"color:#4D6185; font-size:12px; text-decoration:underline;\">$1</span></b>", $write_pages);
        ?>
        <?=$write_pages?>
        <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/page_search_next.gif' border='0' align=absmiddle title='다음검색'></a>"; } ?>
  </td>
  </tr>
  <tr><td class="listBL" width="8" height="42"></td>
<td class="listBC" style="padding-top:3px;" height="42">
        <!--
<form name="fsearch" method="get">
        <input type="hidden" name="bo_table" value="<?=$bo_table?>&quot;&gt;
        <input type="hidden" name="sca" value="<?=$sca?>">
        <select name="sfl">
            <option value="wr_subject">제목</option>
            <option value="wr_content">내용</option>
            <option value="wr_subject||wr_content">제목+내용</option>
            <option value="wr_name,1">글쓴이</option>
            </select>
        <input name="stx"  class="ed" style='height:20px;' maxlength="10" itemname="검색어" required value='<?=$stx?>'>
        <input type="image" src="<?=$board_skin_path?>/img/btn_search.gif" border='0' align="absmiddle">
      </form>
  --&gt;
        </td>
        <td align="right" class="listBC" style="padding-bottom:3px;" height="42">
       
        <? if ($list_href) { ?>
        <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" align="absmiddle" border='0'></a>
        <? } ?>
        <? if ($is_checkbox) { ?>
        <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align="absmiddle" border='0'></a>
        <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" align="absmiddle" border='0'></a>
        <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" align="absmiddle" border='0'></a>
        <? } ?>
        <? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif"  align="absmiddle" border='0'></a><? } ?>
        </td><td class="listBR" width="8">
        </td></tr>
  </table>
<!-- 검색 -->

</td></tr></table>

<script language="JavaScript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
if ('<?=$stx?>') {
    document.fsearch.sfl.value = '<?=$sfl?>';

    if ('<?=$sop?>' == 'and')
        document.fsearch.sop[0].checked = true;

    if ('<?=$sop?>' == 'or')
        document.fsearch.sop[1].checked = true;
} else {
    document.fsearch.sop[0].checked = true;
}
</script>

<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw) {
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str) {
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete() {
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                     
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->

소스입니다. 고수님들 봐주세요 (__)
© SIRSOFT
현재 페이지 제일 처음으로