[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' '";
게시글 목록
| 번호 | 제목 |
|---|---|
| 23254 | |
| 23244 | |
| 23241 | |
| 23236 | |
| 23200 | |
| 23199 | |
| 23179 | |
| 23174 | |
| 23138 | |
| 23128 | |
| 23125 | |
| 23116 | |
| 23109 | |
| 23099 | |
| 23092 | |
| 23083 | |
| 23079 | |
| 23063 | |
| 23050 | |
| 23036 | |
| 23029 | |
| 23007 | |
| 23003 | |
| 22983 | |
| 22959 | |
| 22943 | |
| 22939 | |
| 22934 | |
| 22905 | |
| 22897 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기