최신글에서 첫번째 게시글만 글자색과 굵게하는 소스인데요?

· 2012-07-30 (월) 21:45:16 · 1732 · 3
아래 소스는 최신글에서 첫번째 게시글만 글자색과 굵게하는 소스인데요.

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

위 소스를 최신글 소스에다가 수정을해야 하는데 방법을 모르겠습니다.

아시는분 설명줌 부탁드려요^^

최신글 원본소스.

<?
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"> </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>
|

댓글 3개

2012-07-30 (월) 23:34:37
<? for ($i=0; $i<count($list); $i++) {
if($i==0){
$spanclass = "th8n";
}else{
$spanclass = "th8";
}
?>

<td width="895"><a href='<?=$list[$i][href]?>'><span class="<?=$spanclass?>"><?if ($list[$i][is_notice])
echo $b_subject;
else
echo $subject;
?></span></a>


위처럼 하시고 th8n 의 style 에 font-weight:bold;color:red; 이걸 넣으심 됩니다
넓은 마인드님 알려주셔서 일단 감사드리구요^^

근대 아래 처럼 수정하여 적용하니 안되네요.뭐가 문제일가요?

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

<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="3" background="hg/<?=$latest_skin_path?>/img/latest_t_1.gif"></td>
<td background="hg/<?=$latest_skin_path?>/img/latest_t_bg.gif">
</td>
<td width="3" background="hg/<?=$latest_skin_path?>/img/latest_t_2.gif"></td>
</tr>
<tr>
<td width="3" background="hg/<?=$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++) {
if($i==0){
$spanclass = "font-weight:bold;color:red;";
}else{
$spanclass = "font-weight:bold;color:red;";
}
?>
<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="hg/<?=$latest_skin_path?>/img/<?=$i+1?>.gif" align=absmiddle></td>
<td width="1"> </td>
</tr>
</table>
</td>
<td width="895"><a href='<?=$list[$i][href]?>'><span class="<?=$spanclass?>"><?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="hg/<?=$latest_skin_path?>/img/latest_m_2.gif"></td>
</tr>
<tr height="3">
<td width="3" background="hg/<?=$latest_skin_path?>/img/latest_b_1.gif"></td>
<td background="hg/<?=$latest_skin_path?>/img/latest_b_bg.gif"></td>
<td width="3" background="hg/<?=$latest_skin_path?>/img/latest_b_2.gif"></td>
</tr>
</table>
2012-07-31 (화) 09:44:00
if($i==0){
$spanclass = "font-weight:bold;color:red;";
}else{
$spanclass = "";
}

위처럼 스타일을 바로 지정하시려면

<span style="<?=$spanclass?>">

이렇게 넣어주셔야 합니다

style 안에 넣어주셔야 스타일이 바로 구현되고요
제가 드린건 class 로 이름을 변경해줘서 하는 방식입니다
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
12-07-30 조회 1,733
12-07-30 조회 957
12-07-30 조회 1,093
12-07-30 조회 1,085
12-07-30 조회 758
12-07-30 조회 1,189
12-07-30 조회 1,635
12-07-30 조회 1,096
12-07-30 조회 807
12-07-30 조회 1,120
12-07-30 조회 2,670
12-07-30 조회 1,717
12-07-30 조회 924
12-07-30 조회 1,733
12-07-30 조회 1,711
12-07-30 조회 908
12-07-30 조회 2,868
12-07-30 조회 1,880
12-07-30 조회 1,645
12-07-30 조회 1,122