테스트 사이트 - 개발 중인 베타 버전입니다

카테고리 분류 문의입니다. 채택완료

퇴근후밥상 11년 전 조회 5,424
111.jpg
 
 
 
게시판 설정에서 분류항목을 설정했습니다.
 
222.jpg
 
 
그림과같이 카테고리 분류항목이 게시판위에 생성되었는데~
 
이 분류된 항목을 이미지로 바꿀수 있는 방법이 있나요?
 
있다면 어떻게 해야할까요? 초보라서 ㅠㅠ 자세히 부탁드립니다.
 
아래는 리스트 소스입니다.
 
 
 
 
 
// 선택옵션으로 인해 셀합치기가 가변적으로 변함 $colspan = 5;
//if ($is_category) $colspan++; if ($is_checkbox) $colspan++; if ($is_good) $colspan++; if ($is_nogood) $colspan++;
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요. // 제목 // 썸네일 설정 $thumb_width = "110"; //썸네일 가로길이 $thumb_height = "75"; //썸네일 세로길이 $thumb_quality = "100"; //퀼리티 100이하로 설정 $list_content = "200"; //내용길이
$data_path = $g4[path]."/data/file/$bo_table"; $thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707); @chmod($thumb_path, 0707);
include_once($board_skin_path . '/lib/skin.lib.php'); ?>
 
                                  
 
       
           블로그형블로그형        포토형포토형                                 
  
     | ";     for ($i=0; $i$b_s$arr[$i]$b_e  | ";     if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= " "; }     $cnt++;     }     if ($cnt0 == 0 ) { $bb_s=""; $bb_e=""; } ?>   전체 ()  
                   
if ($is_member){  // 로그인했는지 확인 echo" "; echo" 로그아웃 "; echo" "; } else{    // 로그인 안했다면 echo" "; echo" 관리자 로그인 "; echo" "; } ?>                     
                               
     등록일순        조회순          제품명        조회수     최근
            $rate = $thumb_width / $size[0];             $height = (int)($size[1] * $rate);
            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면             if ($height < $thumb_height)                 // 계산된 이미지 높이로 복사본 이미지 생성                 $dst = imagecreatetruecolor($thumb_width, $height);             else                 // 설정된 이미지 높이로 복사본 이미지 생성                 $dst = imagecreatetruecolor($thumb_width, $thumb_height);             imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);             imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);             chmod($thumb_path.'/'.$list[$i][wr_id], 0606);         } else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ    $edit_img = $list[$i]['wr_content'];    if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------     $file = '../' . $tmp[0]; // 파일명     $size = getimagesize($file);     if ($size[2] == 1)      $src = imagecreatefromgif($file);     else if ($size[2] == 2)      $src = imagecreatefromjpeg($file);     else if ($size[2] == 3)      $src = imagecreatefrompng($file);     else      continue;
    $rate = $thumb_width / $size[0];     $height = (int)($size[1] * $rate);
    // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면     if ($height < $thumb_height)      // 계산된 이미지 높이로 복사본 이미지 생성      $dst = imagecreatetruecolor($thumb_width, $height);     else      // 설정된 이미지 높이로 복사본 이미지 생성      $dst = imagecreatetruecolor($thumb_width, $thumb_height);     imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);     imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);     chmod($thumb_path.'/'.$list[$i][wr_id], 0606);    }      }  } //이미지     if (file_exists($thumb))         $thumfile = "";   else   //이미지가 없으면   $thumfile="";   //이미지가 아니네         if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file)){   $thumfile = "";      }    ?>  
        "; } ?>
                
                                                                                   
              [{$list[$i][ca_name]}] ";         }         $style = "";         if ($list[$i][is_notice]) $style = " style='font-weight:bold;'";
        if ($list[$i][comment_cnt])             echo " {$list[$i][comment_cnt]}";
        // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }         // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }   //코멘트24시간이내 등록시new아이콘표시         if($list[$i][icon_new])           echo " " . $list[$i][icon_new];         else {         $temp = sql_fetch("select wr_datetime from `$write_table` where wr_num='{$list[$i][wr_num]}' and wr_is_comment='1' ORDER BY wr_id DESC " );         if($temp[wr_datetime]){            $co_time = strtotime($temp[wr_datetime]);         if(time() - $co_time < 24*60*60) //24시간 이내일 때            echo " ";            }          }    //코멘트24시간이내 등록시new아이콘표시 끝
        //echo " " . $list[$i][icon_new];         echo " " . $list[$i][icon_file];         echo " " . $list[$i][icon_link];         echo " " . $list[$i][icon_hot];         echo " " . $list[$i][icon_secret];         echo $nobr_end;         ?>   
    ";         else if ($wr_id == $list[$i][wr_id]) // 현재위치             echo "no.{$list[$i][num]}";         else             echo "no.{$list[$i][num]}";         ?>                |                    |           
                          
     
         
height=1 bgcolor=#eeeeee>
게시물이 없습니다.
   
                                   
   
       
    "; } ?>     ", $write_pages);     $write_pages = str_replace("이전", "", $write_pages);     $write_pages = str_replace("다음", "", $write_pages);     $write_pages = str_replace("맨끝", "", $write_pages);     $write_pages = preg_replace("/([0-9]*)<\/span>/", "$1", $write_pages);     $write_pages = preg_replace("/([0-9]*)<\/b>/", "$1", $write_pages);     ?>         "; } ?>
