ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î

´ÙÀ½¿ÀÇ¿¡µðÅÍ ¹× ¼³Ä¡¹æ¹ý
13³â Àü
´ÙÀ½ ¿ÀÇ ¿¡µðÅÍ°¡ ¿ÀÇ À¥¿¡µðÅ͵é Áß ±×³ª¸¶ »ç¿ë¼ºÀÌ ÁÁÀ» °Å °°¾Æ php °Ô½ÃÆÇ µî¿¡ Àû¿ëÇغôÙ.

´Ù¿î·Îµå´Â http://code.google.com/p/daumopeneditor/downloads/list

daumeditor-5.4.0.zip

ÅèĹÀ» ¼³Ä¡Ç϶ó°í ¸Þ´º¾ó¿¡ ³ª¿Í Àֱ淡 ÷¿¡ Æ÷±âÇÒ·Á´Ù°¡ ¾îÂ¥ÇÇ ÀÚ¹Ù½ºÅ©¸³Æ®·Î ±¸µ¿µÉ²¨ ±×³É ¹Ù·Î Àû¿ë½ÃÄÑ ºÃ´Âµ¥.. Àß µÈ´Ù..

¡¡

¿ì¼± ´Ù¿î ¹ÞÀº ÆÄÀÏÀ» µð·ºÅ丮¸íÀ» ¹Ù²ã¼­ ftp·Î ¾÷·Îµå.

/editor ¶ó´Â µð·ºÅ丮¸íÀ¸·Î Çؼ­ °Ô½ÃÆÇ, Æû¸ÞÀÏ µî ¾Æ¹« °÷¿¡¼­³ª include Çؼ­ »ç¿ëÇÒ ¼ö ÀÖ°Ô ¼öÁ¤ÇÑ´Ù.

¡¡

1. ¿¡µðÅÍ µð·ºÅ丮¿¡¼­ ¿¹Á¦·Î ¿Ã·Á³õÀº daumeditor.html ÆÄÀÏÀ» editor.php ÆÄÀÏ·Î º¯°æ ÈÄ ¼öÁ¤.

¡¡

/editor.php

<link rel="stylesheet" href="/editor/css/editor.css" type="text/css"  charset="euc-kr"/>
<script-x src="/editor/js/editor.js" type="text/javascript-x" charset="euc-kr"></script-x>
<script-x src="/editor/js/editor_sample.js" type="text/javascript-x" charset="euc-kr"></script-x>

¡¡

<!-- ¿¡µðÅÍ ÄÁÅ×ÀÌ³Ê ½ÃÀÛ -->
<div id="tx_trex_container" class="tx-editor-container">

..

..

..

</div>
<!-- ¿¡µðÅÍ ÄÁÅ×ÀÌ³Ê ³¡ -->

¡¡

/*

daumeditor.html¿¡¼­ css¿Í js ÆÄÀÏ ¸µÅ© ºÎºÐ°ú ¿¡µðÅÍÀÇ ¸öü¿¡ ÇØ´çÇÏ´Â À§ÀÇ ºÎºÐ±îÁö º¹»ç.

<!-- ÆíÁý¿µ¿ª ½ÃÀÛ --> À̶ó´Â ºÎºÐÀÇ loading2.png ÆÄÀÏÀÇ °æ·Î¸¦ Àý´ë °æ·Î·Î º¯°æ (/editor/images/icon/loading2.png)

±×´ÙÀ½À¸·Î ¿¡µðÅÍÀÇ Ãʱ⠼³Á¤À» ·Îµù½ÃÅ°´Â ¾Æ·¡ ºÎºÐ º¹»ç.

*/

¡¡

<script-x type="text/javascript-x">
// <![CDATA[

