최신글 스킨에서 제목색 변경.... 정보
최신글 스킨에서 제목색 변경....- narasarang 홈페이지 자기소개 아이디로 검색 회원게시물
- 1,596
본문
위에사진(사진은 다른 분의 홈페이지에요^^)
에서 보시는거와 같이 최신글 스킨 제목만 가로로 나열 하는것까진 성공 했는데..
글 제목 마다 색깔이 다르게 나오고 싶어서 이렇게 질문 올립니다
latest.skin.php 는...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$rows = count($list);
$style_name = "mw-group-$bo_table-$rows-$subject_len";
?>
<style type="text/css">
#<?=$style_name?> .subject { clear:both; height:30px; color:#3DB7CC; font-weight:bold; font-size:13px; }
#<?=$style_name?> .subject a { color:#11C1BF; text-decoration:none; }
</style>
<div id="<?=$style_name?>">
<? shuffle($list);
for ($i=0; $i<$rows; $i++) {
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<? for ($i=0; $i<count($list); $i++) { ?>
<a href="<?=$list[$i][href]?>"><span style="font-size:14px;"><?=$list[$i][subject]?></span></a>
<?php } ?>
</td>
</tr>
</table>
<? } ?>
<? if (count($list) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td></td>
</tr>
</table>"; } ?>
</div>
에서 보시는거와 같이 최신글 스킨 제목만 가로로 나열 하는것까진 성공 했는데..
글 제목 마다 색깔이 다르게 나오고 싶어서 이렇게 질문 올립니다
latest.skin.php 는...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$rows = count($list);
$style_name = "mw-group-$bo_table-$rows-$subject_len";
?>
<style type="text/css">
#<?=$style_name?> .subject { clear:both; height:30px; color:#3DB7CC; font-weight:bold; font-size:13px; }
#<?=$style_name?> .subject a { color:#11C1BF; text-decoration:none; }
</style>
<div id="<?=$style_name?>">
<? shuffle($list);
for ($i=0; $i<$rows; $i++) {
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<? for ($i=0; $i<count($list); $i++) { ?>
<a href="<?=$list[$i][href]?>"><span style="font-size:14px;"><?=$list[$i][subject]?></span></a>
<?php } ?>
</td>
</tr>
</table>
<? } ?>
<? if (count($list) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td></td>
</tr>
</table>"; } ?>
</div>
댓글 전체
.color1 {color:#원하는색1}
.color2 {color:#원하는색2}
.color3 {color:#원하는색3}
.color4 {color:#원하는색4}
.color5 {color:#원하는색5}
.color6 {color:#원하는색6}
.color7 {color:#원하는색7}
.color8 {color:#원하는색8}
.color9 {color:#원하는색9}
처럼 스타일시트에 입력하시고,
이 부분을
<? for ($i=0; $i<count($list); $i++) { ?>
<a href="<?=$list[$i][href]?>"><span style="font-size:14px;"><?=$list[$i][subject]?></span></a>
<?php } ?>
이렇게 바꿔보세요.
<? for ($i=0; $i<count($list); $i++) {
$color_class = mt_rand(1, 9);
?>
<a href="<?=$list[$i][href]?>" class="color<?=$color_class;?>"><span style="font-size:14px;"><?=$list[$i][subject]?></span></a>
<?php } ?>
기존에 a 에 다른 스타일이 적용된 상태라면,
.color1 {color:#원하는색1 !important} 같이 쓰시면 될 겁니다.
.color2 {color:#원하는색2}
.color3 {color:#원하는색3}
.color4 {color:#원하는색4}
.color5 {color:#원하는색5}
.color6 {color:#원하는색6}
.color7 {color:#원하는색7}
.color8 {color:#원하는색8}
.color9 {color:#원하는색9}
처럼 스타일시트에 입력하시고,
이 부분을
<? for ($i=0; $i<count($list); $i++) { ?>
<a href="<?=$list[$i][href]?>"><span style="font-size:14px;"><?=$list[$i][subject]?></span></a>
<?php } ?>
이렇게 바꿔보세요.
<? for ($i=0; $i<count($list); $i++) {
$color_class = mt_rand(1, 9);
?>
<a href="<?=$list[$i][href]?>" class="color<?=$color_class;?>"><span style="font-size:14px;"><?=$list[$i][subject]?></span></a>
<?php } ?>
기존에 a 에 다른 스타일이 적용된 상태라면,
.color1 {color:#원하는색1 !important} 같이 쓰시면 될 겁니다.
정말 감사 합니다^^
good! ~^^