첨부 이미지 파일을 [image:n] 커스텀 태그로 글 특정 위치에 표시하기 > 그누3질답

그누3질답

첨부 이미지 파일을 [image:n] 커스텀 태그로 글 특정 위치에 표시하기 정보

그누보드 첨부 이미지 파일을 [image:n] 커스텀 태그로 글 특정 위치에 표시하기

본문

avworld 님이 팁앤테크에 적어놓은 것과 을 제로보드 참고싸이트를 기본으로 만들어 보고 있는데 잘 되지 않네요.. ㅠ.ㅠ

고수님들의 가르침을 한수 받고자 이렇게 올립니다.
현재 작업중인 gbview.skin.php 의 내용중 일부입니다.
================================================
<?
// for ($i=1; $i<=$cfg[file_count]; $i++) {
// if ($file[$i][view]) { echo $file[$i][view]; }
// }

for ($i=1; $i<=$cfg[file_count]; $i++) {
if ($file[$i][view]) {
$image_pattern = "/\[image:".$i."(.*?)\]/i";      // 커스텀 이미지1,2 태그 검색 패턴 문자열
$size = @getimagesize("./data/file/$bo_table/$wr_file");
$file[$i]->source_width  = $size[0];
$file[$i]->source_height = $size[1];

if ($board[bo_table_width] <= 100) {
if ($size[0] > $cfg[large_image_size]) {
$rate = $size[1] / $size[0];
$size[0] = $cfg[large_image_size];
$size[1] = (int)($size[0] * $rate);
}
} else {
if ($size[0] > $board[bo_table_width]) {
$rate = $size[1] / $size[0];
$size[0] = $board[bo_table_width];
$size[1] = (int)($size[0] * $rate);
}
}

$width1  = $size[0];
$height1 = $size[1];

$content=preg_replace($image_pattern, "<img src=./data/file/$bo_table/$wr_file width=$width1 height=$height1 hspace=15 \\1>", $content); }

else echo $file[$i][view];
}

?>
================================================
위의 소스로 되어 있는데 첨부#2의 이미지만 적용이 되고 있습니다. 어디가 잘못되었는지 애꿎은 담배만 태웁니다.

현재 작업중인 싸이트 : http://cpu.nozo.net/?doc=bbs/gnuboard.php&bo_table=test&wr_id=8

제로보드 참고싸이트 : http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=1&sn1=&divpage=1&sn=off&ss=on&sc=off&keyword=이미지&select_arrange=headnum&desc=asc&no=5690
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로