이미지 불러오는 주소를 절대경로로 하려면....

오류는 아니고요~

퍼가는 기능을 하려고 하는데...

HTML 형태로 해보니

<img src='../data/file/gallery_6/1948609117_d902f76f_1.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''>

요런식으로 상대경로로 나오네요..

제가 원하는 형태는 "http://도메인/date....jpg" 요런 형태를 원하는 것인데요..



view.skin.php에서 이미지를 불러오는 곳은 아래 부분입니다..
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {

if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";

}
?>

$view[file][$i][view] 이 부분을 수정하는 것은 아닌 것 같고...
결국 $view[file]이 어딘가에서 정의?가 되어 있는 것 같은데...

어딘지 도무지 알 수가 없네요..

view.php에 있는 것도 아닌 것 같구...

고수님들 아시는 분들 답변 좀 해주세요~~
|

댓글 2개

lib/common.lib.php <<== 파일에 있죠..


// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file, $width, $height, $content="")
{
global $config, $board;
global $g4;
static $ids;

if (!$file) return;

$ids++;

// 파일의 폭이 게시판설정의 이미지폭 보다 크다면 게시판설정 폭으로 맞추고 비율에 따라 높이를 계산
if ($width > $board[bo_image_width] && $board[bo_image_width])
{
$rate = $board[bo_image_width] / $width;
$width = $board[bo_image_width];
$height = (int)($height * $rate);
}

// 폭이 있는 경우 폭과 높이의 속성을 주고, 없으면 자동 계산되도록 코드를 만들지 않는다.
if ($width)
$attr = " width='$width' height='$height' ";
else
$attr = "";

if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";
else if (preg_match("/\.($config[cf_movie_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(obj_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
}


=======================================================================

head.sub.php

49번줄 확인해보세요
var g4_path = "<?=$g4['path']?>";

실행해서 소스를 보시면
var g4_path = ".";

이런식으로 나오죠
var g4_path = "주소";

입력하면되게죠..
아.. 감사합니다..ㅜㅜ
lib/common.lib.php 에서 경로를 수정하여 원하는 결과를 얻었습니다.

감사합니다.. ^^*
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
17년 전 조회 795
17년 전 조회 2,105
17년 전 조회 735
17년 전 조회 986
17년 전 조회 711
17년 전 조회 974
17년 전 조회 960
17년 전 조회 765
17년 전 조회 1,589
17년 전 조회 1,667
17년 전 조회 1,170
17년 전 조회 1,089
17년 전 조회 1,566
17년 전 조회 775
17년 전 조회 956
17년 전 조회 1,003
17년 전 조회 1,539
17년 전 조회 946
17년 전 조회 953
17년 전 조회 985