댓글을 작성하려면 로그인이 필요합니다.

답변 6개

채택된 답변
+20 포인트
11년 전
<div>
</div>
<div>if($i == "0") {</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$ca_img = "첫번째 카테고리 이미지 경로";</div>
<div>} else <span style="font-size: 10pt; line-height: 1.5">if($i == "1") {</span></div><span class="Apple-tab-span" style="white-space: pre">	</span>$ca_img = "두번째 카테고리 이미지 경로";

<div><div>} else <span style="font-size: 10pt; line-height: 1.5">if($i == "3") {</span></div><span class="Apple-tab-span" style="white-space: pre">	</span>$ca_img = "세번째 카테고리 이미지 경로";</div>
<div>}</div>
<div>.</div>
<div>.</div>
<div>.</div>
<div>// 카테고리 갯수만큼 만든다. 이소스를 for문 안에 넣어둔다.</div>
<div>

<div><div><span style="font-family: gulim, helvetica; line-height: 23.53125px">$str .= " <a href='./board.php?bo_table=$bo_table&sca=".urlencode($arr[$i])."'>$b_s$arr[$i]$b_e</span><span style="font-family: gulim, helvetica; line-height: 23.53125px"></a>  <span style='font-size:11px; color:#D2D2D2;'>|</span> "; </span></div>
<div><span style="font-family: gulim, helvetica; line-height: 23.53125px">
</span></div>
<div><span style="font-family: gulim, helvetica; line-height: 23.53125px">// 위 부분을 아래와 같이 변경한다.</span></div>
<div><span style="font-family: gulim, helvetica; line-height: 23.53125px">
</span></div>
<div><span style="font-family: gulim, helvetica; line-height: 23.53125px">$str .= " <a href='./board.php?bo_table=$bo_table&sca=".urlencode($arr[$i])."'>[$i]</span><span style="font-family: gulim, helvetica; line-height: 23.53125px"></a>  <span style='font-size:11px; color:#D2D2D2;'>|</span> "; </span></div>
<div>
</div>
<div>
테스트해보진 않았어유~
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

퇴근후밥상
11년 전
제가초보라서~ㅠㅠ

if($i == "0") {

$ca_img = "첫번째 카테고리 이미지 경로";

else if($i == "1") { $ca_img = "두번째 카테고리 이미지 경로";

} else if($i == "3") { $ca_img = "세번째 카테고리 이미지 경로";

}


이부분을 아래 소스에 어떻게 넣어야하는건가욥ㅠㅠ

for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
if ($sca == $arr[$i]) { $cnt0++; $b_s="<b>"; $b_e="</b>"; } else {$b_s=""; $b_e="";}
$str .= " <a href='./board.php?bo_table=$bo_table&sca=".urlencode($arr[$i])."'>$b_s$arr[$i]$b_e</a>&nbsp;&nbsp;<span style='font-size:11px; color:#D2D2D2;'>|</span>&nbsp;";
if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "<br>"; }
$cnt++;
}
if ($cnt0 == 0 ) { $bb_s="<b>"; $bb_e="</b>"; }

댓글을 작성하려면 로그인이 필요합니다.

7년 전

많은 도움이 되었습니다. 감사합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

11년 전
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

11년 전
| ";     for ($i=0; $i  | ";     if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= " "; }     $cnt++;     }     if ($cnt0 == 0 ) { $bb_s=""; $bb_e=""; } ?>   전체 ()      
로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

퇴근후밥상
11년 전
감사합니다! 엑박이 뜬것이 이미지로 바뀌었네요~~

속성을보니 http://catu.kr/info_build/img/ca_0.gif 이렇게 들어가있던데~

이미지로 된 버튼을 어디에 넣어야 되는건가요?

해당게시판 img에다가 ca_0.gif, ca_1.gif, ca_2.gif ... 이런식으로 이미지 저장해서
업로드 하면 되는건가요?
히어1
11년 전
네엡

댓글을 작성하려면 로그인이 필요합니다.

11년 전
아래처럼 하세요
분류순서에 맞게 이미지를 만듭니다. 화일명 ca_0.gif, ca_1.gif~~~분류 수 만큼
$b_s$arr[$i]$b_e <---이 부분을 경로 넣고 이미지 태그로 변경
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

퇴근후밥상
11년 전
답변 감사합니다//
초보라서 구체적으로 어떻게 넣어야 하는지 알려주실수 있나욥//

