[code]
$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']." ");
}
[/code]
모든 게시판에 적용 됩니다.
$Rand = rand(1, 50); // 1부터 50까지 랜덤으로 올라갑니다.
댓글 8개
특정 게시판을 제외 하시고 싶으시면
$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' '";
게시글 목록
| 번호 | 제목 |
|---|---|
| 24149 | |
| 24140 | |
| 24133 | |
| 24125 | |
| 24119 | |
| 24109 | |
| 24105 | |
| 24101 | |
| 24093 | |
| 24089 | |
| 24077 | |
| 24074 | |
| 24071 | |
| 24070 | |
| 24067 | |
| 24056 | |
| 24050 | |
| 24046 | |
| 24043 | |
| 24040 | |
| 24037 | |
| 24036 | |
| 24035 | |
| 24034 | |
| 24021 | |
| 24017 | |
| 24005 | |
| 24002 | |
| 23990 | |
| 23980 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기