허당빵

리스트에서 원하는 게시물 제목에 색상 넣기

1. 먼저 첨부한 파일 iColorPicker.js를 list.skin.php가 있는 폴더에 넣어주시고 write.skin.php에 다음처럼 스크립트를 넣습니다.


<script src="<?php echo $board_skin_url?>/iColorPicker.js" type="text/javascript"></script>

 

 

2. write.skin.php에서 파란색 부분을 다음처럼 넣습니다. (여분필드 wr_5)


<th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th>
........

........
<div id="autosave_pop">
    <strong>임시 저장된 글 목록</strong>
    <div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
    <ul></ul>
    <div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
</div>
<?php } ?>
<input id="color1" class="frm_input iColorPicker" type="text" name="wr_5" value="<?php if($write['wr_5']){echo $write['wr_5'];} else { echo "#000000";} ?>" />

 

 

3. list.skin.php에서 다음과 같이 하여 리스트의 제목 출력 시 색상이 나타나도록 합니다.
<span style="color:<?php echo $list[$i]['wr_5'] ?>">                    
<?php echo $list[$i]['subject'] ?>
</span>

 

제목을 진하게 하려면 다음을 넣으십시오~ 
<span style="color:<?php echo $list[$i]['wr_5'] ?>;<?php if ($list[$i]['wr_5']){ echo 'font-weight:bold'; } ?>">

 

* 다음의 스킨을 참조하였습니다.
제로나라님의 iColorPicker을 이용한 제목에 색상을 적용 → https://sir.kr/g5_skin/5618

첨부파일

iColorPicker.js (7.9 KB) 46회 2019-07-17 09:22
|

댓글 3개

원하고 있던 소스입니다. 감사합니다.
감사합니다.^^ 잘쓰겠습니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
6년 전 조회 1.2만
6년 전 조회 5,666
6년 전 조회 5,272
6년 전 조회 5,799
6년 전 조회 4,064
6년 전 조회 6,616
6년 전 조회 3.1만
6년 전 조회 5,827
6년 전 조회 3,829
6년 전 조회 4,210
6년 전 조회 3,672
6년 전 조회 5,199
6년 전 조회 4,996
6년 전 조회 3,929
6년 전 조회 4,187
6년 전 조회 6,740
6년 전 조회 5,484
6년 전 조회 4,506
6년 전 조회 3,900
6년 전 조회 3,849
6년 전 조회 1.2만
6년 전 조회 6,841
6년 전 조회 5,626
6년 전 조회 5,419
6년 전 조회 5,724
6년 전 조회 4,670
6년 전 조회 5,637
6년 전 조회 3,779
6년 전 조회 4,386
6년 전 조회 4,949