<?
$cnt_bo_1 = $bo_1[0] ? $bo_1[0] : 10; // 한줄당 분류 갯수(현재:10)
$cnt = 1;
$cnt0 = 0;
$bb_s=""; $bb_e="";
$b_s=""; $b_e="";
$arr = explode("|", $board[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "&nbsp;<span style='font-size:11px; color:#D2D2D2;'>|</span>&nbsp;";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
if ($sca == $arr[$i]) { $cnt0++; $b_s="<b>"; $b_e="</b>"; } else {$b_s=""; $b_e="";}
$str .= " <a href='./board.php?bo_table=$bo_table&sca=".urlencode($arr[$i])."'>$b_s$arr[$i]$b_e</a>&nbsp;&nbsp;<span style='font-size:11px; color:#D2D2D2;'>|</span>&nbsp;";
if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "<br>"; }
$cnt++;
}
if ($cnt0 == 0 ) { $bb_s="<b>"; $bb_e="</b>"; }
?>
<?echo " ";echo $bb_s;?><a href='./board.php?bo_table=<?=$bo_table?>&page=<?=$page?>'>전체</a><?=$bb_e?> <span style="font-size:8pt; color=#AEAEAE;">(<?=number_format($total_count)?>)</span>
<?=$str?></td>
<? } ?>
<? } ?>

댓글을 작성하려면 로그인이 필요합니다.

11년 전
<div><div><?</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$cnt_bo_1 = $bo_1[0] ? $bo_1[0] : 10; // 한줄당 분류 갯수(현재:10)</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$cnt = 1;</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$cnt0 = 0;</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$bb_s=""; $bb_e="";</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$b_s=""; $b_e="";</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$arr = explode("|", $board[bo_category_list]); // 구분자가 , 로 되어 있음</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>$str = " <span style='font-size:11px; color:#D2D2D2;'>|</span> ";</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>for ($i=0; $i<count($arr); $i++)</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>if (trim($arr[$i]))  {</div>
<div>
</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>// 카테고리 이미지 추가</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>if($i == "0") {</div>
<div><span class="Apple-tab-span" style="white-space: pre">				</span>$ca_img = "첫번째 카테고리 이미지 경로";</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>} else if($i == "1") {</div>
<div><span class="Apple-tab-span" style="white-space: pre">				</span>$ca_img = "두번째 카테고리 이미지 경로";</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>} else if($i == "3") {</div>
<div><span class="Apple-tab-span" style="white-space: pre">				</span>$ca_img = "세번째 카테고리 이미지 경로";</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>}</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>.</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>.</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>.</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>.</div>
<div>
</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>if ($sca == $arr[$i]) { $cnt0++; $b_s="<b>"; $b_e="</b>"; } else {$b_s=""; $b_e="";}</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>$str .= " <a href='./board.php?bo_table=$bo_table&sca=".urlencode($arr[$i])."'>[$i]</a>  <span style='font-size:11px; color:#D2D2D2;'>|</span> ";</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "
"; }</div>
<div><span class="Apple-tab-span" style="white-space: pre">			</span>$cnt++;</div>
<div><span class="Apple-tab-span" style="white-space: pre">		</span>}</div>
<div><span class="Apple-tab-span" style="white-space: pre">	</span>if ($cnt0 == 0 ) { $bb_s="<b>"; $bb_e="</b>"; }</div>
<div>?></div></div>
<div>
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

퇴근후밥상
11년 전
친절한 답변 감사합니다. > <

적용하였더니 분류항목이 이미지 적용이 안되고

전체 l [4] 이렇게

바뀌었습니다/ㅜㅜ 소스를 잘못넣은건지// 아님 다른방법이 있을까요//



for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {

// 카테고리 이미지 추가
if($i == "0") {

$ca_img = "http://catu.kr/010-9402-0979a/img/sub_2_bt2_01.jpg";

} else if($i == "1") {
$ca_img = "http://catu.kr/010-9402-0979a/img/sub_2_bt2_02.jpg";

} else if($i == "2") {

$ca_img = "http://catu.kr/010-9402-0979a/img/sub_2_bt2_03.jpg";
}
} else if($i == "3") {

$ca_img = "http://catu.kr/010-9402-0979a/img/sub_2_bt2_04.jpg";
}


if ($sca == $arr[$i]) { $cnt0++; $b_s="<b>"; $b_e="</b>"; } else {$b_s=""; $b_e="";}
$str .= "<a href='./board.php?bo_table=$bo_table&sca=".urlencode($arr[$i])."'>[$i]</a>&nbsp;&nbsp;<span style='font-size:11px; color:#D2D2D2;'>|</span>&nbsp;"; //수정
if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "<br>"; }
$cnt++;
}
if ($cnt0 == 0 ) { $bb_s="<b>"; $bb_e="</b>"; }
?>

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인