페이징처리좀 도와주세요 ㅠㅠ 부탁합니다 (__ > 그누4 질문답변

그누4 질문답변

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

페이징처리좀 도와주세요 ㅠㅠ 부탁합니다 (__ 정보

페이징처리좀 도와주세요 ㅠㅠ 부탁합니다 (__

본문

여기서 여러 고수님들 명쾌한 해설과 그 실력 덕분에

게시판에서 자신의 글만 불러오도록 (자기가 쓴 글만 보이도록) 구현은 했습니다.

그런데 소스를 이곳 저곳을 정성스레 알려주신데로 공사를 하다보니

페이징 기능을 표현하지 못하겠씁니다 ㅠㅠ

가만히 소스를 쳐다보니 전체글을 불러와서 보여주고 그 것을 페이징을 하는 원래 기능인데

저는 보여줄때 자기글만 보여주게 처리했으니 당연히 페이지가 안맞다는 결론을 내렸습니다.

그런데 페이징기능쪽을 쳐다보니 아무리 봐도 모르겠습니다.

조금만 도와주십시요 ㅠㅠ 자기가 쓴 글만 페이징되게 하고 싶습니다.

아래는 소스입니다. 이곳 저곳을 막 수정하다보니 요상(?)한 부분 이해부탁드립니다. (__


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

function get_bo_n_option($bo_n='')
{
    global $g4, $board;

    $arr = explode("|", $board[$bo_n]); // 구분자가 | 로 되어 있음
    $str = "";
    for ($i=0; $i<count($arr); $i++)
        if (trim($arr[$i]))
            $str .= "<option value='$arr[$i]'>$arr[$i]</option>\n";

    return $str;
}

// 분류 사용 여부  list.php에서 참조 (카테고리가 없는 경우에는 이것은 절대 비활성화)
if ($is_category = true) {
    $bo_3_option = get_bo_n_option('bo_3'); // SELECT OPTION 태그로 넘겨받음
    $bo_4_option = get_bo_n_option('bo_4'); // SELECT OPTION 태그로 넘겨받음
    $bo_5_option = get_bo_n_option('bo_5'); // SELECT OPTION 태그로 넘겨받음
    $bo_6_option = get_bo_n_option('bo_6'); // SELECT OPTION 태그로 넘겨받음
}

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 10; // 변경 JSY
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good)   $colspan++;
if ($is_nogood)  $colspan++;


// 현재 게시판에서 회원이 작성한 글 숫자 확인
$sql = " select count(wr_id) as cnt from `{$g4[write_prefix]}{$bo_table}` where mb_id = '{$member[mb_id]}' ";
$result_t = sql_fetch($sql);
// echo "<strong>{$member[mb_nick]}</strong>님께서 작성한 게시물 수 : {$result_t[cnt]}개";

?>


<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>

<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr height="25">
<td align="left">
    <form name=fsearch method=get>
  <a href="<?=$g4[path]?>/bbs/board.php?bo_table=<?=$bo_table?>&sop=and&sst=wr_subject&sod=desc&sfl=&stx=&page=1"><font color=green><b>전체보기</b></font></a>
    <input type=hidden name=bo_table value="<?=$bo_table?>">
    <input type=hidden name=sca      value="<?=$sca?>">
        <select name=sfl>
            <option value='wr_subject'>발생일자</option>
            <option value='wr_10'>기록일자</option>
          <option value='wr_content'>메모내용</option>
            <option value='wr_2'>학생이름</option>
            <option value='wr_3'>수입내용</option>
            <option value='wr_4'>수입구분</option>
    <option value='wr_5'>지출내용</option>
        <option value='wr_6'>지출구분</option>
<!--  <option value='ca_name||wr_subject'>구분및년월</option>    복잡해서 주석처리 KKM-->
        </select>
        <input size=20 name=stx itemname="검색어" required value="<?=$stx?>">
        <select name=sop>
            <option value=or>Or</option>
            <option value=and>And</option>
        </select>
        <input type=image src='<?="$board_skin_path/img/search.gif"?>' border=0 title='검색' align=absmiddle>
</td>
    </form>
<? // JSY ADD END ?>

    <td align="right">

<a href="#" onClick="javascript:window.open('<?=$board_skin_path?>/fr_and_to_date.php?bo_table=<?=$bo_table?>','pop','width=800,height=768,left=0,top=0,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,location=no,status=no')" onFocus=blur()><b><font color=green>+ 기간별검색 및 인쇄</font></b></a>&nbsp;&nbsp;
<?  if ($is_admin) { ?>
        총 등록건수 : <?=number_format($total_count)?>
<?  }?>
        &nbsp;&nbsp;<? /* 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/admin_button.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><?}?></td>
</tr>
<tr><td height=5></td></tr>
</table>

<!-- 제목 -->
<form name="fboardlist" method="post" style="margin:0px;">
<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=''>
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#7D6400></td></tr>
<tr bgcolor=#FFC300 height=30 align=center>
    <td width=45 align=center>번호</td>
    <? if ($is_category) { ?><td width=30><?=subject_sort_link('ca_name', $qstr2)?>분류</td><?}?>
    <? if ($is_checkbox) { ?><td width=30><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td width=75 align=center>
<?=subject_sort_link('wr_subject', $qstr2)?>발생일자
</td>
    <td width=100 align=center>
<?=subject_sort_link('wr_2', $qstr2)?>학생이름(or 제목)
</td>
    <td width=50 align=center>
<?=subject_sort_link('wr_3', $qstr2)?>수입내용
</td>
    <td width=50 align=center>
<?=subject_sort_link('wr_4', $qstr2)?>수입구분
</td>
<td width=75 align=right> <? // 구분체크해서 수입만 ?>
<font color=blue>수입금액</font></a>
</td>
<td width=75 align=right> <? // 구분체크해서 지출만 ?>
        <font color=red >지출금액</font></a>
    </td>

    <td width=50 align=center>
<?=subject_sort_link('wr_5', $qstr2)?>지출내용
</td>
    <td width=50 align=center>
<?=subject_sort_link('wr_6', $qstr2)?>지출구분
</td>
    <td width=75 align=center>기록일자</td>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#7D6400></td></tr>

<!-- 목록 -->

<?  $list_newsum = 0;  //관리자,자신의글만 걸러서 보이게...
    for ($i=0; $i<count($list); $i++) {
$bg = $i%2 ? 0 : 1;
$list_new = $list_newsum
?>

<? if (($list[$i][mb_id] == $member[mb_id]) || $is_admin){ $list_newsum++; ?>


<tr height=28>
    <td width=45 align=center>
       
<? if ($is_admin) { // 관리자는 전체리스트 번호를 쓰고 회원은 현재 게시판에서 회원이 작성한 글 숫자 -1 씩 카운트한다.

        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]}";
        }

else // 요기포함하여 회원이 작성한 글 숫자 -1 씩 카운트
echo $result_t[cnt] - $list_new
?>

</td>

  <? if ($is_category) { ?><td width=30><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 width=30><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>

  <?  // wr_subject 00000000 날짜를 년월일만 취해서 000000으로 표시

    $list_s[$i][wr_subject] = substr($list[$i][wr_subject],2,6);
    $list_year[$i][wr_subject]  = substr($list[$i][wr_subject],0,4); // 00년
    $list_month[$i][wr_subject] = substr($list[$i][wr_subject],4,2); // 00월

  ?>
    <td align=center style='word-break:break-all;' width=75>
        <?
        echo "<a href='{$list[$i][href]}'>";
        if ($list[$i][is_notice])
            echo "<font color='#333333'><strong>{$list[$i][wr_subject]}</strong></font>";
        else
        {
            $style1 = $style2 = "";
       
            echo "<span style='$style1 $style2'>{$list[$i][wr_subject]}</span>";
        }
        echo "</a>";
        ?></td>

    <td align=center width=100><?=$list[$i][wr_2]?></td>
    <td align=center width=50><?=$list[$i][wr_3]?></td>
    <td align=center width=50><?=$list[$i][wr_4]?></td>

  <? if ($list[$i][ca_name] == '수입') { ?>
    <td align=right style='padding-right:25;'><font color=blue><?=number_format($list[$i][wr_1])?></font></td>
    <td align=right style='padding-right:25;'><font color=CCCCCC>0</font></td>
<? } ?>
    <? if ($list[$i][ca_name] == '지출') { ?>
      <td align=right style='padding-right:25;'><font color=CCCCCC>0</font></td>
      <td align=right style='padding-right:25;'><font color=red><?=number_format($list[$i][wr_1])?></font></td>
    <? } ?>
    <td align=center width=50><?=$list[$i][wr_5]?></td>
    <td align=center width=50><?=$list[$i][wr_6]?></td>

    <td align=center width=70><font color=green><?=$list[$i][wr_10]?></font></td>

    <?  // 검색내역총계(페이지합)
        if ($list[$i][ca_name] == "수입") {
                $sub_suip1 += $list[$i][wr_1];
        }
        if ($list[$i][ca_name] == "지출") {
                $sub_jich1 += $list[$i][wr_1];
        }
            $sub_sum_total1 = $sub_suip1 - $sub_jich1;
            $sub_sum_total2 = $sub_suip2 - $sub_jich2;
    ?>

</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#FDF0C4></td></tr>
<? } ?>
<? } ?>

<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#7D6400 height=1>
</table>
</form>

<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>

    <td align=center style='padding-top:10';><b><?=$member[mb_nick]?></b>님의 총 등록 건수는 <font color="red"><b><?=$result_t[cnt]?></b></font> 건 입니다.</td>
</tr>
<tr>
    <td width="100%" align="center" height=30 valign=bottom>
        <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; } ?>
        <?
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        // echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
        ?>
        <?=$write_pages?>
        <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
    </td>
<tr>
    <td>&nbsp;</td>
</tr>

</tr>
</table>
...

댓글 전체

$sql = " select count(wr_id) as cnt from `{$g4[write_prefix]}{$bo_table}` where mb_id = '{$member[mb_id]}' ";
$result_t = sql_fetch($sql);

여기 보면 글 카운터 값이 wr_id로 되어 있습니다

wr_name로 바꿔주셔야 될꺼 같은데요
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT