Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[1011]XOOPS 2.5 模組開發」目錄
MarkDown
11-8 上課範例:index.php
1. XOOPS模組開發
2. XOOPS模組基本結構
3. 模組管理後台結構
3-1 上課範例:tad0616.sql
3-2 上課範例:xoops_version.php
3-3 上課範例:admin/menu.php
4. XOOPS的表單Class
4-1 admin/cate.php
5. 分類管理功能
5-1 上課範例:admin/cate.php
6. 修改及前台結構
6-1 上課範例:admin/cate.php
6-2 上課範例:index.php
6-3 上課範例:xoops_version.php
7. 前台自製表單
7-1 上課範例:index.php
7-2 上課範例:class/ckeditor/config.js
8. 強化編輯器及月曆
8-1 上課範例:class/ckeditor/config.js
8-2 上課範例:class/ckeditor/kcfinder/config.php
8-3 上課範例:index.php
9. XOOPS文字過濾
9-1 上課範例:index.php
10. 選單及前台功能
10-1 上課範例:index.php
11. 內建搜尋功能與語系
11-1 上課範例:include/search.php
11-2 上課範例:xoops_version.php
11-3 上課範例:language/tchinese_utf8/modinfo.php
11-4 上課範例:admin/menu.php
11-5 上課範例:language/tchinese_utf8/admin.php
11-6 上課範例:admin/cate.php
11-7 上課範例:language/tchinese_utf8/main.php
11-8 上課範例:index.php
12. 偏好設定與分頁
12-1 上課範例:index.php
12-2 上課範例:function.php
12-3 上課範例:xoops_version.php
13. XOOPS的樣板檔
13-1 上課範例:xoops_version.php
13-2 上課範例:templates/tad_note_index.html
13-3 上課範例:index.php
13-4 上課範例:view.php
13-5 上課範例:include/search.php
13-6 上課範例:templates/tad_note_view.html
14. XOOPS的評論功能
14-1 上課範例:index.php
14-2 上課範例:templates/tad_note_index.html
14-3 上課範例:templates/tad_note_view.html
14-4 上課範例:xoops_version.php
14-5 上課範例:view.php
14-6 上課範例:comment_new.php
14-7 上課範例:themes/school2012/css/itensXoops.css
15. 製作XOOPS區塊
15-1 上課範例:xoops_version.php
15-2 上課範例:blocks/new_notes.php
15-3 上課範例:templates/blocks/new_notes.html
16. 通知功能(上)
16-1 上課範例:index.php
16-2 上課範例:templates/tad_note_index.html
16-3 上課範例:xoops_version.php
16-4 上課範例:include/notification.inc.php
16-5 上課範例:templates/tad_note_view.html
17. XOOPS通知功能(下)
17-1 上課範例:index.php
17-2 上課範例:language/tchinese_utf8/mail_template/new_note.tpl
17-3 上課範例:language/tchinese_utf8/mail_template/new_cate_note.tpl
17-4 上課範例:function.php
17-5 上課範例:admin/cate.php
18. 細部權限及自動功能
18-1 上課範例:admin/menu.php
18-2 上課範例:admin/groupperm.php
18-3 上課範例:view.php
18-4 上課範例:index.php
18-5 上課範例:xoops_version.php
18-6 上課範例:include/onInstall.php
18-7 上課範例:include/onUpdate.php
18-8 上課範例:include/onUninstall.php
12-1 上課範例:index.php
\[1011\]XOOPS 2.5 模組開發 ====================== [](http://www.tad0616.net/uploads/tad_book3/file/1011/12.zip) ### 一、 加入分頁 1. 先將images中的圖檔複製到模組images中。 2. 將language中的語系複製到main.php或admin.php中(若後台也有用到的話)。 3. 在要分頁的頁面(如index.php)引入「分頁物件」的所在檔案,如function.php 4. 在 $sql 與 $xoopsDB->query($sql) 間,原封不動插入以下「加入分頁的程式語法.txt」中的語法 5. new PageBar($total, 20, 10); 的20代表「每頁顯示幾筆資料」,10代表「最多顯示幾個頁數選項」,可以自行修改調整。 6. 在要秀出分頁工具列的地方加入 $bar 即可。 ### 二、 模組偏好設定 1. 偏好設定可以讓您的模組更有彈性一點,而且您不用自己做資料表,就可以把和模組相關的設定值,存到資料庫。 2. 模組若需要偏好設定功能,那麼請加入以下項目(在此常數需要加上引號才正常!): ``` //識別名稱(給程式用的) $modversion['config'][1]['name'] = 'show_num'; //顯示標題 $modversion['config'][1]['title'] = '_MI_NOTE_SHOW_NUM'; //偏好設定的說明 $modversion['config'][1]['description'] = '_MI_NOTE_SHOW_NUM_DSC'; //偏好設定的輸入欄位類型 $modversion['config'][1]['formtype'] = 'select'; //偏好設定的輸入值型態 $modversion['config'][1]['valuetype'] = 'int'; //偏好設定的選項設定 $modversion['config'][1]['options'] = array(5=>5,10=>10,15=>15); //偏好設定的預設值。 $modversion['config'][1]['default'] = 10; ``` 4. 輸入欄位類型其可用的項目有: - (1) 「yesno」是否的單選框 - (2) 「select」下拉選單 - (3) 「select\_multi」可複選的下拉選單 - (4) 「group」群組下拉選單 - (5) 「group\_multi」可複選的群組下拉選單 - (6) 「textbox」文字框 - (7) 「textarea」大量文字框 - (8) 「user」已註冊使用者下拉選單 - (9) 「user\_multi」可複選的已註冊使用者下拉選單 - (10) 「timezone」時區下拉選單 - (11) 「language」語系下拉選單 5. 偏好設定的輸入值型態,其可用的項目有: - (1) 「int」整數: yesno 、group、user - (2) 「float」浮點數 - (3) 「text」一般文字 - (4) 「array」陣列: select\_multi、group\_multi、 user\_multi 6. 偏好設定的選項設定使用陣列寫法,用於有 select 或 select\_multi 時,「5=>5」左邊的5(索引)會顯示在螢幕上,可用文字,右邊的5(值)會存入資料庫。 ### 三、 套用模組偏好設定值 1. 我們做了一個叫做show\_num 的偏好設定,要套用時,就像這樣使用:$xoopsModuleConfig\['show\_num'\] 2. 用$xoopsModuleConfig\['show\_num'\] 取代掉分頁的數量即可。
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
87
人線上 (
11
人在瀏覽
線上書籍
)
會員: 0
訪客: 87
更多…