$bo_table 체크해서 맞는 이미지 보여주기 > 그누4 질문답변

그누4 질문답변

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

$bo_table 체크해서 맞는 이미지 보여주기 정보

$bo_table 체크해서 맞는 이미지 보여주기

본문

일단 코드는

<?
  if ($bo_table == "notic" ){
    echo "<img src=<?=$g4[path]?>/img/common/communityTitle1.gif width=349 height=35 />";
  } else if ($bo_table == "freeBoard" ){
    echo "<img src=<?=$g4[path]?>/img/common/communityTitle2.gif width=349 height=35 />";
    }
?>
<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td><img src="<?=$g4[path]?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
    <td align="right"><? echo "<img src={$g4[path]}/img/common/communityTitle{$bo_table}.gif width=349 height=35 />"; ?></td>
  </tr>
</table>

위와 같이 짰습니다.

코드 보시면 아시겠지만 $bo_table = "notic"  // 게시판 아이디가 notic 라면
communityTitle1.gif  이미지를 보여주고
$bo_table = "freeBoard" // 게시판 아이디가 freeBoard 라면
communityTitle2.gif  이미지를 보여주라는 코드인데요...

이게 notic 에 설정된 이미지만 나타나내요....

왜 이러나요?

댓글 전체

<?
  if ($bo_table == "notic" ){
    $table_img = "<img src=<?=$g4[path]?>/img/common/communityTitle1.gif width=349 height=35 />";
  } else if ($bo_table == "freeBoard" ){
    $table_img = "<img src=<?=$g4[path]?>/img/common/communityTitle2.gif width=349 height=35 />";
    }
?>
<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td><img src="<?=$g4[path]?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
    <td align="right"><? echo "<img src={$g4[path]}/img/common/communityTitle{$table_img}.gif width=349 height=35 />"; ?></td>
  </tr>
</table>
죄송합니다만. 그대로인데요.. 뭐가 잘 못 됐는지 모르겠네요 ^^;
http://jejudom.com/bbs/board.php?bo_table=notic
위 주소인데요 시간 되시면 한 번 봐주세요..
<?
if ($bo_table == 'notic'){

    $img = "<img src='{$g4['path']}/img/common/communityTitle1.gif' width='349' height='35'>";

} else if ($bo_table == 'freeBoard'){

    $img = "<img src='{$g4['path']}/img/common/communityTitle2.gif' width='349' height='35'>";

} else {

    $img = "이미지 없음";

}
?>

<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
<tr>
    <td><img src="<?=$g4['path']?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
    <td align="right"><?=$img?></td>
</tr>
</table>
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT