최근게시물 사용시 노이미지란에 랜덤이미지 돌리기 > 시즌3 팁 & 테크

본문 바로가기

시즌3 팁 & 테크

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

2018-02-05 16:35 13,989 4 0
  • - 첨부파일 : Capture.JPG (10.0K) - 다운로드

본문

1. ../eyoom/user_program/head.php 에 아래 내용 추가

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

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

 

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

<style> 태그중에

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

삽입

 

44라인쯤

<!--{? .image}-->
<img class="img-responsive" src="{.image}">
<!--{? .wr_comment}--><span class="img-comment">+{=number_format(.wr_comment)}</span><!--{/}-->
<!--{? .is_video}--><span class="video-icon"><i class="fa fa-play-circle-o"></i></span><!--{/}-->
<!--{:}-->
<img class="img-responsive" src="../../latest/{=rand_i(30)}.jpg"> //수정부분
<!--{? .wr_comment}--><span class="img-comment">+{=number_format(.wr_comment)}</span><!--{/}--> //수정부분
<span class="img-no_image">no image</span>
<!--{/}-->

 

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

0
로그인 후 추천 또는 비추천하실 수 있습니다.

댓글목록4

1님의 댓글

1
2018-02-06 01:37
와...아직 해보지는 않았지만 일단 좋은 것 같아서 ...감사드립니다

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

2님의 댓글

2
2018-02-07 15:09
좋은 팁 감사합니다

2님의 댓글

2
2018-02-07 15:10
감사합니다

3님의 댓글

3
2018-03-16 13:28
감사합니다
전체 129 건 - 1 페이지
번호
제목
글쓴이
2022-06-27
128
2022-02-17
11,787
0
2022-02-17
2018-02-22
2018-02-05
2017-09-06
2017-08-24
2016-08-24
2016-08-12
2016-03-26
2016-03-26
2016-01-27
2015-10-27
2015-10-26
2015-10-26
2015-10-06
사이트 내 전체검색