레인 웹에디터 게시판에서 링크이미지문제 정보
레인 웹에디터 게시판에서 링크이미지문제본문
우선 소스 보여드릴께요~ 이건 팝업으로 이미지 파일 찾기와 이미지 url로 불러드리는 기능을 하는 창입니다. 그런데 자꾸 이미지 주소를 넣어도 이미지가 아니라고 나옵니다 ㅜㅜ 아예 아니라고 나오는 부분을 삭제하고 강제로 하거나 잘못된부분이 있으면 팁좀 부탁 드릴꼐요~ 고수님들~
밑에는 소스입니다.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<html STYLE="width: 630px; height: 370px; ">
<head><title>이미지 넣기</title><head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link rel="stylesheet" href="style.css" type="text/css">
<div style="position:absolute; left:0px; top:0px;z-index:50; display:none" id="uploadprocess"></div>
<script TYPE="text/JavaScript" SRC="common.js"></script>
<SCRIPT>
function resetForm() {
form = document.data;
form.reset();
}
var imgobj = new Object;
var width2screen = false;
function PreviewFile() {
if (ShowUploadProcess()) {
form = document.data;
imgobj.width = 0;
imgobj.height = 0;
imgobj.size = 0;
imgobj.ext = '';
imgobj.filename = '';
imgobj.sorce = '';
imgobj.server = '';
form.submit();
form.reset();
}
}
function ShowImg(use_oldimg) {
if (imgobj.ext != null && imgobj.ext.match(/gif|jpg|png|jpeg|bmp/i)) {
formset = document.set;
if (formset.width.value == '' || parseInt(formset.width.value) <= 0) formset.width.value = imgobj.width;
if (formset.height.value == '' || parseInt(formset.height.value) <= 0) formset.height.value = imgobj.height;
var img_width = parseInt(formset.width.value);
var img_height = parseInt(formset.height.value);
if (width2screen && img_width > 0 && img_height > 0) {
img_height = parseInt(350/img_width*img_height);
img_width = 350;
}
if (use_oldimg) var url = last_img_url;
else var url = Img_URL();
document.all('divPreview').innerHTML = Make_imgTag(url, img_width, img_height);
}
}
function Make_imgTag(url, img_width, img_height) {
formset = document.set;
if (img_width ==null ) img_width = formset.width.value;
if (img_height ==null ) img_height = formset.height.value;
str = '<img '
+ ' src="' + url + '" '
+ ' width='+ img_width + ' '
+ ' height='+ img_height + ' '
+ ' border='+formset.border.value+' '
+ ' vspace='+formset.vspace.value+' '
+ ' hspace='+formset.hspace.value+' '
+ ' align='+formset.align.value+' '
+ '>';
return str;
}
function Send2Edit() {
if (last_img_url != '') {
document.all('submitframe').src = last_img_url + '&m=END';
}
}
function Send2Edit_END(imgobj_server) {
imgobj.server = imgobj_server;
imgobj.html_tag = Make_imgTag(_uploads + imgobj_server);
window.returnValue = imgobj;
window.close()
}
function fix2Screen(chkobj) {
width2screen = chkobj.checked;
ShowImg();
}
var last_img_url = '';
<? if (!extension_loaded('gd') || !in_array("imagecopyresampled", get_extension_funcs("gd"))) { ?>
function Img_URL() {
formset = document.set;
url = 'preview_img.html?'
+ '&img_server='+imgobj.server
+ '&img_width='+formset.width.value
+ '&img_height='+formset.height.value
+ '&' + parseInt((Math.random()*10000000));
last_img_url = url;
return url;
}
<? } else { ?>
function Img_URL() {
formset = document.set;
url = 'preview_img.html?'
+ '&img_server='+imgobj.server
+ '&img_width='+formset.width.value
+ '&img_height='+formset.height.value
+ '&img_trim='+formset.trim.checked
+ '&img_trim_lr='+formset.trim_lr[formset.trim_lr.selectedIndex].value
+ '&img_trim_tb='+formset.trim_tb[formset.trim_tb.selectedIndex].value
+ '&' + parseInt((Math.random()*10000000));
last_img_url = url;
return url;
}
<? } ?>
function setUploadInfo(imgobj_width,imgobj_height,imgobj_size,imgobj_ext,imgobj_filename,imgobj_sorce,imgobj_server) {
CloseUploadProcess();
imgobj.width = parseInt(imgobj_width);
imgobj.height = parseInt(imgobj_height);
imgobj.size = imgobj_size;
imgobj.ext = imgobj_ext;
imgobj.filename = imgobj_filename;
imgobj.sorce = imgobj_sorce;
imgobj.server = imgobj_server;
if (imgobj.ext.match(/gif|jpg|png/i)) {
formset = document.set;
formset.reset();
formset.width.value = imgobj.width;
formset.height.value = imgobj.height;
ShowImg();
} else {
alert('이미지 파일만 올릴 수 있습니다. 이미지 파일 인지 다시 확인 하여 주십시오. ('+imgobj.filename+')');
}
}
</SCRIPT>
</HEAD>
<BODY scroll=no>
<table height=100% width=100% border="0" cellspacing="0" cellpadding="0">
<tr><td align=cneter>
<table border="0" cellspacing="6" cellpadding="0">
<tr><td>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td>
<table border="0" cellspacing="2" cellpadding="0">
<form name=data action=upload_file.html target=submitframe method=post enctype="multipart/form-data" onsubmit="return false;">
<tr>
<td>내컴퓨터 이미지</td><td>: <INPUT type=file name=local_file onfocus="select();" style='width:380' class=form></td>
</tr>
<tr>
<td>인터넷 이미지</td><td>: <INPUT name=url_file type=text onfocus="select()" style='width:380' class=form></td>
</tr>
</form>
</table>
</td><td>
<BUTTON tabIndex=2 style='width:70' onclick="PreviewFile()"><b>①</b>올리기</BUTTON><br>
<BUTTON tabIndex=2 style='width:70' onclick="resetForm()">다시작성</BUTTON><br>
</td></tr>
</table>
</td></tr>
<tr><td>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td width=400 valign=top>
<FIELDSET style="width: 100%; height: 240">
<LEGEND>미리보기</LEGEND>
<table border="0" cellspacing="1" cellpadding="1">
<tr style='display:none'><td><iframe src='blank.html' name=submitframe></iframe></td></tr>
<tr><td align=center>
<DIV id=divPreview style="width: 385; height: 190; overflow:auto">
</DIV>
</td></tr>
<tr><td><input type=checkbox onClick="fix2Screen(this)"> 화면 크기에 맞게 보기</td></tr>
</table>
</FIELDSET>
</td><td width=200 valign=top>
<FIELDSET style="width: 100%; height: 240">
<LEGEND>설정 및 적용</LEGEND>
<table border="0" cellspacing="1" cellpadding="1">
<form name=set onsubmit="return false">
<tr><td>
<table border="0" cellspacing="1" cellpadding="1">
<tr>
<td align=right>맞춤 <td colspan=3>: <select name=align onchange=ShowImg(true)>
<option value=''>기본값
<option value='left'>왼쪽
<option value='right'>오른쪽
<option value='top'>위쪽
<option value='texttop'>텍스트 위쪽
</select></td>
</tr>
<tr>
<td align=right>테두리 <td colspan=3>: <input type=text class=form name=border size=1 maxlength=1 value=0 onchange=ShowImg(true)></td>
</tr>
<tr>
<td align=right>간격-가로</td><td> : <input type=text class=form name=vspace size=1 maxlength=2 value=0 ></td>
<td align=right>세로</td><td> : <input type=text class=form name=hspace size=1 maxlength=2 value=0></td>
</tr>
<tr>
<td align=right>크기-가로</td><td> : <input type=text class=form name=width size=3 value='' onchange=ShowImg()></td>
<td align=right>세로</td><td> : <input type=text class=form name=height size=3 value='' onchange=ShowImg()></td>
</tr>
<? if (extension_loaded('gd') && in_array("imagecopyresampled", get_extension_funcs("gd"))) { ?>
<tr>
<td align=right>자르기</td><td colspan=3> : <input type=checkbox name=trim onclick=ShowImg()>이미지자르기</td>
</tr>
<tr>
<td align=right>보이기 <td colspan=3>:
좌우<select name=trim_lr onchange=ShowImg()>
<option value=''>없음
<option value='left'>왼쪽
<option value='right'>오른쪽
<option value='center'>중앙
</select></td>
</tr>
<tr>
<td align=right> <td colspan=3>:
상하<select name=trim_tb onchange=ShowImg() class=form>
<option value=''>없음
<option value='top'>위쪽
<option value='bottom'>아래쪽
<option value='middle'>중앙
</select>
</td>
</tr>
<? } ?>
</table>
</td></tr>
</form>
<tr><td height=25 valign=bottom align=center><BUTTON style='width:100' onClick=Send2Edit()><b>②</b>등록하기</BUTTON>
<BUTTON tabIndex=40 style='width:70' onclick="CloseWin()">닫기</BUTTON>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
</BODY>
</HTML>
밑에는 소스입니다.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<html STYLE="width: 630px; height: 370px; ">
<head><title>이미지 넣기</title><head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link rel="stylesheet" href="style.css" type="text/css">
<div style="position:absolute; left:0px; top:0px;z-index:50; display:none" id="uploadprocess"></div>
<script TYPE="text/JavaScript" SRC="common.js"></script>
<SCRIPT>
function resetForm() {
form = document.data;
form.reset();
}
var imgobj = new Object;
var width2screen = false;
function PreviewFile() {
if (ShowUploadProcess()) {
form = document.data;
imgobj.width = 0;
imgobj.height = 0;
imgobj.size = 0;
imgobj.ext = '';
imgobj.filename = '';
imgobj.sorce = '';
imgobj.server = '';
form.submit();
form.reset();
}
}
function ShowImg(use_oldimg) {
if (imgobj.ext != null && imgobj.ext.match(/gif|jpg|png|jpeg|bmp/i)) {
formset = document.set;
if (formset.width.value == '' || parseInt(formset.width.value) <= 0) formset.width.value = imgobj.width;
if (formset.height.value == '' || parseInt(formset.height.value) <= 0) formset.height.value = imgobj.height;
var img_width = parseInt(formset.width.value);
var img_height = parseInt(formset.height.value);
if (width2screen && img_width > 0 && img_height > 0) {
img_height = parseInt(350/img_width*img_height);
img_width = 350;
}
if (use_oldimg) var url = last_img_url;
else var url = Img_URL();
document.all('divPreview').innerHTML = Make_imgTag(url, img_width, img_height);
}
}
function Make_imgTag(url, img_width, img_height) {
formset = document.set;
if (img_width ==null ) img_width = formset.width.value;
if (img_height ==null ) img_height = formset.height.value;
str = '<img '
+ ' src="' + url + '" '
+ ' width='+ img_width + ' '
+ ' height='+ img_height + ' '
+ ' border='+formset.border.value+' '
+ ' vspace='+formset.vspace.value+' '
+ ' hspace='+formset.hspace.value+' '
+ ' align='+formset.align.value+' '
+ '>';
return str;
}
function Send2Edit() {
if (last_img_url != '') {
document.all('submitframe').src = last_img_url + '&m=END';
}
}
function Send2Edit_END(imgobj_server) {
imgobj.server = imgobj_server;
imgobj.html_tag = Make_imgTag(_uploads + imgobj_server);
window.returnValue = imgobj;
window.close()
}
function fix2Screen(chkobj) {
width2screen = chkobj.checked;
ShowImg();
}
var last_img_url = '';
<? if (!extension_loaded('gd') || !in_array("imagecopyresampled", get_extension_funcs("gd"))) { ?>
function Img_URL() {
formset = document.set;
url = 'preview_img.html?'
+ '&img_server='+imgobj.server
+ '&img_width='+formset.width.value
+ '&img_height='+formset.height.value
+ '&' + parseInt((Math.random()*10000000));
last_img_url = url;
return url;
}
<? } else { ?>
function Img_URL() {
formset = document.set;
url = 'preview_img.html?'
+ '&img_server='+imgobj.server
+ '&img_width='+formset.width.value
+ '&img_height='+formset.height.value
+ '&img_trim='+formset.trim.checked
+ '&img_trim_lr='+formset.trim_lr[formset.trim_lr.selectedIndex].value
+ '&img_trim_tb='+formset.trim_tb[formset.trim_tb.selectedIndex].value
+ '&' + parseInt((Math.random()*10000000));
last_img_url = url;
return url;
}
<? } ?>
function setUploadInfo(imgobj_width,imgobj_height,imgobj_size,imgobj_ext,imgobj_filename,imgobj_sorce,imgobj_server) {
CloseUploadProcess();
imgobj.width = parseInt(imgobj_width);
imgobj.height = parseInt(imgobj_height);
imgobj.size = imgobj_size;
imgobj.ext = imgobj_ext;
imgobj.filename = imgobj_filename;
imgobj.sorce = imgobj_sorce;
imgobj.server = imgobj_server;
if (imgobj.ext.match(/gif|jpg|png/i)) {
formset = document.set;
formset.reset();
formset.width.value = imgobj.width;
formset.height.value = imgobj.height;
ShowImg();
} else {
alert('이미지 파일만 올릴 수 있습니다. 이미지 파일 인지 다시 확인 하여 주십시오. ('+imgobj.filename+')');
}
}
</SCRIPT>
</HEAD>
<BODY scroll=no>
<table height=100% width=100% border="0" cellspacing="0" cellpadding="0">
<tr><td align=cneter>
<table border="0" cellspacing="6" cellpadding="0">
<tr><td>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td>
<table border="0" cellspacing="2" cellpadding="0">
<form name=data action=upload_file.html target=submitframe method=post enctype="multipart/form-data" onsubmit="return false;">
<tr>
<td>내컴퓨터 이미지</td><td>: <INPUT type=file name=local_file onfocus="select();" style='width:380' class=form></td>
</tr>
<tr>
<td>인터넷 이미지</td><td>: <INPUT name=url_file type=text onfocus="select()" style='width:380' class=form></td>
</tr>
</form>
</table>
</td><td>
<BUTTON tabIndex=2 style='width:70' onclick="PreviewFile()"><b>①</b>올리기</BUTTON><br>
<BUTTON tabIndex=2 style='width:70' onclick="resetForm()">다시작성</BUTTON><br>
</td></tr>
</table>
</td></tr>
<tr><td>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td width=400 valign=top>
<FIELDSET style="width: 100%; height: 240">
<LEGEND>미리보기</LEGEND>
<table border="0" cellspacing="1" cellpadding="1">
<tr style='display:none'><td><iframe src='blank.html' name=submitframe></iframe></td></tr>
<tr><td align=center>
<DIV id=divPreview style="width: 385; height: 190; overflow:auto">
</DIV>
</td></tr>
<tr><td><input type=checkbox onClick="fix2Screen(this)"> 화면 크기에 맞게 보기</td></tr>
</table>
</FIELDSET>
</td><td width=200 valign=top>
<FIELDSET style="width: 100%; height: 240">
<LEGEND>설정 및 적용</LEGEND>
<table border="0" cellspacing="1" cellpadding="1">
<form name=set onsubmit="return false">
<tr><td>
<table border="0" cellspacing="1" cellpadding="1">
<tr>
<td align=right>맞춤 <td colspan=3>: <select name=align onchange=ShowImg(true)>
<option value=''>기본값
<option value='left'>왼쪽
<option value='right'>오른쪽
<option value='top'>위쪽
<option value='texttop'>텍스트 위쪽
</select></td>
</tr>
<tr>
<td align=right>테두리 <td colspan=3>: <input type=text class=form name=border size=1 maxlength=1 value=0 onchange=ShowImg(true)></td>
</tr>
<tr>
<td align=right>간격-가로</td><td> : <input type=text class=form name=vspace size=1 maxlength=2 value=0 ></td>
<td align=right>세로</td><td> : <input type=text class=form name=hspace size=1 maxlength=2 value=0></td>
</tr>
<tr>
<td align=right>크기-가로</td><td> : <input type=text class=form name=width size=3 value='' onchange=ShowImg()></td>
<td align=right>세로</td><td> : <input type=text class=form name=height size=3 value='' onchange=ShowImg()></td>
</tr>
<? if (extension_loaded('gd') && in_array("imagecopyresampled", get_extension_funcs("gd"))) { ?>
<tr>
<td align=right>자르기</td><td colspan=3> : <input type=checkbox name=trim onclick=ShowImg()>이미지자르기</td>
</tr>
<tr>
<td align=right>보이기 <td colspan=3>:
좌우<select name=trim_lr onchange=ShowImg()>
<option value=''>없음
<option value='left'>왼쪽
<option value='right'>오른쪽
<option value='center'>중앙
</select></td>
</tr>
<tr>
<td align=right> <td colspan=3>:
상하<select name=trim_tb onchange=ShowImg() class=form>
<option value=''>없음
<option value='top'>위쪽
<option value='bottom'>아래쪽
<option value='middle'>중앙
</select>
</td>
</tr>
<? } ?>
</table>
</td></tr>
</form>
<tr><td height=25 valign=bottom align=center><BUTTON style='width:100' onClick=Send2Edit()><b>②</b>등록하기</BUTTON>
<BUTTON tabIndex=40 style='width:70' onclick="CloseWin()">닫기</BUTTON>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
</BODY>
</HTML>
댓글 전체