<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/post//</link>
<title><![CDATA[FCKedit用法[原英文版]]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 27 Dec 2005 01:08:21 +0000</pubDate> 
<guid>https://atim.cn/post//</guid> 
<description>
<![CDATA[ 
	<div lang="en" id="page" dir="ltr"><div lang="en" id="content" dir="ltr"><span class="anchor" id="top"></span><span class="anchor" id="line-1"></span><p>It is very easy to use FCKeditor in your PHP web pages. All the integration files are available in the official distributed package. A simple <em>include </em>command to the fckeditor.php file will integrate FCKeditor to your PHP pages. <span class="anchor" id="line-2"></span></p><span class="anchor" id="line-3"></span><h3 id="head-8ff26e8949306bfae36e2119d29af1f8343638c0">Step 1</h3><span class="anchor" id="line-4"></span><p>Suppose that the editor is installed in the /FCKeditor/ path of your web site. The first thing to do is to include the &quot;PHP Integration Module&quot; file in the top of your page, just like this: <span class="anchor" id="line-5"></span></p><span class="anchor" id="line-6"></span><span class="anchor" id="line-7"></span><pre>&lt;?php<br/><span class="anchor" id="line-8"></span>include(&quot;FCKeditor/fckeditor.php&quot;) ;<br/><span class="anchor" id="line-9"></span>?&gt;<br/><span class="anchor" id="line-10"></span></pre><span class="anchor" id="line-11"></span><span class="anchor" id="line-12"></span><h3 id="head-1f6e1caa33832208c872e9a4d981cb1710837fd3">Step 2</h3><span class="anchor" id="line-13"></span><p>Now the FCKeditor is available and ready to use. So, just insert the following code in your page to create an instance of the editor (usually inside a &lt;FORM&gt;): <span class="anchor" id="line-14"></span></p><span class="anchor" id="line-15"></span><span class="anchor" id="line-16"></span><pre>&lt;?php<br/><span class="anchor" id="line-17"></span>$oFCKeditor = new FCKeditor('FCKeditor1') ;<br/><span class="anchor" id="line-18"></span>$oFCKeditor-&gt;BasePath = '/FCKeditor/';<br/><span class="anchor" id="line-19"></span>$oFCKeditor-&gt;Value = 'Default text in editor';<br/><span class="anchor" id="line-20"></span>$oFCKeditor-&gt;Create() ;<br/><span class="anchor" id="line-21"></span>?&gt;<br/><span class="anchor" id="line-22"></span></pre><span class="anchor" id="line-23"></span><span class="anchor" id="line-24"></span><p>&quot;FCKeditor1&quot; is the name used to post the editor data on forms. <span class="anchor" id="line-25"></span></p><span class="anchor" id="line-26"></span><h3 id="head-20f6105d78dd4cacafe8a298de1a487720e3125c">Step 3</h3><span class="anchor" id="line-27"></span><p>The editor is now ready to be used. Just open the page in your browser to see it at work. <span class="anchor" id="line-28"></span></p><span class="anchor" id="line-29"></span><h3 id="head-0d685d722d491af2feeeff565c815e8d10cf8f28">The complete sample</h3><span class="anchor" id="line-30"></span><span class="anchor" id="line-31"></span><pre>&lt;?php<br/><span class="anchor" id="line-32"></span>include(&quot;FCKeditor/fckeditor.php&quot;) ;<br/><span class="anchor" id="line-33"></span>?&gt;<br/><span class="anchor" id="line-34"></span>&lt;html&gt;<br/><span class="anchor" id="line-35"></span> &nbsp;&lt;head&gt;<br/><span class="anchor" id="line-36"></span> &nbsp; &nbsp;&lt;title&gt;FCKeditor - Sample&lt;/title&gt;<br/><span class="anchor" id="line-37"></span> &nbsp; &nbsp;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;<br/><span class="anchor" id="line-38"></span> &nbsp;&lt;/head&gt;<br/><span class="anchor" id="line-39"></span> &nbsp;&lt;body&gt;<br/><span class="anchor" id="line-40"></span> &nbsp; &nbsp;&lt;form action=&quot;savedata.php&quot; method=&quot;post&quot;&gt;<br/><span class="anchor" id="line-41"></span>&lt;?php<br/><span class="anchor" id="line-42"></span>$oFCKeditor = new FCKeditor('FCKeditor1') ;<br/><span class="anchor" id="line-43"></span>$oFCKeditor-&gt;BasePath = '/FCKeditor/';<br/><span class="anchor" id="line-44"></span>$oFCKeditor-&gt;Value = 'Default text in editor';<br/><span class="anchor" id="line-45"></span>$oFCKeditor-&gt;Create() ;<br/><span class="anchor" id="line-46"></span>?&gt;<br/><span class="anchor" id="line-47"></span> &nbsp; &nbsp; &nbsp;&lt;br&gt;<br/><span class="anchor" id="line-48"></span> &nbsp; &nbsp; &nbsp;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;<br/><span class="anchor" id="line-49"></span> &nbsp; &nbsp;&lt;/form&gt;<br/><span class="anchor" id="line-50"></span> &nbsp;&lt;/body&gt;<br/><span class="anchor" id="line-51"></span>&lt;/html&gt;<br/><span class="anchor" id="line-52"></span></pre><span class="anchor" id="line-53"></span><span class="anchor" id="line-54"></span><h2 id="head-3175e6a88c0a14c41d0c87ffb1e912306c21a486">Handling the posted data</h2><span class="anchor" id="line-55"></span><p>The editor instance just created will behave like a normal &lt;INPUT&gt; field in a form. It will use the name you've used when creating it (in the above sample, &quot;FCKeditor1&quot;). <span class="anchor" id="line-56"></span></p><span class="anchor" id="line-57"></span><p>So, to retrieve its value you can do something like this: <span class="anchor" id="line-58"></span></p><span class="anchor" id="line-59"></span><span class="anchor" id="line-60"></span><pre>$sValue = stripslashes( $_POST['FCKeditor1'] ) ;<br/><span class="anchor" id="line-61"></span></pre><span class="anchor" id="line-62"></span><span class="anchor" id="line-63"></span><h2 id="head-ef1e61fe135d5e89c2dbb31b26dcb493acf1f7a1">Samples</h2><span class="anchor" id="line-64"></span><p>You can find some samples on how to use the editor in the &quot;_samples/php&quot; directory of the distributed package. <span class="anchor" id="line-65"></span></p><span class="anchor" id="line-66"></span><h2 id="head-e0ceced6bbd929c8792079e7ccf9e08e495a261c">Other info</h2><span class="anchor" id="line-67"></span><p>If you want to retrieve the resulting HTML instead of outputting it directly to the browser (for example if you're using it in a template engine such as Smarty), you can call the<em> <a class="nonexistent" href="http://wiki.fckeditor.net/CreateHtml">CreateHtml</a>() </em>method instead: <span class="anchor" id="line-68"></span></p><span class="anchor" id="line-69"></span><span class="anchor" id="line-70"></span><pre>$output = $oFCKeditor-&gt;CreateHtml() ;<br/><span class="anchor" id="line-71"></span></pre><span class="anchor" id="line-72"></span><span class="anchor" id="line-73"></span><hr /><p><span class="anchor" id="line-74"></span></p><ul><li style="LIST-STYLE-TYPE: none"><p>To change the size of the editor in the page, insert the following code before calling the <em>Create()</em> or <em><a class="nonexistent" href="http://wiki.fckeditor.net/CreateHtml">CreateHtml</a>()</em> methods: <span class="anchor" id="line-75"></span></p><span class="anchor" id="line-76"></span></li></ul><span class="anchor" id="line-77"></span><pre>$oFCKeditor-&gt;Width &nbsp;= '100%' ;<br/><span class="anchor" id="line-78"></span>$oFCKeditor-&gt;Height = '200' ;<br/><span class="anchor" id="line-79"></span></pre><span class="anchor" id="line-80"></span><span class="anchor" id="line-81"></span><p>and just change the values to your needs. <span class="anchor" id="line-82"></span></p><span class="anchor" id="line-83"></span><hr /><p><span class="anchor" id="line-84"></span></p><ul><li style="LIST-STYLE-TYPE: none"><p>To modify configuration settings in a separate file outside the editor's directory, add them to the Config property of the editor object: <span class="anchor" id="line-85"></span></p><span class="anchor" id="line-86"></span></li></ul><span class="anchor" id="line-87"></span><pre>$oFCKeditor-&gt;Config['CustomConfigurationsPath'] = '/myconfig.js' ;<br/><span class="anchor" id="line-88"></span></pre><span class="anchor" id="line-89"></span><span class="anchor" id="line-90"></span><hr /><p><span class="anchor" id="line-91"></span></p><ul><li style="LIST-STYLE-TYPE: none"><p>To set the path for saving uploaded files uncomment the following line in /FCKeditor/editor/filemanager/browser/default/connectors/php/config.php. <span class="anchor" id="line-92"></span></p><span class="anchor" id="line-93"></span></li></ul><span class="anchor" id="line-94"></span><pre>// $Config['UserFilesPath'] = '/UserFiles/' ;<br/><span class="anchor" id="line-95"></span></pre><span class="anchor" id="line-96"></span><span class="anchor" id="line-97"></span><p>Note: Set the permission of the upload directory properly. You should also uncomment the settings of <strong>LinkBrowserURL</strong> and the <strong>ImageBrowserURL</strong> in the /FCKeditor_2.0fc/fckconfig.js file for the browsing and uploading function to work properly. See <a class="www" href="http://fckeditor.wikiwikiweb.de/Developer's_Guide/Configuration/Built_in_File_Browser">Built-in File Browser</a> for more information. <span class="anchor" id="line-98"></span></p><span class="anchor" id="line-99"></span><p><strong>Important Note for PHP </strong><strong>with Safe Mode activated :</strong> You'll have to create <tt>/UserFiles/File</tt>, <tt>/UserFiles/Flash</tt>, <tt>/UserFiles/Image</tt> and <tt>/UserFiles/Media</tt> in order for the filebrowser to work. Of course, you'll also have to set the correct permissions for these directories. Furthermore, don't use the &quot;Create new folder&quot; button. The folder would be created but couldn't be used (<em>Safe Mode restriction</em>). <span class="anchor" id="line-100"></span></p><span class="anchor" id="bottom"></span></div><p class="info" lang="zh" id="pageinfo" dir="ltr">2005-12-26 18:05:07由<span title="??? @ ppp-slp-b.telkom.net.id[61.5.68.138]">ppp-slp-b</span>编辑</p><div id="pagebottom"></div></div>
]]>
</description>
</item><item>
<link>https://atim.cn/post//#blogcomment</link>
<title><![CDATA[[评论] FCKedit用法[原英文版]]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://atim.cn/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>