분류 이미지 따로 나타내기 > 그누4 질문답변

그누4 질문답변

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

분류 이미지 따로 나타내기 정보

분류 이미지 따로 나타내기

본문

아래는 카테고리(분류)를 출력하는 소스 입니다.
ca_id = 분류 코드 ( 아이디 ) 입니다.
여기서 p02010 , p02020 은 아래 이미지 가 나오게 하고 싶습니다.

p2010 : img/1.jpg
p2020 : img/2.jpg

입니다.

위 경우를 제외한 카테고리 분류는 글자 그대로 나오면 되겠습니다.
부탁드립니다.
if($result){
  $str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
  $str .= "<td><table width=100% border=0><tr><td>";
  while ($row=sql_fetch_array($result)) {
      if (preg_match("/^$row[ca_id]/", $ca_id))
          $span = "<span style='font-weight:bold;'>";
$exists = true;
          $span = "<span>";

      $str .= "<a href='./list.php?ca_id=$row[ca_id]'>{$span}$row[ca_name]</span></a> &nbsp; ";
      $exists = true;
  }
  $str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";
  • 복사

댓글 전체

if($result){
  $str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
  $str .= "<td><table width=100% border=0><tr><td>";
  while ($row=sql_fetch_array($result)) {
      if (preg_match("/^$row[ca_id]/", $ca_id))
          $span = "<span style='font-weight:bold;'>";
$exists = true;
          $span = "<span>";
    if($row[ca_id] == "p2010"){      $str .= "<a href='./list.php?ca_id=$row[ca_id]'>{$span}<img src="img/1.jpg"></span></a> &nbsp; ";
    }else if($row[ca_id] == "p2020"){    $str .= "<a href='./list.php?ca_id=$row[ca_id]'>{$span}<img src="img/2.jpg"></span></a> &nbsp; ";    }else{
      $str .= "<a href='./list.php?ca_id=$row[ca_id]'>{$span}$row[ca_name]</span></a> &nbsp; ";
    }
      $exists = true;
  }
  $str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";
© SIRSOFT
현재 페이지 제일 처음으로