3. แทนที่ด้วย (replace with)<script language="javascript" type="text/javascript">
<!--
// MOD Title: Simple Image Upload
// MOD Author: Sium < admin@postimage.org > (N/A) http://www.postimage.org/
// MOD Version: 1.3.0
var postimage_lang="thai";
var postimage_add_text="Add image to post";
var postimage_textarea_ignore_name=/username_list|search/i;
function postimage_query_string(postimage_search_name)
{
postimage_query=window.location.search.substring(1).split("&");
for(postimage_i=0;postimage_i<postimage_query.length;postimage_i++)
{
postimage_string_data=postimage_query[postimage_i].split("=");
if(postimage_string_data[0]==postimage_search_name)
{
return unescape(postimage_string_data[1]);
}
}
}
function postimage_add_code()
{
if(opener)
{
var postimage_text=postimage_query_string("postimage_text");
if(postimage_text)
{
var postimage_id=postimage_query_string("postimage_id");
var postimage_area=opener.document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(postimage_i==postimage_id)
{
break;
}
}
if(opener.editorHandlemessage && opener.editorHandlemessage.bRichTextEnabled)
{
opener.editorHandlemessage.insertText(postimage_text+"<br /><br />",false);
}
else
{
postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
}
opener.focus();
window.close();
}
}
}
function postimage_insert()
{
var postimage_area=document.getElementsByTagName("TEXTAREA");
for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++)
{
if(!postimage_area[postimage_i].name.match(postimage_textarea_ignore_name))
{
var postimage_new_div=document.createElement("div");
postimage_new_div.innerHTML="<br /> • <a href=\"javascript:void(0);\" onclick=\"window.open(\'http://www.postimage.org/index.php?mode=smf&lang="+postimage_lang+"&areaid="+postimage_i+"&forumurl=\' + escape(document.location.href), \'postimage\', \'resizable=yes,width=500,height=400\');return false;\"><b>"+postimage_add_text+"</b></a><br /><br />";
postimage_area[postimage_i].parentNode.insertBefore(postimage_new_div,postimage_area[postimage_i]);
}
}
}
postimage_add_code();
window.onload=postimage_insert;
//-->
</script>
</head>
เสร็จแล้ว Save แล้วก็ upload กลับที่เดิม