/*-------- ¿¡µðÅÍ ·Îµå ½ÃÀÛ ----------*/
new Editor({
txHost: '', /* ·±Å¸ÀÓ ½Ã ¸®¼Ò½ºµéÀ» ·ÎµùÇÒ ¶§ ÇÊ¿äÇÑ ºÎºÐÀ¸·Î, °æ·Î°¡ º¯°æµÇ¸é ÀÌ ºÎºÐ ¼öÁ¤ÀÌ ÇÊ¿ä.
txPath: '/editor/', /* ·±Å¸ÀÓ ½Ã ¸®¼Ò½ºµéÀ» ·ÎµùÇÒ ¶§ ÇÊ¿äÇÑ ºÎºÐÀ¸·Î, °æ·Î°¡ º¯°æµÇ¸é ÀÌ ºÎºÐ ¼öÁ¤ÀÌ ÇÊ¿ä. */
txVersion: '5.4.0', /* ¼öÁ¤ÇÊ¿ä¾øÀ½. */
txService: 'sample', /* ¼öÁ¤ÇÊ¿ä¾øÀ½. */
txProject: 'sample', /* ¼öÁ¤ÇÊ¿ä¾øÀ½. ÇÁ·ÎÁ§Æ®°¡ ¿©·¯°³ÀÏ °æ¿ì¸¸ ¼öÁ¤ÇÑ´Ù. */
initializedId: "", /* ´ëºÎºÐÀÇ °æ¿ì¿¡ ºó¹®ÀÚ¿­ */
wrapper: "tx_trex_container"+"", /* ¿¡µðÅ͸¦ µÑ·¯½Î°í ÀÖ´Â ·¹À̾î À̸§(¿¡µðÅÍ ÄÁÅ×À̳Ê) */
form: 'frmWrite'+"", /* µî·ÏÇϱâ À§ÇÑ Form À̸§ */
txIconPath: "/editor/images/icon/", /*¿¡µðÅÍ¿¡ »ç¿ëµÇ´Â À̹ÌÁö µð·ºÅ͸®, ÇÊ¿ä¿¡ µû¶ó ¼öÁ¤ÇÑ´Ù. */
txDecoPath: "/editor/images/deco/", /*º»¹®¿¡ »ç¿ëµÇ´Â À̹ÌÁö µð·ºÅ͸®, ¼­ºñ½º¿¡¼­ »ç¿ëÇÒ ¶§´Â ¿Ï¼ºµÈ ÄÁÅÙÃ÷·Î ¹èÆ÷µÇ±â À§ÇØ Àý´ë°æ·Î·Î ¼öÁ¤ÇÑ´Ù. */
canvas: {
 styles: {
    color: "#5a5a5a", /* ±âº» ±ÛÀÚ»ö */
    fontFamily: "±¼¸²", /* ±âº» ±ÛÀÚü */
    fontSize: "9pt", /* ±âº» ±ÛÀÚÅ©±â */
    backgroundColor: "#fff", /*±âº» ¹è°æ»ö */
    lineHeight: "1.5", /*±âº» ÁÙ°£°Ý */
    padding: "5px" /* À§ÁöÀ¨ ¿µ¿ªÀÇ ¿©¹é */
   }
  }, 
 
  sidebar: {
   attacher: {
    image: {
           multiple: true,
           multipleuse: false,
           checksize: false,
           boxonly: false,
           wysiwygonly: true,
           objattr: {width: 680},
           features: { left:250, top:65, width:600, height:310, scrollbars:0},
           popPageUrl: "/editor/pAttachPhoto.php"
    },
    file: {
           multiple: true,
           multipleuse: false,
           checksize: true,
           boxonly: true,
           wysiwygonly: false,
           features: { left:250, top:65, width:600, height:235, scrollbars:0},
           popPageUrl: "/editor/pAttachFile.php"
    }
   }
  }
 });
 /*-------- ¿¡µðÅÍ ·Îµå ³¡ ----------*/
// ]]>
</script-x>

¡¡

/*

ºÓÀº »ö ºÎºÐÀº ÀÚ±â ȯ°æ¿¡ ¸Â°Ô ÀûÀýÈ÷ ¼öÁ¤.

¡¡

txPath : ¿ÜºÎ µð·ºÅ丮¿¡¼­ include »ç¿ëÇÒ °ÍÀ̱⠶§¹®¿¡ ¿¡µðÅÍ µð·ºÅ丮ÀÇ Àý´ë°æ·Î¸¦ ÀÔ·Â.

form : °Ô½ÃÆÇ µî¿¡¼­ »ç¿ëµÇ¾îÁö´Â form ³×ÀÓ. ³ª´Â ÁÖ·Î ÆûÀ̸§À» frmWrite·Î »ç¿ëÇؼ­ frmWrite·Î ¼³Á¤.

txIconPath, txDecoPath : Àý´ë °æ·Î·Î ÀÔ·Â.

¡¡

attacher ¼³Á¤Àº ÆÄÀÏ Ã·ºÎ½ÃÀÇ ¼³Á¤À» À§ÇÑ °ÍÀÌ´Ù.(image¾÷·Îµå¿Í ÆÄÀÏ ¾÷·Îµå·Î ³ª´©¾î ¼³Á¤)

imageºÎºÐÀÇ objattr: {width: 680}Àº ºäÆäÀÌÁö¿¡¼­ À̹ÌÁöÀÇ °¡·Î»çÀÌÁ 680Çȼ¿·Î Àû¿ë½ÃÄÑÁØ´Ù.

popPageUrl : À̹ÌÁö ¹× ÆÄÀÏ ¾÷·Îµå Æ˾÷ ÆäÀÌÁö

¡¡

file ºÎºÐÀÇ boxonly: true, wysiwygonly: false ·Î ¼³Á¤ÇÑ °ÍÀº ÀÏ¹Ý ÆÄÀÏ Ã·ºÎ´Â ³»¿ë¿¡ Ç¥½ÃµÇÁö ¾Êµµ·Ï Çϱâ À§ÇÑ °Í.

*/

¡¡

2. °Ô½ÃÆÇ form (/bbs/write.php)

ÀϹÝÀûÀ¸·Î »ç¿ëµÇ´Â ¾²±â ÆäÀÌÁöÀÇ form¿¡¼­ ¿¡µðÅ͸¦ include Çؼ­ º»¹® ¾²±â¿Í ÆÄÀÏ ¾÷·Îµå¸¦ Àû¿ë.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>°Ô½ÃÆÇ</title>

</head>

<body>

¡¡

<script-x type="text/javascript-x">

 function fnCheckInput() {
  Editor.save();
 }


 function validForm(editor) { 
  if($tx('chTitle').value == ""){
   alert('Á¦¸ñÀ» ÀÔ·ÂÇϼ¼¿ä'); return false;
  }

¡¡

  /* º»¹® ³»¿ëÀÌ ÀԷµǾú´ÂÁö °Ë»çÇÏ´Â ºÎºÐ */
  var _validator = new Trex.Validator();
  var _content = editor.getContent();
  if(!_validator.exists(_content)) {
   alert('³»¿ëÀ» ÀÔ·ÂÇϼ¼¿ä');
   return false;
  }
  
  return true;
 }
 
 function setForm(editor) {
  var _formGen = editor.getForm();
 
  var _content = editor.getContent();
  _formGen.createField(
   tx.textarea({
    /* º»¹® ³»¿ëÀ» Çʵ带 »ý¼ºÇÏ¿© °ªÀ» ÇÒ´çÇÏ´Â ºÎºÐ */
    'name': "tx_content",
    'style': { 'display': "none" }
   },
   _content)
  );
 
  // À̹ÌÁö ÷ºÎ ýũ
  var nCount = 0;
  var _attachments = editor.getAttachments('image');
  for(var i=0; i<_attachments.length; i++) {
   /* existStage´Â ÇöÀç º»¹®¿¡ Á¸ÀçÇÏ´ÂÁö ¿©ºÎ */
   if (_attachments[i].existStage) {
    /* data´Â Æ˾÷¿¡¼­ execAttach µîÀ» ÅëÇØ ³Ñ±ä µ¥ÀÌÅÍ */
    //alert(_attachments[i].data);
    _formGen.createField(
     tx.input({'name': 'aFile[' + i + ']', 'type': 'hidden', 'value': _attachments[i].data.filename})
    );
    _formGen.createField(
     tx.input({'name': 'aFileType[' + i + ']', 'type': 'hidden', 'value': 'image'})
    );
    nCount ++;
   }
  }
 
  // ÆÄÀÏ Ã·ºÎ ýũ
  var _attachments = editor.getAttachments('file', true);
  for(var i=0; i<_attachments.length; i++) {
   _formGen.createField(
    tx.input({'name': 'aFile[' + (nCount+i) + ']', 'type': 'hidden', 'value': _attachments[i].data.filename})
   );
   _formGen.createField(
    tx.input({'name': 'aFileType[' + (nCount+i) + ']', 'type': 'hidden', 'value': 'file'})
   );
  }
 
  return true;
 }
</script-x>

¡¡

<form name="frmWrite" id="frmWrite" method="post" action="register.php">

¡¡

<table width="100%" bordercolor="#e9e9e9" frame="hsides" rules="all">

    <tr>

        <td>Á¦¸ñ : </td>

        <td><input name="chTitle" id="chTitle" type="text" style="width:90%;" /></td>

    <tr>

</table>

<div>

<?

    include $DOCUMENT_ROOT."/editor/editor.php";

?>

</div>

<div>

    <img src="/images/btn/btn_submit.gif" style="cursor:pointer;" onclick="fnCheckInput();" />

</div>

</table>

¡¡

</form>

write.php ÆÄÀÏ¿¡¼­ µî·Ï ¹öÆ°À» Ŭ¸¯Çϸé Editor.save()°¡ È£ÃâÀÌ µÇ°í, validForm ÇÔ¼ö¿¡¼­ Æûýũ¸¦ ÇÑÈÄ true°¡ µÇµ¹·ÁÁö¸é

setForm ÇÔ¼ö¿¡¼­ Á¦¸ñ, º»¹® ³»¿ë, ¾÷·ÎµåµÈ À̹ÌÁö¿Í ÆÄÀϵîÀ» register.php ÆÄÀÏ·Î submit ÇÏ°Ô µÇ´Â ±¸Á¶´Ù.

ÃßõÃßõ : 816 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,885
input ÀÔ·Â ÇÊµå ¾ÕµÚ °ø¹é ½Ç½Ã°£ Á¦°Å
2,884
Placeholder Æ÷Ä¿½º½Ã °¨Ãß±â
2,883
MySQL Áߺ¹µÈ µ¥ÀÌÅ͸¦ »èÁ¦
2,882
MySQL Áߺ¹ µ¥ÀÌÅÍ È®ÀÎ
2,881
sessionStorage.getItem ¿Í sessionStorage.setItem
2,880
Á¦ÀÌÄõ¸® ·£´ýÀ¸·Î ¹è°æ»ö º¯°æ
2,879
preg match¿¡ °üÇÑ Á¤±Ô½Ä
2,878
Stream an audio file with MediaPlayer ¿Àµð¿À ÆÄÀÏ ½ºÆ®¸®¹Ö Çϱâ
2,877
Audio Streaming PHP Code
2,876
PHP $ SERVER ȯ°æ º¯¼ö Á¤¸®
2,875
Vimeo (ºñ¸Þ¿À) API ¸¦ »ç¿ëÇÏ¿© Ç÷¹À̾î ÄÁÆ®·ÑÇϱâ
2,874
iframe »ç¿ë½Ã ÇÏ´Ü¿¡ ¹ß»ýÇÏ´Â °ø¹é Á¦°Å¹æ¹ý
2,873
¾ÆÀÌÇÁ·¹ÀÓ(iframe) Àüüȭ¸é °¡´ÉÇÏ°Ô Çϱâ
2,872
ºÎÆ®½ºÆ®·¦(bootstrapk)¿¡¼­ »ç¿ëÇÏ´Â class¸í Á¤¸®
2,871
ºÎÆ®½ºÆ®·¦ CSS
2,870
Å©·Ò¿¡¼­ ¸¶Áø Á¶Àý
2,869
PHP ÇöÀç ÆäÀÌÁöÀÇ µµ¸ÞÀθíÀ̳ª urlµîÀÇ Á¤º¸ ¾Ë¾Æ¿À±â
2,868
PHP preg match all()
2,867
PHP ·Î À¥ÆäÀÌÁö ±Ü¾î¿À±â ¸ðµç ¹æ¹ý ÃÑÁ¤¸®!
2,866
[PHP] ¿ø°ÝÁö ÆÄÀÏ ÁÖ¼Ò ³ëÃâ ¾ÈÇÏ°í curl·Î ´Ù¿î·Îµå ¹Þ±â
2,865
PHP ÇÔ¼ö Á¤¸®
2,864
¾ÆÀÌÇÁ·¹ÀÓ(iframe) ºñÀ² À¯ÁöÇϸ鼭 Å©±â Á¶ÀýÇÏ´Â ¹æ¹ý
2,863
PHP ¹è¿­¿¡¼­ ¹«ÀÛÀ§·Î Çϳª »Ì¾ÆÁÖ´Â array rand() ÇÔ¼ö
2,862
PHP Á¤±Ô½Ä Á¤¸®
2,861
PHP Á¤±Ô½ÄÀ» È°¿ëÇÑ ÅÂ±× ¹× ƯÁ¤ ¹®ÀÚ¿­ Á¦°Å ¹× ÃßÃâ ¹æ¹ý
2,860
php Å©·Ñ¸µ ¶Ç´Â ÆÄ½Ì ÇÔ¼ö, Á¤±Ô½Ä ¸ðÀ½
2,859
Á¦ÀÌÄõ¸® ±âº» ¸í·É¾î
2,858
À¥ÆäÀÌÁö °¡·Î ¸ðµå¼¼·Î ¸ðµå ÀνÄÇϱâ
2,857
¸ð¹ÙÀÏ À¥ È­¸é °­Á¦ ȸÀü(°¡·Î¸ðµå °íÁ¤)
2,856
[HTML5]¿¡¼­ frameset ´ëü ¹æ¹ý°ú iframe ¼Ó¼º
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.