分页: 108/119 第一页 上页 103 104 105 106 107 108 109 110 111 112 下页 最后页 [ 显示模式: 摘要 | 列表 ]
Jan 18
没什么只是手册
up/1137585149.chm
Dec 27
Dec 27

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 include command to the fckeditor.php file will integrate FCKeditor to your PHP pages.

Step 1

Suppose that the editor is installed in the /FCKeditor/ path of your web site. The first thing to do is to include the "PHP Integration Module" file in the top of your page, just like this:

<?php
include("FCKeditor/fckeditor.php") ;
?>

Step 2

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 <FORM>):

<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/FCKeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create() ;
?>

"FCKeditor1" is the name used to post the editor data on forms.

Step 3

The editor is now ready to be used. Just open the page in your browser to see it at work.

The complete sample

<?php
include("FCKeditor/fckeditor.php") ;
?>
<html>
 <head>
   <title>FCKeditor - Sample</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 </head>
 <body>
   <form action="savedata.php" method="post">
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/FCKeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create() ;
?>
     <br>
     <input type="submit" value="Submit">
   </form>
 </body>
</html>

Handling the posted data

The editor instance just created will behave like a normal <INPUT> field in a form. It will use the name you've used when creating it (in the above sample, "FCKeditor1").

So, to retrieve its value you can do something like this:

$sValue = stripslashes( $_POST['FCKeditor1'] ) ;

Samples

You can find some samples on how to use the editor in the "_samples/php" directory of the distributed package.

Other info

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 CreateHtml() method instead:

$output = $oFCKeditor->CreateHtml() ;

  • To change the size of the editor in the page, insert the following code before calling the Create() or CreateHtml() methods:

$oFCKeditor->Width  = '100%' ;
$oFCKeditor->Height = '200' ;

and just change the values to your needs.


  • To modify configuration settings in a separate file outside the editor's directory, add them to the Config property of the editor object:

$oFCKeditor->Config['CustomConfigurationsPath'] = '/myconfig.js' ;

  • To set the path for saving uploaded files uncomment the following line in /FCKeditor/editor/filemanager/browser/default/connectors/php/config.php.

// $Config['UserFilesPath'] = '/UserFiles/' ;

Note: Set the permission of the upload directory properly. You should also uncomment the settings of LinkBrowserURL and the ImageBrowserURL in the /FCKeditor_2.0fc/fckconfig.js file for the browsing and uploading function to work properly. See Built-in File Browser for more information.

Important Note for PHP with Safe Mode activated : You'll have to create /UserFiles/File, /UserFiles/Flash, /UserFiles/Image and /UserFiles/Media 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 "Create new folder" button. The folder would be created but couldn't be used (Safe Mode restriction).

2005-12-26 18:05:07由ppp-slp-b编辑

