최신갤러리로 홈피상단과 우측에 배너처럼 쓰는중 랜덤으로 불러오려면...

최신갤러리로 홈피상단과 우측에 배너처럼 쓰는중 랜덤으로 불러오려면...

QA

최신갤러리로 홈피상단과 우측에 배너처럼 쓰는중 랜덤으로 불러오려면...

본문

제목처럼 현재 갤러리게시판을 배너전용으로 쓰려고 만들었습니다.

그 갤러리게시판을 홈페이지 상단이나 우측에 최신글갤러리 스킨을 이용해서 배너처럼 나오게 해서 쓰고 있습니다. 헌데 어느 페이지와 어느 게시판을 가든 최신글갤러리 형식으로 불러온 배너(이미지)라 보니 똑같잖아요? 엄청 지루하고 답답하게 똑같은것만 페이지가 바껴도 나오니깐요..

그래서 해당 갤러리게시판에 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() 이거 추가하시면 랜덤으로 불러오게 됩니다.

로또루아님 답변 감사합니다. 
쿼리에 order by rand() 이거 추가하시면 랜덤으로 불러오게 됩니다. 라고 하셨는데요.

혹시 최신갤러리 스킨의 latest.skin.php에 들어가는건가요?
아래에 해당 파일인데요. 어디다가 추가를 해줘야하는지 잘 모르겠습니다.



<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

$imgwidth = 200; //표시할 이미지의 가로사이즈
$imgheight = 200; //표시할 이미지의 세로사이즈
?>

<style>
#oneshot { position:relative;margin:0 0 0 -5px;}
#oneshot .la_title{position:absolute; left:0; top:0; z-index:100; background:#000; padding:5px; font-size:1em; color:#fff;margin:0 0 0 5px;filter:alpha(opacity=50);opacity:.5;}
#oneshot .img_set{width:<?php echo $imgwidth ?>px; height:<?php echo $imgheight ?>px; background:#fafafa;padding:0;}
#oneshot .subject_set{width:<?php echo $imgwidth - 13 ?>px; height:58px; padding:5px 10px 10px 3px; z-index:1; bottom:0; left:0;}
#oneshot .subject_set .sub_title{color:#333;height:17px;overflow:hidden;padding:3px 0 0 0;font-size:1.2em;font-family:NanumBarunGothic,dotum;}
#oneshot .subject_set .sub_content{color:#8c8a8a;height:30px;overflow:hidden;padding:3px 0 0;font-family:NanumGothic,dotum;}


#oneshot ul {list-style:none;clear:both;margin:0;padding:0;}
#oneshot li{float:left;list-style:none;text-decoration:none;padding:0 0 0 5px}
.subject_set  a:link, a:visited {color:#333;text-decoration:none}
.subject_set  a:hover, a:focus, a:active {color:#e60012;text-decoration:none}

/* 폰트불러오기 */
@font-face {font-family:'NanumBarunGothic';src: url('<?php echo $latest_skin_url ?>/NanumBarunGothic.eot');}
@font-face {font-family:'NanumGothic';src: url('<?php echo $latest_skin_url ?>/NanumGothic.eot');}

</style>
<div id="oneshot" style="width:100%; margin:auto;">
<div class="la_title"><?php echo $bo_subject ?></div>
<ul>
<?php for ($i=0; $i<count($list); $i++) { ?>
<li>
<div class="img_set">
<a href="<?php echo $list[$i]['href'] ?>">
<?php               
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);               
if($thumb['src']) {
$img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
} else {
$img_content = 'NO IMAGE';
}               
echo $img_content;              
?>
</a>
</div>
<br>

</li>
<?php } ?>
</ul>
</div>
<div style="clear:both;"></div>

답변을 작성하시기 전에 로그인 해주세요.
전체 59,810
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT