1원팁 전체게시판 랜덤 게시물 조회수 랜덤으로 조작 정보
1원팁 전체게시판 랜덤 게시물 조회수 랜덤으로 조작![](http://sir.kr/data/member_image/fb/fb_mv37ifbp.gif?1530060488)
본문
$Search = " where (1) ";
$Search .= " and wr_is_comment = 0 and wr_datetime >= (NOW() - INTERVAL 7 DAY) ";
$SelectBoard = " select bo_table from ".$g5['board_table'];
$QueryBoard = sql_query($SelectBoard);
while($RowBoard = sql_fetch_array($QueryBoard)){ $ResultSelect[] = "( select *, '".$RowBoard['bo_table']."' as bo_table from ".$g5['write_prefix'].$RowBoard['bo_table'].$Search." )"; }
$ResultQuery = implode(" union all ", $ResultSelect);
$ResultQuery .= " order by rand() limit 10 ";
$Query = sql_query($ResultQuery);
while($Row = sql_fetch_array($Query)){
$Rand = rand(1, 50);
sql_query(" update ".$g5['write_prefix'].$Row['bo_table']." set wr_hit = wr_hit+".$Rand." where wr_id = ".$Row['wr_id']." ");
}
모든 게시판에 적용 됩니다.
$Rand = rand(1, 50); // 1부터 50까지 랜덤으로 올라갑니다.
!-->
추천
2
2
댓글 8개
오 이런게 감사합니다
![](http://sir.kr/data/member_image/fb/fb_mv37ifbp.gif?1530060488)
감사합니다!!
엇..그럼 50~150까지면 50,150 할 경우에 적용 되는건가요? 혹시 0이나 적용 안하고 싶을때 처리는 어떻게 해야 할까요? 예를 들어서 0이 아니라 10 100 150 이렇게 3개일 경우는 적용 안하게 하는거요..if문안쓰고도 가능할까요?
![](http://sir.kr/data/member_image/fb/fb_mv37ifbp.gif?1530060488)
네네 50~150까지면 50, 150으로 하시면되구요!
특정 게시판을 제외 하시고 싶으시면
$SelectBoard = " select bo_table from ".$g5['board_table'];
이부분을
$SelectBoard = " select bo_table from ".$g5['board_table']." where (1) and bo_table != 'test' '"; // test는 게시판 테이블명 이 아닌 것만 추출 하게 됩니다.!
만약 test1, test2 게시판을 제외 하시고 싶다면
$SelectBoard = " select bo_table from ".$g5['board_table']." where (1) and bo_table != 'test1' and bo_table != 'test2' '";
특정 게시판을 제외 하시고 싶으시면
$SelectBoard = " select bo_table from ".$g5['board_table'];
이부분을
$SelectBoard = " select bo_table from ".$g5['board_table']." where (1) and bo_table != 'test' '"; // test는 게시판 테이블명 이 아닌 것만 추출 하게 됩니다.!
만약 test1, test2 게시판을 제외 하시고 싶다면
$SelectBoard = " select bo_table from ".$g5['board_table']." where (1) and bo_table != 'test1' and bo_table != 'test2' '";
좋은정보 주셔서 감사합니다.
board.php 파일을 수정하면 되는건가요?? 어느 파일을 수정해야할지. 궁금합니다!^^
board.php 파일을 수정하면 되는건가요?? 어느 파일을 수정해야할지. 궁금합니다!^^
![](http://sir.kr/data/member_image/fb/fb_mv37ifbp.gif?1530060488)
추천 드리는 경로는 extend 폴더에 user.config.php 하단에 넣으면 알아서 작동 합니다!
시간 타이밍이 어떻게 되는지요?
너무 자주 조회수가 올라가서... 시간 타이밍 조정은 어려울까요?
너무 자주 조회수가 올라가서... 시간 타이밍 조정은 어려울까요?
![](http://sir.kr/data/member_image/de/dew3232.gif?1423102272)
잘되네요.
감사합니다.
감사합니다.