Jill 筆記
:::
:::
所有書籍
「Xoops新物件寫法」目錄
MarkDown
2. 列出所有活動
1. 前置作業
1-1 流程
2. 列出所有活動
3. 新增活動表單
3-1 新增到資料庫
3-2 編輯活動表單
4. 刪除活動
5. 修改前台首頁
3-1 新增到資料庫
Xoops新物件寫法 ========== http://localhost/modules/ck\_signup/admin/main.php?op=actions\_form 1. [action/AdminAction.class.php](https://github.com/tnjaile/ck_signup/commit/491508962d22306e5a7cfb0bc9a23f01cff3c65a#diff-0ece6698acedde7d0cebc5f0184eee02 "action/AdminAction.class.php") ```php // 新增 public function actions_form() { $this->_tpl->assign('now_op', "actions_form"); $this->_tpl->assign('action', $_SERVER['PHP_SELF']); } ``` 2. [templates/op\_actions\_form.tpl](https://github.com/tnjaile/ck_signup/commit/491508962d22306e5a7cfb0bc9a23f01cff3c65a#diff-d369f31e3b6c321cd55704cc89c314fb "templates/op_actions_form.tpl") ```smarty
<{$smarty.const._MD_CKSIGNUP_TITLE}>
<{$smarty.const._MD_CKSIGNUP_CONTENT}>
<{$content_editor}>
<{$smarty.const._MD_CKSIGNUP_ACTION_DATE}>
<{$smarty.const._MD_CKSIGNUP_END_DATE}>
<{$smarty.const._MD_CKSIGNUP_ENABLE}>
checked="checked"<{/if}>>
是
checked="checked"<{/if}>>
否
<{$token_form}>
``` 3. [language/tchinese\_utf8/admin.php](https://github.com/tnjaile/ck_signup/commit/491508962d22306e5a7cfb0bc9a23f01cff3c65a#diff-59889c76951a8a5422cab626c977844d "language/tchinese_utf8/admin.php") ```php define('_MD_CKSIGNUP_ACTION_ID', '活動編號'); define('_MD_CKSIGNUP_TITLE', '活動名稱'); define('_MD_CKSIGNUP_CONTENT', '活動說明'); define('_MD_CKSIGNUP_ACTION_DATE', '活動日期'); define('_MD_CKSIGNUP_END_DATE', '報名截止日'); define('_MD_CKSIGNUP_UID', '發布者編號'); define('_MD_CKSIGNUP_ENABLE', '是否啟用'); ``` 4. 畫面 ![](http://120.115.2.101/~jaile/uploads/tad_book3/image/jillbase04.png)