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

Copy
<?
$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)) {
@mkdir($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개

채택된 답변
+20 포인트

$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 로 변경하면 되겠네요

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

답변에 대한 댓글 2개

[code]
<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>
[/code]
여기에서
$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로 변경후에 사용하면서 발행하는

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

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

답변에 대한 댓글 1개

이미지를 못 불러오고있습니다..최종적으로 $thumb에 값이 들어가야하는데 echo 로 $thumb 출력해봐도 아무것도 나오지가 않네요 ㅠㅠ

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

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

로그인
🐛 버그신고