허당빵

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

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) 45회 2019-07-17 09:22
|

댓글 3개

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

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
6년 전 조회 1.2만
6년 전 조회 5,468
6년 전 조회 5,096
6년 전 조회 5,622
6년 전 조회 3,850
6년 전 조회 6,439
6년 전 조회 3만
6년 전 조회 5,650
6년 전 조회 3,671
6년 전 조회 4,035
6년 전 조회 3,510
6년 전 조회 5,016
6년 전 조회 4,809
6년 전 조회 3,751
6년 전 조회 4,001
6년 전 조회 6,563
6년 전 조회 5,313
6년 전 조회 4,320
6년 전 조회 3,710
6년 전 조회 3,686
6년 전 조회 1.2만
6년 전 조회 6,645
6년 전 조회 5,414
6년 전 조회 5,230
6년 전 조회 5,522
6년 전 조회 4,482
6년 전 조회 5,449
6년 전 조회 3,603
6년 전 조회 4,213
6년 전 조회 4,768