최신갤러리로 홈피상단과 우측에 배너처럼 쓰는중 랜덤으로 불러오려면...
본문
제목처럼 현재 갤러리게시판을 배너전용으로 쓰려고 만들었습니다.
그 갤러리게시판을 홈페이지 상단이나 우측에 최신글갤러리 스킨을 이용해서 배너처럼 나오게 해서 쓰고 있습니다. 헌데 어느 페이지와 어느 게시판을 가든 최신글갤러리 형식으로 불러온 배너(이미지)라 보니 똑같잖아요? 엄청 지루하고 답답하게 똑같은것만 페이지가 바껴도 나오니깐요..
그래서 해당 갤러리게시판에 10개든 20개든 올린다면 매번 랜덤으로 갤러리최신글도 나타나게 하고 싶습니다.
갤러리최신글 스킨을 손봐야될거 같은데요??
어느부분의 어디를 수정하면 될까요? 조언 부탁합니다~
답변 2
/lib/latest.lib.php 여기 파일보시면
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
여기 부분의 쿼리에 추가를 하시면 됩니다.
다른 기능과 충돌되면 안되니
if($bo_table=="겔러리게시판아이디"){
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by rand() limit 0, {$rows} ";
}else{
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
}
쿼리에 order by rand() 이거 추가하시면 랜덤으로 불러오게 됩니다.
답변을 작성하시기 전에 로그인 해주세요.