게시판 타이틀 클릭시 오름차순/내림차순으로 번갈아가며 정렬되게... 질문입니다.

<th>예약번호</th>
        <? if ($is_checkbox) { ?><th><input onclick="if (this.checked) all_checked(true); else all_checked(false);" type="checkbox"></th><?}?>
        <th>예약자</th>
        <th>방문일</th>                      <<============================================= '방문일'을 클릭시 오름차순/내림차순으로 번갈아가며 정렬되게하려만??
  <th>처리사항</th>
        <th><?=subject_sort_link('wr_datetime', $qstr2, 1)?>예약일시</a></th>              <<<=================================='예약일시' 클릭시 오름차순/내림차순 정렬은 됩니다..
    </tr>

    <?
    for ($i=0; $i<count($list); $i++) {
        $bg = $i%2 ? 0 : 1;
    ?>

    <tr class="bg<?=$bg?>">
        <td class="num">
   <?=$list[$i][wr_id];//echo $list[$i][num];?>
        </td>
        <? if ($is_checkbox) { ?><td class="checkbox"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
        <td class="name">
            <?
            echo $nobr_begin;
            echo $list[$i][reply];
            echo $list[$i][icon_reply];
            if ($is_category && $list[$i][ca_name]) {
                echo "<span class=small><font color=gray>[<a href='{$list[$i][ca_name_href]}'>{$list[$i][ca_name]}</a>]</font></span> ";
            }

            if ($is_admin) echo "<a href='write.php?bo_table=$bo_table&w=u&wr_id={$list[$i][wr_id]}'>{$list[$i][wr_name]}</a>";
   else echo "<a href='password.php?bo_table=$bo_table&w=u&wr_id={$list[$i][wr_id]}'>{$list[$i][wr_name]}</a>";

            //if ($list[$i][comment_cnt])
            //    echo " <a href=\"{$list[$i][comment_href]}\"><span class='comment'>{$list[$i][comment_cnt]}</span></a>";

            echo " " . $list[$i][icon_new];
            echo $nobr_end;
            ?>
        </td>
        <td class="datetime"><?=substr($list[$i][wr_subject],0,4)?>-<?=substr($list[$i][wr_subject],4,2)?>-<?=substr($list[$i][wr_subject],6,2)?></td>
        <td class="name"><?=$list[$i][wr_10]?></td>
        <td class="datetime"><?=$list[$i][wr_datetime]?></td>

 


------------------------------------------------------------------------------------------------------

<th><?=subject_sort_link('wr_subject', $qstr2, 1)?>방문일</a></th>    <<----- 이렇게하면 될 줄 알았는데....  오름차순 정렬만되며...내림차순정렬은 되지 않네요...--;
고수님들의 도움 부탁드립니다.

|

댓글 3개

bbs/list.php 내용중에 아래 부분을 찾아서 필드를 추가해주세요

// 게시물 리스트의 정렬 대상 필드가 아니라면 공백으로 (nasca 님 09.06.16)
// 리스트에서 다른 필드로 정렬을 하려면 아래의 코드에 해당 필드를 추가하세요.
// $sst = preg_match("/^(wr_subject|wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
$sst = preg_match("/^(wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
감사합니다..
끄벅~~^^;
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
16년 전 조회 945
16년 전 조회 1,536
16년 전 조회 1,082
16년 전 조회 1,507
16년 전 조회 1,600
16년 전 조회 1,514
16년 전 조회 980
16년 전 조회 1,740
16년 전 조회 1,511
16년 전 조회 4,142
16년 전 조회 2,522
16년 전 조회 954
16년 전 조회 1,191
16년 전 조회 1,505
16년 전 조회 1,506
16년 전 조회 1,436
16년 전 조회 1,108
16년 전 조회 1,520
16년 전 조회 1,101
16년 전 조회 1,566
🐛 버그신고