예원살앙

이윰빌더의 최근게시물 사용시 노이미지란에 랜덤이미지 돌리기

· 2018-02-05 (월) 16:17:59 · 6934 · 3
Capture.JPG

빌더관련 팁이지만 많은 웹진형 최근게시물에 응용될 수 있습니다.

 

../eyoom/user_program/head.php

 

//랜덤숫자 뽑아내서 변수로 넘김

 function rand_i($total) {
            srand((double)microtime()*1000000); 
            $rand_r=rand(1,$total);   
            return $rand_r;
            }

 

해당테마의 최신글 스킨/latest.skin.html

<!--{? .image}-->
<img class="img-responsive" src="{.image}"> //원글의 이미지 썸네일
 <!--{:}-->
<img class="img-responsive" src="../../latest/{=rand_i(30)}.jpg"> //위 랜덤넘버로 랜덤이미지 출력
<!--{/}-->

 

요까지 수정후에 latest 스킨 폴더에 1.jpg ~30.jpg 의 이미지를 넣어두면 됩니다.

 

CSS에

.webzine-latest .img-no_image {position:absolute;top:8px;right:8px;display:inline-block;min-width:35px;padding:0px 

요렇게 넣고

 

<span class="img-no_image">no image</span>

요렇게 랜덤이미지 위에 올리면 캡션까지 보여지게 됩니다.

첨부파일

Capture.JPG (10 KB)
1회 2018-02-05 16:17
|

댓글 3개

2018-02-05 (월) 20:40:54
좋은팁 감사합니다.
감사합니다
감사합니다~~
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
18-02-24 조회 8,714
18-02-23 조회 7,463
18-02-23 조회 9,613
18-02-22 조회 6,388
18-02-22 조회 7,492
18-02-21 조회 7,887
18-02-21 조회 7,035
18-02-20 조회 6,196
18-02-20 조회 7,526
18-02-19 조회 8,239
18-02-19 조회 2.2만
18-02-19 조회 8,853
18-02-15 조회 7,171
18-02-14 조회 1.2만
18-02-13 조회 1.3만
18-02-12 조회 6,421
18-02-09 조회 8,155
18-02-08 조회 1.2만
18-02-08 조회 6,650
18-02-07 조회 1.1만
18-02-06 조회 9,186
18-02-06 조회 7,621
18-02-05 조회 6,935
18-02-05 조회 1만
18-02-04 조회 1만
18-02-03 조회 7,464
18-02-03 조회 8,239
18-01-31 조회 6,851
18-01-31 조회 7,264
18-01-31 조회 1.1만