해당 내용을 그누보드5로 바꾸는건 힘든건가요?

해당 내용을 그누보드5로 바꾸는건 힘든건가요?

QA

해당 내용을 그누보드5로 바꾸는건 힘든건가요?

본문


<?
$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id'  and bf_no < 4 order by bf_no limit 0, 10 "; 
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$data_path = $g4['path'] . "/data/file/{$bo_table}";
$thumb_path = $data_path . '/thumbOpen';
$view_w = 110; //썸네일 가로사이즈
$view_h = 90; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path)) {
($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
    $filename = $row[bf_file]; 
    //$thumb = $thumb_path.'/'.$filename;
    $thumb = $g4['path'].'/data/file/'.$bo_table.'/'.$filename; 
    if (!file_exists($thumb))
    {     
?>
        <!--<img src='<?=$board_skin_path?>/img/no_image.gif' border=1 width=100 height=70 style="border-color:#d5d5d5;">-->
<?
        $file = $data_path.'/'.$filename; 
        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
                continue;
            $rate = $view_w / $size[0];
            $height = (int)($size[1] * $rate);
            if ($height < $view_h)
                $dst = imagecreatetruecolor($view_w, $height);
            else
                $dst = imagecreatetruecolor($view_w, $view_h);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
            chmod($thumb_path.'/'.$filename, 0707);
        } 
    }
    if (file_exists($thumb) && $filename) {
?>        <div style="margin-bottom:3px;">
            <img src='<?=$thumb?>' border=1 width=70 height=70 style="border:1px solid #cacaca;" onMouseOver="bgChange('view_img<?=$i?>');" onMouseOut="bgChange('view_img<?=$i?>');">
        </div>
        
<?
}
}
?>

g4를 g5로만 바꿔서 해봤는데..잘안되더라구요 ㅠㅠ

이 질문에 댓글 쓰기 :

답변 2

$data_path = $g4['path'] . "/data/file/{$bo_table}";
>> $data_path = G5_DATA_PATH . "/file/{$bo_table}";

 

$thumb = $g4['path'].'/data/file/'.$bo_table.'/'.$filename; 
>> $thumb = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;

 

그외는 g4 > g5 로 변경하면 되겠네요


<SCRIPT LANGUAGE="JavaScript">
<!-- 
image_directory = "";   //배경이미지 경로
clear = new Image();  clear.src = image_directory + "./img/blank.gif";
<?
//파일 뽑기
$sql2 = " select bf_file from $g5[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no < 4 order by bf_no limit 0, 10 ";
$result2 = sql_query($sql2);
$imgArry = array();
for ($j=0; $row2 = sql_fetch_array($result2); $j++) {
$view_one = "{$g4['path']}/data/file/{$bo_table}/{$row2['bf_file']}";
?>
view_img<?=$j?> = new Image();
view_img<?=$j?>.src = "<?=$g4['path']?>/data/file/<?=$bo_table?>/<?=$row2['bf_file']?>";
//alert('<?=$imgArry[j]?>');
<? } ?>
function bgChange(imgName) {
    document.view_img.src = eval(imgName + ".src");
}
//  -->
</SCRIPT>

여기에서
$view_one = "{$g4['path']}/data/file/{$bo_table}/{$row2['bf_file']}";

view_img<?=$j?>.src = "<?=$g4['path']?>/data/file/<?=$bo_table?>/<?=$row2['bf_file']?>";
이부분은 어떻게 변경해야되나요..? 제가 말씀해주신거랑 비슷하게 해봤는데 오류가나오네요 ㅠ 저거때문에 출력이 안되는건가해서요..답변해주셔서 감사합니다.

$view_one = "{$g4['path']}/data/file/{$bo_table}/{$row2['bf_file']}";
view_img<?=$j?>.src = "<?=$g4['path']?>/data/file/<?=$bo_table?>/<?=$row2['bf_file']?>";

아마도 아래처럼 수정하면 되지 않을까 싶네요

$view_one = G5_DATA_URL."/file/{$bo_table}/{$row2['bf_file']}";
//$view_one = G5_DATA_PATH."/file/{$bo_table}/{$row2['bf_file']}";
// 이것 사용처가 포함되지 않아서 정확하지 않아서 절대경로와 상대경로 2가지 모두 테스트 해보세요
view_img<?php echo $j;?>.src = "<?php echo G6_DATA_URL; ?>/file/<?php echo $bo_table; ?>/<?php echo $row2['bf_file']; ?>";

테이블을 g5로 변경후에 사용하면서 발행하는

문제를 설명해 주시면 문제 해결이 더 빠를 듯합니다.

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

회원로그인

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