최근게시물이미지삭제

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
최근게시물이미지삭제

QA

최근게시물이미지삭제

본문

 

최근게시물에 등록한 이미지를 변경하거나 삭제를 하면

삭제가 안되고 이미지변경도 안되는데요

연결된 게시판에는 변경삭제가 되는데

메인화면의 최근게시물 스킨리스트에는 처음등록한이미지로 바뀌지를 않는데

해결방법이 무엇인지요

 

 

 

latest.skin.php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$img_width = 40;
$img_height = 30;
$img_quality = 99;

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path."thumbnail/$row[wr_id]";
$ym = date("ym", $g4[server_time]);

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

 


?>

 

<div align="center">
<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
    <? for ($i=0; $i<count($list); $i++) { ?>
  <tr>
    <td width="10%" height="1" valign="middle">
    <table width="40" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td height="30">

 

  <?
//썸네일 생성
$thumfile = "";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    // 썸네일 이미지가 존재하지 않는다면
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // 업로드된 파일이 이미지라면
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
            $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
                break;

            $rate = $img_width / $size[0];
            $height = (int)($size[1] * $rate);

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $img_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);

     }
 }

    if (file_exists($thumb))
      $thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid' style.filter='alpha(style=1, opacity=100, finishopacity=0)'></a>";
        else
                //이미지가 없으면
  $thumfile="<img src='$latest_skin_path/img/noimg.jpg' width='{$img_width}' height='{$img_height}' style='border:2 #E7E7E7 solid'></a>";
  //이미지가 아니네  
        if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
       { $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }

?><a hre='<?=$list[$i][href]?>'><?=$thumfile?></a></div></td>

 

이 질문에 댓글 쓰기 :

답변 1

skin 디렉토리에 write_update.tail.skin.php 와 delete.tail.skin.php 파일을 추가해주세요.

파일이 이미 존재한다면 unlink() 줄만 복사해서 붙이면 됩니다.

 

write_update.tail.skin.php


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
 
if (isset($wr_id)) @unlink($g4['path'].'/data/file/'.$bo_table.'/thumbnail/'.$wr_id);
?>

 

delete.tail.skin.php


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
 
@unlink($g4['path'].'/data/file/'.$bo_table.'/thumbnail/'.$wr_id);
?>

 

그러고 글을 수정해보세요.

답변을 작성하시기 전에 로그인 해주세요.
전체 10,635
QA 내용 검색

회원로그인

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