Dec 24
  1. 从数据库结构做起
    1. 字段类型的定义时遵循以下规则:
      1. 选用字段长度最小
      2. 优先使用定长型
      3. 尽可能的定义 "NOT NULL"
      4. 数值型字段中避免使用 "ZEROFILL"
      5. 如果要储存的数据为字符串, 且可能值已知且有限, 优先使用 enum 或 set
    2. 索引的优化至关重要(以下如果没有特殊说明, 均指查询密集的情况)
      1. 被索引的字段的长度越小, 该索引的效率越高
      2. 被索引的字段中, 值的重复越少, 该索引的效率越高
      3. 查询语句中, 如果使用了 "group" 子句, 根据其中字段出现的先后顺序建立多字段索引
      4. 查询语句中, 如果使用了 "distinct", 根据其中字段出现的先后顺序建立多字段索引
      5. "where" 子句中, 出现对同一表中多个不同字段的 "and" 条件时, 按照字段出现的先后顺序建立多字段索引
      6. "where" 子句中, 出现对同一表中多个不同字段的 "or" 条件时, 对重复值最少的字段建立单字段索引
      7. 进行 "内/外连接" 查询时, 对 "连接字段" 建立索引
      8. 对 "主键" 的 "unique" 索引 毫无意义, 不要使用
      9. 被索引字段尽可能的使用 "NOT NULL" 属性
      10. 对写入密集型表, 尽量减少索引, 尤其是 "多字段索引" 和 "unique" 索引
  2. 查询语句的优化
    1. 多多利用 "explain" 查询索引使用情况, 以便找出最佳的查询语句写法和索引设置方案
    2. 慎用 "select *", 查询时只选出必须字段
    3. 查询使用索引时, 所遍历的索引条数越少, 索引字段长度越小, 查询效率越高 (可使用 "explain" 查询索引使用情况)
    4. 避免使用 mysql 函数对查询结果进行处理, 将这些处理交给客户端程序负责
    5. 使用 "limit" 时候, 尽量使 "limit" 出的部分位于整个结果集的前部, 这样的查询速度更快, 系统资源开销更低
    6. 在 "where" 子句中使用多个字段的 "and" 条件时, 各个字段出现的先后顺序要与多字段索引中的顺序相符
    7. 在 "where" 子句 中使用 "like" 时, 只有当通配符不出现在条件的最左端时才会使用索引
    8. 在 mysql 4.1 以上版本中, 避免使用子查询, 尽量使用 "内/外连接" 实现此功能
    9. 减少函数的使用, 如果可能的话, 尽量用单纯的表达式来代替
    10. 避免在 "where" 子句中, 对不同字段进行 "or" 条件查询, 将其拆分成多个单一字段的查询语句效率更高
Dec 21

在phpMyAdmin2.6以上版本因为支持多语言集,弄得我们使用phpMyAdmin管理数据库的时候,查询出来的中文都是乱码,但是在我们的PHP程序调用时却没有这些问题。
看来是phpMyAdmin2.6的配置有问题了,为了解决这个问题,我上google上搜索了相关资料,这类的问题很多,但没一个可以解决的,真是没办法,看来只有自己动手解决了。

。。。由于查找源代码过程非常烦琐,略

最终花了半天的时间,总算找到了一个比较折衷的方法来解决。

去phpMyAdmin2.6的根目录下,打开以下这个文件:
libraries/select_lang.lib.php
1、找到有"zh-gb2312"的那一行,把'zh-gb2312' 改成 'zh-gb2312-utf-8'
   为什么这样加?那是因为服务器会把没有"-utf-8"的语言过滤掉,在libraries/database_interface.lib.php 第168行,根据英文说:“为了防止混淆”,:<

或者如果不把'zh-gb2312' 改成 'zh-gb2312-utf-8',可以去掉过滤吧。把那个if去掉就OK了。

2、找到"$mysql_charset_map = array("那一行
把'gb2312'       => 'gb2312',
改成 'gb2312'       => 'latin1',

保存,OK,在进入phpMyAdmin管理,选择语言chinese simplified(zh-gb2312-utf-8)
再看看你的那些中文数据。

所以说,我的这个解决办法就只是修改libraries/select_lang.lib.php这一个文件里的两个字就行,比较方便快捷,哈哈。

--------------------------------------------------------------------------

以上是原作者的内容

我反查了

select_lang.lib.php

if (!isset($cfg['AllowAnywhereRecoding']) &line;&line; !$cfg['AllowAnywhereRecoding']) {
    $available_language_files               = $available_languages;
    $available_languages                    = array();
    foreach ($available_language_files AS $tmp_lang => $tmp_lang_data) {
        if (substr($tmp_lang, -5) != 'utf-8') {
            $available_languages[$tmp_lang] = $tmp_lang_data;
        }
    } // end while
    unset($tmp_lang, $tmp_lang_data, $available_language_files);
} // end if

phpmyadmin把没有utf-8的所有编辑都过滤了

分页: 108/119 第一页 上页 103 104 105 106 107 108 109 110 111 112 下页 最后页 [ 显示模式: 摘要 | 列表 ]