카

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

· 2004-06-22 (화) 02:08:09 · 575
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
댓글을 작성하시려면 로그인이 필요합니다.

그누3질답

9,564건
+
제목 글쓴이 날짜 조회
04-06-23 조회 464
04-06-23 조회 473
04-06-23 조회 564
04-06-23 조회 552
04-06-23 조회 588
04-06-23 조회 639
04-06-22 조회 721
04-06-22 조회 587
04-06-22 조회 533
04-06-22 조회 553
04-06-22 조회 490
04-06-22 조회 503
04-06-22 조회 413
04-06-22 조회 564
04-06-22 조회 870
04-06-22 조회 2,097
04-06-22 조회 576
04-06-21 조회 772
04-06-21 조회 627
04-06-21 조회 424