최신글 앞 카테고리에 이미지 달수있나요? 정보
최신글 앞 카테고리에 이미지 달수있나요?본문
안녕하세요
최신글 스킨받아서 홈피 넣을려고 하는데
스킨은 한게시판에 카테고리가 3개있을경우
카테고리별로 최신글로 뽑아오는 스킨입니다..
[공지] 알립니다.홈페이지.....
[뉴스] 뉴스게시판이니ㅁ...
[이벤트] 이벤트가 시작돠어...
대략 이런식입니다.
예를 들어 [공지],[뉴스],[이벤트]라고 있을경우
이걸 텍스트가 아닌 이미지로 띄우고싶습니다.
어떻게 하면 될까여?
아래 소스는 스킨 파일소스입니다.
꼭 답변 부탁드릴꼐여~~포인트도 올렸습니다..ㅠ_ㅠ
------------------lates.skin.php-----------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td height=5></td></tr></table>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td height=5></td></tr></table>
<table width=100% cellpadding=0 cellspacing=0 style="table-layout: fixed;">
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td align=center>
<table width=95% style="table-layout: fixed;">
<tr>
<td height=20><!--<img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle> 이미지//-->
<nobr>
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:9pt; color:#FF4200;'><strong>[{$list[$i][ca_name]}]{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>[{$list[$i][ca_name]}]{$list[$i][subject]}</font>";
echo "</a>";
//##add06-04-12
$qry=" SELECT count(*) as coment_cnt FROM $tmp_write_table WHERE wr_parent=".$list[$i][wr_parent]." and wr_is_comment >0 $ssh_wr_nogood ";
$cnt_val= sql_fetch($qry);
if ($cnt_val[coment_cnt]>0) {$list[$i][comment_cnt]="(".$cnt_val[coment_cnt].")";}
//##add06-04-12
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td align=center>
<table width=95% style="table-layout: fixed;">
<tr>
<td height=20><!--<img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle> 이미지//-->
<nobr>
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:9pt; color:#FF4200;'><strong>[{$list[$i][ca_name]}]{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>[{$list[$i][ca_name]}]{$list[$i][subject]}</font>";
echo "</a>";
//##add06-04-12
$qry=" SELECT count(*) as coment_cnt FROM $tmp_write_table WHERE wr_parent=".$list[$i][wr_parent]." and wr_is_comment >0 $ssh_wr_nogood ";
$cnt_val= sql_fetch($qry);
if ($cnt_val[coment_cnt]>0) {$list[$i][comment_cnt]="(".$cnt_val[coment_cnt].")";}
//##add06-04-12
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i][icon_new];
?>
</nobr>
</td></tr>
?>
</nobr>
</td></tr>
</table></td>
</tr>
<? } ?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
댓글 전체
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:9pt; color:#FF4200;'><strong>[{$list[$i][ca_name]}]{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>[{$list[$i][ca_name]}]{$list[$i][subject]}</font>";
아래처럼 하시면....
if ($list[$i][ca_name]=="공지") $img = "<img src='공지이미지'>";
if ($list[$i][ca_name]=="뉴스") $img = "<img src='뉴스이미지'>";
if ($list[$i][ca_name]=="이벤트") $img = "<img src='이벤트이미지'>";
echo "$img <font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i][subject]}</font>";
테스트 해보지 않고 적어서 죄송합니다.
echo "<font style='font-family:돋움; font-size:9pt; color:#FF4200;'><strong>[{$list[$i][ca_name]}]{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>[{$list[$i][ca_name]}]{$list[$i][subject]}</font>";
아래처럼 하시면....
if ($list[$i][ca_name]=="공지") $img = "<img src='공지이미지'>";
if ($list[$i][ca_name]=="뉴스") $img = "<img src='뉴스이미지'>";
if ($list[$i][ca_name]=="이벤트") $img = "<img src='이벤트이미지'>";
echo "$img <font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i][subject]}</font>";
테스트 해보지 않고 적어서 죄송합니다.
정답
포대장님 친절한 답변 감사드리구요~~rolo님 링크도 큰 도움이 되었습니다.
답변 감사드립니다..^^
답변 감사드립니다..^^