한개의 좌우상하 위치가 아니고 다중 임의위치입니다. 정보
그누보드 한개의 좌우상하 위치가 아니고 다중 임의위치입니다.
본문
제로보드 bbs/view.php 그누보드 bbs/gbview.php에 해당
// 그니의 원하는 위치에 원하는 이미지 크기 출력시키기...
if(stristr($memo, "&&"))
{
$memo_temp = explode("&&", $memo);
for($i=0; $i<10; $i++) {
$a="#img1"; $b="#img2";
if(stristr($memo_temp[$i], $a) || stristr($memo_temp[$i], $b)) {
$d = trim($memo_temp[$i]);
$gnees = explode(",", $d);
$img_target = trim($gnees[0]);
$img_size_x = trim($gnees[1]);
$img_size_y = trim($gnees[2]);
if($img_size_x && $img_size_y) {
if($img_target == "#img1") {
$c = "<img src='$data[file_name1]' width=$img_size_x height=$img_size_y border=0>";
$upload_image1 = "";
}
elseif($img_target == "#img2") {
$c = "<img src='$data[file_name2]' width=$img_size_x height=$img_size_y border=0>";
$upload_image2 = "";
}
$memo = str_replace($memo_temp[$i], $c, $memo);
}
else {
if(stristr($memo, $a)) {
$e = "<img src='$data[file_name1]' border='0' >";
$memo_temp[$i]=str_replace($a,$e,$memo_temp[$i]);
$upload_image1 = "";
}
if(stristr($memo, $b)) {
$f = "<img src='$data[file_name2]' border='0' >";
$memo_temp[$i]=str_replace($b,$f,$memo_temp[$i]);
}
}
}
}
$memo = str_replace("&&", "", $memo);
}
$a = "#img1";
if(stristr($memo, $a)) {
$c = "<img src='$data[file_name1]' border='0' >";
$memo=str_replace($a,$c,$memo);
$upload_image1 = ""; }
$b = "#img2";
if(stristr($memo, $b)) {
$c = "<img src='$data[file_name2]' border='0' >";
$memo=str_replace($b,$c,$memo);
$upload_image2 = ""; }
사용방법
사용은 다음 2가지 방법을 모두 사용가능합니다.
1. 이미지 크기를 변경하지 않고 출력시
글 내용중 원하는 위치에 #img1 또는 #img2를 써주면 됩니다. (v2.0의 방법임.)
2. 이미지 크기를 변경하여 출력시키기
글 내용중에 원하는 위치에 && #img1, 가로크기, 세로크기 && 라고 써주시면 됩니다.
위에서 앞의 && 은 소스적용시작 뒤의 &&은 소스 적용 끝을 의미합니다.
중간의 #img1은 첫번째 이미지를 의미하고 뒤는 이미지 크기를 의미합니다.
예) 첫번째 이미지를 300*200으로 출력시 : && #img1, 300, 200 &&
// 그니의 원하는 위치에 원하는 이미지 크기 출력시키기...
if(stristr($memo, "&&"))
{
$memo_temp = explode("&&", $memo);
for($i=0; $i<10; $i++) {
$a="#img1"; $b="#img2";
if(stristr($memo_temp[$i], $a) || stristr($memo_temp[$i], $b)) {
$d = trim($memo_temp[$i]);
$gnees = explode(",", $d);
$img_target = trim($gnees[0]);
$img_size_x = trim($gnees[1]);
$img_size_y = trim($gnees[2]);
if($img_size_x && $img_size_y) {
if($img_target == "#img1") {
$c = "<img src='$data[file_name1]' width=$img_size_x height=$img_size_y border=0>";
$upload_image1 = "";
}
elseif($img_target == "#img2") {
$c = "<img src='$data[file_name2]' width=$img_size_x height=$img_size_y border=0>";
$upload_image2 = "";
}
$memo = str_replace($memo_temp[$i], $c, $memo);
}
else {
if(stristr($memo, $a)) {
$e = "<img src='$data[file_name1]' border='0' >";
$memo_temp[$i]=str_replace($a,$e,$memo_temp[$i]);
$upload_image1 = "";
}
if(stristr($memo, $b)) {
$f = "<img src='$data[file_name2]' border='0' >";
$memo_temp[$i]=str_replace($b,$f,$memo_temp[$i]);
}
}
}
}
$memo = str_replace("&&", "", $memo);
}
$a = "#img1";
if(stristr($memo, $a)) {
$c = "<img src='$data[file_name1]' border='0' >";
$memo=str_replace($a,$c,$memo);
$upload_image1 = ""; }
$b = "#img2";
if(stristr($memo, $b)) {
$c = "<img src='$data[file_name2]' border='0' >";
$memo=str_replace($b,$c,$memo);
$upload_image2 = ""; }
사용방법
사용은 다음 2가지 방법을 모두 사용가능합니다.
1. 이미지 크기를 변경하지 않고 출력시
글 내용중 원하는 위치에 #img1 또는 #img2를 써주면 됩니다. (v2.0의 방법임.)
2. 이미지 크기를 변경하여 출력시키기
글 내용중에 원하는 위치에 && #img1, 가로크기, 세로크기 && 라고 써주시면 됩니다.
위에서 앞의 && 은 소스적용시작 뒤의 &&은 소스 적용 끝을 의미합니다.
중간의 #img1은 첫번째 이미지를 의미하고 뒤는 이미지 크기를 의미합니다.
예) 첫번째 이미지를 300*200으로 출력시 : && #img1, 300, 200 &&
댓글 전체