Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[1011]XOOPS 2.5 模組開發」目錄
MarkDown
9-1 上課範例: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
10-1 上課範例:index.php
\[1011\]XOOPS 2.5 模組開發 ====================== [](http://www.tad0616.net/uploads/tad_book3/file/1011/10.pdf) ### 一、 做個漂亮選單
1. 請到該站,選擇「Horizontal CSS Menus」選一個喜歡的選單。 2. 點選「Customize」,並開始輸入想要的連結。設好後按「Preview Menu」即可。 3. 接著輸入Email,他便會把選單用zip寄到指定信箱。收到後,解開zip檔,然後將menu資料夾複製到模組中,接著開啟installation\_instruction.html,依照上面指示,將相關語法加到模組中(echo 出主內容之前即可),記得修改一下路徑,如: echo '<link rel="stylesheet" href="menu/menu\_style.css" type="text/css" /> <ul id="menu"> <li><a href="index.php" title="所有文章" class="current">所有文章</a></li> <li><a href="index.php?op=add\_form" title="新文章">新文章</a></li> </ul>'; ### 二、 用$\_SERVER\["REQUEST\_URI"\]來抓取現在的執行程式 1. 為了讓class="current"有作用,所以我們利用$\_SERVER\["REQUEST\_URI"\]來抓取現在的執行程式,並比對其位置。 $current1=$\_SERVER\["REQUEST\_URI"\]=='/modules/tad\_note/index.php'?"class='current'":""; $current2=$\_SERVER\["REQUEST\_URI"\]=='/modules/tad\_note/index.php?op=add\_form'?"class='current'":""; 2. 並把$current1和$current2分別放到對應的連結中即可。 ### 三、 刪除功能 1. 先修改秀出列表的函數,並加入刪除及修改的連結(op),並設定相對的流程控制。 2. 讓只給作者看見工具列,先抓uid:$uid=$xoopsUser?$xoopsUser->uid():0; 3. 迴圈裡加入:$tool=($doc\['uid'\]==$uid)?"<a href='index.php?op=del¬e\_sn={$doc\['note\_sn'\]}'>刪除</a>|<a href='index.php?op=modify¬e\_sn={$doc\['note\_sn'\]}'>修改</a>":""; 4. $sql="delete from ".$xoopsDB->prefix("tad\_notes")." where note\_sn='$note\_sn'"; ### 四、 修改功能 1. 傳編號進表單函數(有編號就是修改):add\_form($note\_sn=null) 2. 若有編號,則先抓取舊資料:$sql="select \* from ".$xoopsDB->prefix("tad\_notes")." where note\_sn='$note\_sn'"; 3. 把抓到的資料塞入欄位的預設值: - (1) 選單:$selected=($doc\['cate\_sn'\]==$cate\['cate\_sn'\])?"selected":""; - (2) 大量文字框:<textarea 略>{$doc\['note\_content'\]}</textarea> - (3) 原本就有預設值的:$note\_date=empty($note\_sn)?date("Y-m-d H:i:s"):$doc\['note\_date'\]; - (4) 單選:$note\_public1=($doc\['note\_public'\]==1)?"checked":"" - $note\_public0=($doc\['note\_public'\]==0)?"checked":""; 4. 最後記得加上隱藏欄位,並將編號帶入。
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
86
人線上 (
29
人在瀏覽
線上書籍
)
會員: 0
訪客: 86
更多…