:::

16. 分頁與編輯器

一、 分頁物件用法

  1. 引入該物件:require_once "pagebar.php";
  2. 將以下語法,插入到 $sql 與 mysql_query() 之間。
  3. //PageBar(資料數, 每頁顯示幾筆資料, 最多顯示幾個頁數選項);
    mysql_query($sql);
    $total=mysql_affected_rows();
    $navbar = new PageBar($total, 20, 10);
    $mybar = $navbar->makeBar();
    $bar= "<p align='center'>{$mybar['left']}{$mybar['center']}{$mybar['right']}</p>";
    $sql.=$mybar['sql'];
  4. 「$bar」即分頁工具,將之擺至適當位置即可。

二、 所見即所得編輯器 CKEditor 用法(http://ckeditor.com/

  1. 方法一:
  2. <script type='text/javascript' src='ckeditor/ckeditor.js'></script>
    <textarea name='content'  class='ckeditor'>
  3. 方法二:
  4. <script type='text/javascript' src='ckeditor/ckeditor.js'></script>
    <textarea name='content' cols=30 rows=5 id='editor'>請輸入內容</textarea>
    <script type='text/javascript'>
      CKEDITOR.replace('editor' , { skin : 'v2' , toolbar : 'Basic' } );
    </script>
  5. 自行定義工具列:http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar
  6. 例如(config,js):
CKEDITOR.editorConfig = function( config )
{
    config.toolbar = 'MyToolbar';
    config.toolbar_MyToolbar =
    [
       { name: 'clipboard', items : [ 'Undo','Redo' ] },
        { name: 'insert', items : [ 'Image' , 'Flash' , 'Table' , 'HorizontalRule' , 'Smiley' , 'PageBreak' ] },
        { name: 'basicstyles', items : [ 'Bold' , 'Italic' , 'Strike' , 'RemoveFormat' ] },
        { name: 'paragraph', items : [ 'NumberedList' , 'BulletedList' , 'Outdent' , 'Indent'] },
        { name: 'links', items : [ 'Link' , 'Unlink' ] },
        { name: 'styles', items : [ 'Styles' , 'Format' ] },
        { name: 'tools', items : [ 'Font' , 'FontSize' ] }
    ];
};

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D20%26tbdsn%3D577

書籍目錄

展開 | 闔起

線上使用者

35人線上 (9人在瀏覽線上書籍)

會員: 0

訪客: 35

更多…