최신스킨에서 카타고리 이미지 정보
최신스킨에서 카타고리 이미지첨부파일
본문
오늘 등록된 최신글(공지사항 스킨입니다!!)
위 스킨을 적용하고 카타고리를 적용==>
카타고리 '이벤트'를 게시판에 적용한후 해당 카타고리를 통한 게시물 등록시
event 모양의 이미지가 메인공지 최신글 리스트에 나타나야됩니다!!
그런데 event는 나타나지 않고 기본 notic 이미지만 계속 나타나는데 해결 방법이
있을까요.
기존 사용하고 있는 공지사항에 적용해서 그러는 걸까요~~;;
최신글 이미지 체이진 소스 첨부하고 해당 소스부분을 발췌하여 올립니다.
latest.skin.php
// 카테고리별 아이콘
// 카테고리 추가시에 아래 소스를 if와 else 사이에 삽입
/////////////////////////////////////////////////////////////////////////////////////////////
// ifelse ($list[$i][ca_name] == '카테고리명') {
// $type = "<img src='$latest_skin_path/img/해당되는아이콘파일' border='0' align='absmiddle'>";
// }
/////////////////////////////////////////////////////////////////////////////////////////////
// 카테고리 추가시에 아래 소스를 if와 else 사이에 삽입
/////////////////////////////////////////////////////////////////////////////////////////////
// ifelse ($list[$i][ca_name] == '카테고리명') {
// $type = "<img src='$latest_skin_path/img/해당되는아이콘파일' border='0' align='absmiddle'>";
// }
/////////////////////////////////////////////////////////////////////////////////////////////
if ($list[$i][ca_name] == '이벤트') {
$type = "<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
} else {
$type = "<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
}
$type = "<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
} else {
$type = "<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
}
또한 공지사항에서 사용하고 있는 list.skin.php도 함께 첨부합니다!!
댓글 전체
if ($list[$i][ca_name] == '이벤트') {
$type = "<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
} else {
$type = "<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
}
이코드를,,
<? for ($i=0; $i<count($list); $i++) { ?> 코드 아랫쪽에 넣으라는 것 같습니다.
<? } else {?> 바로 아래 넣어도 될것 같네요.
아무튼 for문 안에 있어야 될듯 싶네요.^^
$type = "<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
} else {
$type = "<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
}
이코드를,,
<? for ($i=0; $i<count($list); $i++) { ?> 코드 아랫쪽에 넣으라는 것 같습니다.
<? } else {?> 바로 아래 넣어도 될것 같네요.
아무튼 for문 안에 있어야 될듯 싶네요.^^
님이 알려주신 방법으로 해보니 둘다 에러가 납니다~
현재 notic이미지는 정상적으로 출력되는데 카타고리적용후 evenet 이미지가 정상 출력되지
않아 했던 질문입니다.
답변에 관심 가져 주셔서 너무 감사드려요~
현재 notic이미지는 정상적으로 출력되는데 카타고리적용후 evenet 이미지가 정상 출력되지
않아 했던 질문입니다.
답변에 관심 가져 주셔서 너무 감사드려요~
엑박이 뜬다는 말씀인가요?
테스트 해봤는데 저는 잘됩니다.^^
`이벤트`라는 카테고리가 있다는 전제하에,,
53열 <? } else {?> 부분을 아래 코드로 바꿔주세요.
<? } else {
if ($list[$i][ca_name] == '이벤트') {
$type = "이벤트";
} else {
$type = "공지";
}
?>
테스트 해봤는데 저는 잘됩니다.^^
`이벤트`라는 카테고리가 있다는 전제하에,,
53열 <? } else {?> 부분을 아래 코드로 바꿔주세요.
<? } else {
if ($list[$i][ca_name] == '이벤트') {
$type = "이벤트";
} else {
$type = "공지";
}
?>
아래의 코드로 테스트를 해보세요. latest.skin.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
// 카테고리별 아이콘
// 카테고리 추가시에 아래 소스를 if와 else 사이에 삽입
//////////////////////////////////////////////////////////////////////////////////////////////////
// ifelse ($list[$i][ca_name] == '카테고리명') {
// $type = "<img src='$latest_skin_path/img/해당되는아이콘파일' border='0' align='absmiddle'>";
// }
//////////////////////////////////////////////////////////////////////////////////////////////////
// 미리보기 이미지사이즈
$img_w = "150";
$img_h = "140";
?>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
<table width="640" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" colspan="4" height="37" background="<?=$latest_skin_path?>/img/title_new.gif" align="right" style="padding-top:4;padding-right:2;"><a href='<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/more.gif" border="0"></a></td>
</tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($list[$i][ca_name] == '이벤트') {
$type = "<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
} else {
$type = "<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
}
?>
<? if ($i==0) { ?>
<tr>
<td width="3"></td>
<td width="422" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="161" align="center">
<? $image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image) && file_exists("$g4[path]/data/file/$bo_table/$image")) {
echo "<a href='{$list[$i][href]}'><img src='$g4[path]/data/file/$bo_table/$image' width='{$img_w}' height='{$img_h}' border='0'></a>";
} else {
echo "<a href='{$list[$i][href]}'><img src='$latest_skin_path/img/no_img.gif' width='{$img_w}' height='{$img_h}' border='0'></a>";
} ?></td>
<td width="5"></td>
<td width="256" valign="top" style="word-break:break-all;line-height:140%; padding-top:8;"><a href='<?=$list[$i][href]?>'><font color="#FF6600">제목
: <?=$list[$i][subject]?></font></a><?=$type?><font color="#FF6600"><br>
</font><?=nl2br(cut_str($list[$i][wr_content],250,".. <a href='{$list[$i][href]}'><img src='{$latest_skin_path}/img/co_more.gif' border='0' align='absmiddle'></a>"))?></td>
</tr>
</table>
</td>
<td width="10"></td>
<td width="215" align="left" valign="top">
<table width="205" border="0" cellpadding="0" cellspacing="0">
<? } else {?>
<tr>
<td height="28" OnMouseOver="this.style.backgroundColor='#F5F5F5';" OnMouseOut="this.style.backgroundColor='#FFFFFF'" style="padding-top: 3px;"> <?=$type?> <a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a><?=$type?></td>
<td width="27%" style="padding-top: 2px;" align="center" style="font-family:Tahoma;font-size:7pt"><?=$list[$i][datetime]?></td>
</tr>
<tr>
<td width="100%" height="1" bgcolor="e5e5e5"></td>
<td></td>
</tr>
<? } ?>
<? } ?>
</table>
</td>
</tr>
</table>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
// 카테고리별 아이콘
// 카테고리 추가시에 아래 소스를 if와 else 사이에 삽입
//////////////////////////////////////////////////////////////////////////////////////////////////
// ifelse ($list[$i][ca_name] == '카테고리명') {
// $type = "<img src='$latest_skin_path/img/해당되는아이콘파일' border='0' align='absmiddle'>";
// }
//////////////////////////////////////////////////////////////////////////////////////////////////
// 미리보기 이미지사이즈
$img_w = "150";
$img_h = "140";
?>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
<table width="640" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" colspan="4" height="37" background="<?=$latest_skin_path?>/img/title_new.gif" align="right" style="padding-top:4;padding-right:2;"><a href='<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/more.gif" border="0"></a></td>
</tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($list[$i][ca_name] == '이벤트') {
$type = "<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
} else {
$type = "<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
}
?>
<? if ($i==0) { ?>
<tr>
<td width="3"></td>
<td width="422" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="161" align="center">
<? $image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image) && file_exists("$g4[path]/data/file/$bo_table/$image")) {
echo "<a href='{$list[$i][href]}'><img src='$g4[path]/data/file/$bo_table/$image' width='{$img_w}' height='{$img_h}' border='0'></a>";
} else {
echo "<a href='{$list[$i][href]}'><img src='$latest_skin_path/img/no_img.gif' width='{$img_w}' height='{$img_h}' border='0'></a>";
} ?></td>
<td width="5"></td>
<td width="256" valign="top" style="word-break:break-all;line-height:140%; padding-top:8;"><a href='<?=$list[$i][href]?>'><font color="#FF6600">제목
: <?=$list[$i][subject]?></font></a><?=$type?><font color="#FF6600"><br>
</font><?=nl2br(cut_str($list[$i][wr_content],250,".. <a href='{$list[$i][href]}'><img src='{$latest_skin_path}/img/co_more.gif' border='0' align='absmiddle'></a>"))?></td>
</tr>
</table>
</td>
<td width="10"></td>
<td width="215" align="left" valign="top">
<table width="205" border="0" cellpadding="0" cellspacing="0">
<? } else {?>
<tr>
<td height="28" OnMouseOver="this.style.backgroundColor='#F5F5F5';" OnMouseOut="this.style.backgroundColor='#FFFFFF'" style="padding-top: 3px;"> <?=$type?> <a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a><?=$type?></td>
<td width="27%" style="padding-top: 2px;" align="center" style="font-family:Tahoma;font-size:7pt"><?=$list[$i][datetime]?></td>
</tr>
<tr>
<td width="100%" height="1" bgcolor="e5e5e5"></td>
<td></td>
</tr>
<? } ?>
<? } ?>
</table>
</td>
</tr>
</table>
잘됩니다//
http://www.beomsu.com/
그런데...
<td height="28" OnMouseOver="this.style.backgroundColor='#F5F5F5';" OnMouseOut="this.style.backgroundColor='#FFFFFF'" style="padding-top: 3px;"> <?=$type?> <a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a><?=$type?></td>
에서...<?=$type?> 가 두 군데 있어서 이벤트나 공지사항 이미지가 두 번 뜨네요..
http://www.beomsu.com/
그런데...
<td height="28" OnMouseOver="this.style.backgroundColor='#F5F5F5';" OnMouseOut="this.style.backgroundColor='#FFFFFF'" style="padding-top: 3px;"> <?=$type?> <a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a><?=$type?></td>
에서...<?=$type?> 가 두 군데 있어서 이벤트나 공지사항 이미지가 두 번 뜨네요..
아이쿠 수정이 잘안되서 제가 질문하러 왔는데.. 이미 질문을~~ ^^;;
헐랭이님 답변 감사합니다.
근데 요게 저기 넣어도 안되네요.
일단 제 포인트 걸고 다시 질문 드리겠습니다.
구나저나 전 소스에서까지 오타군요.. ifelse라니..;;
헐랭이님 답변 감사합니다.
근데 요게 저기 넣어도 안되네요.
일단 제 포인트 걸고 다시 질문 드리겠습니다.
구나저나 전 소스에서까지 오타군요.. ifelse라니..;;
먼저 답변주신 플록님께 포인트 드릴께요.
헐랭이님 답변도 너무 감사드려요. 내일 아침 다시 적용해 보도록 할께요.
감사합니다.
치에님이 적용해 보셨는데 모두 안된다고 하시네요. 치에님이 재 질문하셨으니 답변 완료
할께요~
헐랭이님 답변도 너무 감사드려요. 내일 아침 다시 적용해 보도록 할께요.
감사합니다.
치에님이 적용해 보셨는데 모두 안된다고 하시네요. 치에님이 재 질문하셨으니 답변 완료
할께요~
포인트는 `건전 게임`으로 탕진하신 헐랭이님을 드리셨으면 좋았을텐데,,
아무튼 조금 이상한 상황이네요.
제가 걸어서 테스트까지 해보았는데 잘 되고 있답니다.
http://gnusr.com/g4/?gur=test
코드에서 손댄부분은 53열 <? } else { ?> 를 아래 코드로 바꿔준것 뿐입니다.
<? } else {
if ($list[$i][ca_name] == "아기사진"):
$type = "1<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
elseif ($list[$i][ca_name] == "엄마와아기"):
$type = "2<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
else:
$type = "3<img src='$latest_skin_path/img/co_more.gif' border='0' align='absmiddle'>";
endif;
?>
아무튼 조금 이상한 상황이네요.
제가 걸어서 테스트까지 해보았는데 잘 되고 있답니다.
http://gnusr.com/g4/?gur=test
코드에서 손댄부분은 53열 <? } else { ?> 를 아래 코드로 바꿔준것 뿐입니다.
<? } else {
if ($list[$i][ca_name] == "아기사진"):
$type = "1<img src='$latest_skin_path/img/notice.gif' border='0' align='absmiddle'>";
elseif ($list[$i][ca_name] == "엄마와아기"):
$type = "2<img src='$latest_skin_path/img/event.gif' border='0' align='absmiddle'>";
else:
$type = "3<img src='$latest_skin_path/img/co_more.gif' border='0' align='absmiddle'>";
endif;
?>
감사합니다~