질문과 답변 (구)

최근본상품
TOP
DOWN

질문과 답변 (구)

클릭때마다 최근게시물(갤러리) 순서 랜덤하게 하는 방법 부탁드립니다

2015.09.12 03:27 1,168 2

본문

인덱스파일

 

<?php echo latest("최근게시물스킨", "게시판명", 30, 50); ?>

 

latest.skin.php 파일

 

<?php
if (!defined('_GNUBOARD_')) exit; //개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// 스넵이미지 생성함수
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$n_thumb_width = 310;  //썸네일 가로 크기
$n_thumb_height = 250; //썸네일 세로 크기
?>

<div class="latest_jw_ga_bbs_01_box">
  <ul>
  <?php for ($i = 0; $i < count($list); $i++) { ?>
    <li class="latest_jw_ga_bbs_01_cop">
  <a class="thumb" href="<?=$list[$i]['href']?>">
   <?php
       $n_thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $n_thumb_width, $n_thumb_height);
        // 스넵이미지 생성하고 뷰어 시킨다.
       $n_noimg = "$latest_skin_url/img/noimg.gif";
        // 이미지가 없을경우의 이미지 위치
     if($n_thumb['src']) {
       $img_content = '<img src="'.$n_thumb['src'].'" width="'.$n_thumb_width.'" height="'.$n_thumb_height.'" alt="'.$list[$i]['subject'].'" title="" />';
     } else {
       $img_content = '<img src="'.$n_noimg.'" width="'.$n_thumb_width.'" height="'.$n_thumb_height.'" alt="이미지없음" title="" />';
     }
       echo $img_content;
     ?>
  </a>
  <span class="cop_txt">
   <?php echo $list[$i]['subject'];?></a>
   <span class="txt_gry"><? echo $list[$i]['name']; ?></span>
  </span>
  </li>
  <?php } ?>
       
 </ul>
</div>

 

style.css 파일

 

 

@charset "utf-8";
/* jworks by.      */
/* http://www.jwcd.co.kr      */
/* *** 개인정보보호를 위한 이메일주소 노출방지 ***      */
 /*  갤러리스킨 ver 1.0 jw_ga_01 */
.latest_jw_ga_bbs_01_box {width: 100%;} /* 리스트box */
.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop {display:inline; float:left;  margin:0px 0 15px 15px; border:1px solid #ebebeb;} /* li, 가로배열,높이,바깥여백 */
.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop a {cursor:pointer;} /* a링크커서 */
.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop .thumb {display:block; position:relative;   overflow:hidden;} /* 썸네일 */

.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop .cop_txt {display:block;  padding:9px 10px 11px;  border-top:1px solid #ebebeb;  font-size: 14px; line-height: 25px; letter-spacing: -1px; } /* 썸네일아래 텍스트box */

.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop .cop_txt .txt_blck {display:block; overflow:hidden; white-space: nowrap; font-weight: bold; text-decoration: none; margin: 1px 0 0; } /* 상단굵은txt,행바꿈안되게 */
.board_jw_ga_bbs_01_box .board_jw_ga_bbs_01_cop .cop_txt a, .board_jw_ga_bbs_01_box .board_jw_ga_bbs_01_cop .cop_txt a:visited {color:#3e3e3e } /* 상단굵은txt a링크 색 */
.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop .cop_txt a:hover{color:#28253a !important; text-decoration: underline;} /* 상단굵은txt a링크 후버색 */


.latest_jw_ga_bbs_01_box .latest_jw_ga_bbs_01_cop .cop_txt .txt_gry {display:block; color:#888; white-space: nowrap; overflow: hidden; }
 /*하단txt */

 

이렇게 작성이 되어 있고 적용해서 사용중입니다.

클릭때마다 랜덤하게 최근게시물 이미지들이 바뀌었으면 하는데 어느 부분에 뭘 넣어줘야 하는지 게시판 뒤져 보고 적용도 해보고 해도 잘 안되어 질문 남깁니다.

왠만하면 찾아서 해보고 할텐데 도저히 안되어 부탁드립니다.

소스들 한번 확인 해보시고 부탁 좀 드리겠습니다.

0
로그인 후 평가 가능합니다.
- 사람사랑 - 회원등급 : 지상계 / Level 6
포인트 5,212
경험치 3,700
[레벨 6] - 진행률 59%
- 가입일 : 2015-03-20 13:36:53
- 서명 : 미입력
- 자기소개 : 미입력

댓글목록 2

shadow님의 댓글

shadow 2015.09.12 12:17

얼마전에 이윰빌더에 대한 최신글 랜덤에 대한 내용을 적어드렸지만 그누보드 자체에 대한 질문은 sir.co.kr에 남기시는게 더 빠른 해답을 얻으실 수 있지 않을까 조심스레 적어봅니다.

축하합니다. 첫댓글 포인트 63포인트를 획득하였습니다.

사람사랑님의 댓글

아 쉐도우님 ~ 그누에도 남겼는데 답글이 거의 없어서 여기에도 한번 남겨 봤습니다~ 감사합니다^^

질문과 답변 (채택기능) 게시판이 신설되었습니다.
질문과 답변 (구) 게시판은 글쓰기가 제한되오니 착오 없으시길 바랍니다. (댓글 및 조회는 여전히 가능합니다.)

전체 2,800 건 - 119 페이지
제목
잘안되네요 2015.09.17 452 0
프리피피티 2015.09.16 545 0
프리피피티 2015.09.16 533 0
삼삼이 2015.09.15 657 0
수국 2015.09.15 634 0
robell 2015.09.15 766 0
야로기 2015.09.15 947 0
이진 2015.09.14 1,042 0
야로기 2015.09.14 1,236 0
야로기 2015.09.13 883 0
야로기 2015.09.13 618 0
야로기 2015.09.13 965 0
야로기 2015.09.12 1,501 0
야로기 2015.09.12 676 0
사람사랑 2015.09.12 1,169 0