게시물 관리 기능을 업데이트 해봅시다.
해당 팁은 @펄스나인 님의 게시물 관리 플러그인 사용자 기준입니다.
해당 플러그인을 사용하지 않는 사용자는 해당 사항이 없습니다.
https://sir.kr/g5_plugin/12300

조회수 / 추천수 / 비추천수를 관리 할 수 있습니다.
[code]
bbs_list.php 142번 라인
<th scope="col"><?php echo subject_sort_link('wr_hit'); ?>조회</a></th>
아래 처럼 변경
<th scope="col"><?php echo subject_sort_link('wr_hit'); ?>조회</a></th>
<th scope="col"><?php echo subject_sort_link('wr_good'); ?>추천</a></th>
<th scope="col"><?php echo subject_sort_link('wr_nogood'); ?>비추천</a></th>
[/code]
[code]
bbs_list.php 파일 내 168번 라인
<td class="td_mng td_mng_s"><?php echo $row['wr_hit']; ?></td>
위 코드를 아래 처럼 변경 해주세요
<td class="td_mng td_mng_s"><input style="text-align:center;" type="number" value="<?php echo $row['wr_hit']; ?>" name="wr_hit[<?php echo $i;?>]"></td>
<td class="td_mng td_mng_s"><input style="text-align:center;" type="number" value="<?php echo $row['wr_good']; ?>" name="wr_good[<?php echo $i;?>]"></td>
<td class="td_mng td_mng_s"><input style="text-align:center;" type="number" value="<?php echo $row['wr_nogood']; ?>" name="wr_nogood[<?php echo $i;?>]"></td>
[/code]

[code]
그리고 하단에 보시면 아래 코드가 있습니다.
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn btn_02">
하나더 만들어주세요
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value" class="btn btn_02">
[/code]

[code]
마지막으로 bbs_listupdate.php 파일에 가서 코드 추가합니다.
if($_POST['act_button'] == "선택수정"){
auth_check_menu($auth, $sub_menu, 'd');
for($i=0; $i<$count_post_chk; $i++){
// 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$iwr_id = isset($_POST['wr_id'][$i]) ? (int) $_POST['wr_id'][$k] : 0;
$wr_hit = isset($_POST['wr_hit'][$i]) ? (int) $_POST['wr_hit'][$k] : 0;
$wr_good = isset($_POST['wr_good'][$i]) ? (int) $_POST['wr_good'][$k] : 0;
$wr_nogood = isset($_POST['wr_nogood'][$i]) ? (int) $_POST['wr_nogood'][$k] : 0;
$sql = "update g5_write_{$bo_table} set wr_hit = ${wr_hit}, wr_good = ${wr_good}, wr_nogood = ${wr_nogood} where wr_id = '{$iwr_id}'";
sql_query($sql);
}
}
[/code]
요기까지 하시면 원하시는데로, 조회수 추천수 비추천수를 조작(?)할 수 있습니다.
고맙습니다.
댓글 7개
저에게 참 필요한 팁입니다. 덕분에 해결했어요 :)
고생하셨습니다~ 공개 감사합니다 :D
감사 합니다.
에러가 났는데 알려 주신 코드로 완료되었습니다. 감사합니다.
와우 감사합니다
유용하게 수정했습니다
감사합니다.
유용한 기능 정말 감사합니다^^
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 2575 | 9개월 전 | 549 | ||
| 2574 | 9개월 전 | 924 | ||
| 2573 |
두리삼촌v
|
9개월 전 | 597 | |
| 2572 | 9개월 전 | 545 | ||
| 2571 | 9개월 전 | 590 | ||
| 2570 |
두리삼촌v
|
9개월 전 | 627 | |
| 2569 |
두리삼촌v
|
9개월 전 | 656 | |
| 2568 |
두리삼촌v
|
9개월 전 | 451 | |
| 2567 |
두리삼촌v
|
9개월 전 | 433 | |
| 2566 | 9개월 전 | 729 | ||
| 2565 | 9개월 전 | 656 | ||
| 2564 | 9개월 전 | 463 | ||
| 2563 | 10개월 전 | 1017 | ||
| 2562 |
|
10개월 전 | 666 | |
| 2561 | 10개월 전 | 908 | ||
| 2560 | 10개월 전 | 645 | ||
| 2559 |
|
10개월 전 | 495 | |
| 2558 | 10개월 전 | 648 | ||
| 2557 | 10개월 전 | 944 | ||
| 2556 | 10개월 전 | 1323 | ||
| 2555 | 10개월 전 | 740 | ||
| 2554 |
|
10개월 전 | 735 | |
| 2553 | 10개월 전 | 663 | ||
| 2552 | 10개월 전 | 854 | ||
| 2551 | 10개월 전 | 753 | ||
| 2550 |
|
10개월 전 | 707 | |
| 2549 | 10개월 전 | 1015 | ||
| 2548 | 10개월 전 | 660 | ||
| 2547 | 10개월 전 | 1192 | ||
| 2546 | 10개월 전 | 651 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기