그누5 플러그인 게시물 작성일, 조회수 수정기능 영카트 적용시 문의사항입니다.

그누5 플러그인 게시물 작성일, 조회수 수정기능 영카트 적용시 문의사항입니다.

QA

그누5 플러그인 게시물 작성일, 조회수 수정기능 영카트 적용시 문의사항입니다.

본문

tempot 님께서 그누5 플러그인에 올려주신 '게시물 작성일, 조회수 수정기능' 을 영카트5에 적용을 해봤는데요,

 


<?php
$sub_menu = "300850";
include_once('./_common.php');
include_once(G5_LIB_PATH."/board_manage_etc_list.class.php");
auth_check($auth[$sub_menu], 'r');
//인스턴스 생성
$board_manage_etc_list = new board_manage_etc_list;
//게시판 목록
$board_list = $board_manage_etc_list->getBoadList();
//print_r2($board_list);
//bo_table 설정
if(!$bo_table) $bo_table=$board_list[0][bo_table];
$board_manage_etc_list->set_bo_table($bo_table);
//페이지 설정
$page_rows=20;
if(!$page) $page = 1;
//리스트 만들기
$board_manage_etc_list->page  = $page;
$board_manage_etc_list->page_rows = $page_rows;
$board_manage_etc_list->orderby = trim(" wr_num, wr_reply ");//정렬
unset($opt);
if($s_wr_id) $opt[s_wr_id] = $s_wr_id;
if($sl_wr_subject) $opt[sl_wr_subject] = $sl_wr_subject;
$opt['simple_wr_content']=1;//태그 없애도 짧게 잘라서 리턴함
$list = $board_manage_etc_list->lists($opt);
//print_r2($list);
//페이지
$total_count = $list[total_count];
$total_page=$list[total_page];
$g5['title'] = "날짜조회수관리";
include_once('./admin.head.php');
?>
<div class="tbl_head01 tbl_wrap">
    <form name="fsearch" id="fsearch" action="<?=$PHP_SELF?>" method="GET">
        <table>
            <tr>
                <td align="left">
                    <span>Total <?=number_format($total_count) ?>건</span>
                    <?php echo $total_page ?> 페이지
                </td>
                <td align="center" width="80">게시판선택</td>
                <td align="center" width="120">
                    <select name="bo_table">
                        <option value="">게시판 선택</option>
                        <?
                        if(count($board_list)) {
                            foreach($board_list as $k => $v) {
                        ?>
                        <option value="<?=$v[bo_table]?>" <?if($bo_table==$v[bo_table]){?>selected<?}?>>
                            <?=$v[bo_subject]?> (<?=$v[bo_table]?>)
                        </option>
                        <?
                            }
                        }
                        ?>
                    </select>
                </td>
                <td align="center" width="80">고유번호</td>
                <td align="center" width="60"><input type="text" name="s_wr_id" size="10" class="frm_input" value="<?=$s_wr_id?>" /></td>
                <td align="center" width="60">제목</td>
                <td align="center" width="60"><input type="text" name="sl_wr_subject" size="10" class="frm_input" value="<?=$sl_wr_subject?>" /></td>
                <td align="center" width="60"><input type="submit" name="submit" value="검색" class="btn_default" style="height:34px;line-height:0px;" /></td>
            </tr>
        </table>
    </form>
</div>

