최신글에서 첫번째 게시글만 글자색과 굵게 하려면 어떻게 하나요? > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

최신글에서 첫번째 게시글만 글자색과 굵게 하려면 어떻게 하나요? 정보

최신글에서 첫번째 게시글만 글자색과 굵게 하려면 어떻게 하나요?

본문

<? for ($i=0; $i<count($list); $i++) { ?>

위 부분에서 아래처럼 고치면 된다는데 어떻게 고치면 된다고 하는데요.

아래소스는 글자만 굵게해 주는것 같고..색상까지 따로 줄려면 어떻게 하면 될가요?

$i =  0 ~ 최근게시물 갯수로 불러 들이니 ...
if ... $i 가 0 일 때 ... style="font-weight:bold" else  ... style="font-weight:normal" 로 주면 됨.


최신글소스.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="3" background="<?=$latest_skin_path?>/img/latest_t_1.gif"></td>
        <td background="<?=$latest_skin_path?>/img/latest_t_bg.gif">
</td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_t_2.gif"></td>
</tr>
<tr>
<td width="3" background="<?=$latest_skin_path?>/img/latest_m_1.gif"></td>
<td>
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<!--게시물 아래 점선 색상을 바꾸고 싶으시면 211,211,211부분을, 게시물 추출부분 세로 길이를 늘리시려면 25을 수정하세요-->
<td width="100%" height="23" valign=middle style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">

<?
//날짜표시
$subject = "".$list[$i][subject]."";
$b_subject = "".$list[$i][subject]."";
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
<tr>
                                <td width="10">
                                    <table width="17" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="8"><img src='<?=$latest_skin_path?>/img/<?=$i+1?>.gif' align=absmiddle></td>
                                            <td width="1">&nbsp;</td>
                                        </tr>
                                    </table>
</td>
<td width="895"><a href='<?=$list[$i][href]?>'><span class="th8"><?if ($list[$i][is_notice])
echo $b_subject;
else
echo $subject;
?></span></a>
<span style="font-size:8pt;font-family:tahoma;color:#FC0473;vertical-align:1px;"><?=$list[$i][comment_cnt]?> <?

?>
</span>
</td>



</tr>
</table>
<!--게시물 추출 글자 설정 끝-->
</td>
</tr>
<? } ?>
</table>
</td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_m_2.gif"></td>
</tr>
<tr height="3">
<td width="3" background="<?=$latest_skin_path?>/img/latest_b_1.gif"></td>
<td background="<?=$latest_skin_path?>/img/latest_b_bg.gif"></td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_b_2.gif"></td>
</tr>
</table>
  • 복사

댓글 전체

if ... $i 가 0 일 때 ... style="font-weight:bold" else  ... style="font-weight:normal" 로 주면 됨.

if($i==0){
 $style = "style='font-weight:bold;color:red;'";
}else{
 $style = "";
}

style  추가할때 color 도 주시면 됩니다
© SIRSOFT
현재 페이지 제일 처음으로