<div class="tbl_head01 tbl_wrap">
    <table>
        <caption><?php echo $g5['title']; ?> 목록</caption>
        <thead>
        <tr>
            <th scope="col" width="80">고유번호</th>
            <th scope="col" width="">제목</th>
            <th scope="col" width="180">등록일</th>
            <th scope="col" width="180">최종수정일</th>
            <th scope="col" width="120">조회수</th>
        </tr>
        </thead>
        <tbody>
        <?php
        if($list['list']) {
            foreach($list['list'] as $k => $v) {
                $no = $list[total_count] - ($page - 1) * $page_rows - $k;
                $bg = 'bg'.($k%2);
                ?>
                <tr class="<?php echo $bg; ?>">
                    <td align="center">
                        <a href="<?=G5_BBS_URL?>/board.php?bo_table=<?=$bo_table?>&wr_id=<?=$v[wr_id]?>" target="_blank" style="color:blue;">
                            <?=$v[wr_id]?>
                        </a>
                    </td>
                    <td>
                        <?
                        if($v[wr_reply]){
                            for($i=0;$i<strlen($v[wr_reply]);$i++) {
                                echo "<span class='gray'>[r]</span>";
                            }
                        }
                        ?>
                        <?
                        if($v[wr_is_comment]){
                            for($i=0;$i<strlen($v[wr_comment_reply])+1;$i++) echo "<span class='gray'>[c]</span>";
                            echo ' '.$v[wr_content];
                        } else {
                            echo ' '.$v[wr_subject];
                        }
                        ?>
                    </td>
                    <td align="center">
                        <input type="text" id="wr_datetime_<?=$v[wr_id]?>" value="<?=$v[wr_datetime]?>" />
                        <input type="button" onclick="update('<?=$bo_table?>', '<?=$v[wr_id]?>', 'wr_datetime')" value="수정" />
                    </td>
                    <td align="center">
                        <?if($v[wr_is_comment]) {?>
                            <?='-';?>
                        <?} else {?>
                            <input type="text" id="wr_last_<?=$v[wr_id]?>" value="<?=$v[wr_last]?>" />
                            <input type="button" onclick="update('<?=$bo_table?>', '<?=$v[wr_id]?>', 'wr_last')" value="수정" />
                        <?}?>
                    </td>
                    <td align="center">
                        <?if($v[wr_is_comment]) {?>
                            <?='-';?>
                        <?} else {?>
                            <input type="text" id="wr_hit_<?=$v[wr_id]?>" value="<?=$v[wr_hit]?>" style="width:30px;" />
                            <input type="button" onclick="update('<?=$bo_table?>', '<?=$v[wr_id]?>', 'wr_hit')" value="수정" />
                        <?}?>
                    </td>
                </tr>
                <?php
            }
        }
        ?>
        </tbody>
    </table>
</div>
<?php
$page_parameter="bo_table={$bo_table}&s_wr_id={$s_wr_id}&sl_wr_subject={$sl_wr_subject}";
echo get_paging($page_rows, $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$page_parameter);
?>
 
<style>
    .tbl_wrap input[type=text] {
        width:110px;
        border:1px solid #AAA;
        padding:2px;
        text-align: center;
    }
    .tbl_wrap select {
        padding:5px;
    }
    .tbl_wrap tr:hover td {
        background-color: yellow;
    }
    .btn_default {border:1px solid #ccc; background:#fafafa;padding:10px;}
    .gray {font-size:10px;color:gray;}
</style>
<script>
    function update(bo_table, wr_id, what) {
        var val=$('#'+what+'_'+wr_id).val();
        if(!val) {
            alert('값이 없습니다.');
            return;
        }
        if(!confirm('['+val+']로 수정하시겠습니까?')) {
            return false;
        }
        $.post('./board_manage_etc_list_ajax.php',{'bo_table':bo_table,'wr_id': wr_id,'what':what,'val':val}, function(data) {
            if(data=='200') {
                location.reload();
            } else {
                alert('Error:'+data);
            }
        }).fail(function(xhr, ajaxOptions, thrownError) {
            alert(thrownError);
        });
    }
</script>
<?php
include_once('./admin.tail.php');
?>
 

 

 

영카트에 적용해보니 출력값들이 출력되지 않아, 위 board_manage_etc_list.php 파일에서

<?=number_format($total_count) ?> 형식의 코드들을 <?php echo number_format($total_count) ?>로 변경해줬습니다. 변경 후 토탈건수 등의 출력부분이 나오기는하는데 그래도 게시판선택 및 제목이 제대로 출력되지 않아 문의드립니다. 어떤 조언이라도 남겨주시면 감사하게 확인해보겠습니다!

 

425d98fe89677b651726e54b7aa2d67f_1483342714_2202.png
 

이 질문에 댓글 쓰기 :

답변 1

이건 오류 구문을 찍어봐야 할듯 합니다. $list 변수에 제대로 전달해서 오는지랑 오류나는게 어디인지를 체크해 봐야 할듯 싶습니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 27
QA 내용 검색

회원로그인

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