6-2-2
                        套用區塊設定值
                    
                
                                                            
                             
                            
                                
                                    您沒有觀看影片的權限
                                    請先登入,登入後,確認您的權限後,即可觀看影片。
                                 
                             
                         
                                                    
	- 套用設定值
	
// 可報名活動一覽
function action_list($options)
{
    $block = Tad_signup_actions::get_all(true, false, $options[0], $options[1]);
    return $block;
}
   
- get_all()需要能夠設定欲顯示數量,還有排序方式,故需多加兩個參數
- 此外,為了讓前後臺一致,目前前台判斷現在大於截止日,就是無法報名,但php部份卻是以活動日期為主,如此容易引起誤會,故修改之
	
//取得所有資料陣列
public static function get_all($only_enable = true, $auto_key = false, $show_number = 20, $order = ",`action_date` desc")
{
    /*--略--*/
    $and_enable = $only_enable ? "and `enable` = '1' and `end_date` >= now() " : '';
    $sql = "select * from `" . $xoopsDB->prefix("tad_signup_actions") . "` where 1 $and_enable order by `enable` $order";
    /*--略--*/
    //Utility::getPageBar($原sql語法, 每頁顯示幾筆資料, 最多顯示幾個頁數選項);
    $PageBar = Utility::getPageBar($sql, $show_number, 10);
    /*--略--*/
}
   
- 搜尋有用到 get_all()方法的,視情況調整,如:class\Tad_signup_actions.php的index()
//列出所有資料
public static function index($only_enable = true)
{
    global $xoopsTpl, $xoopsUser, $xoopsModuleConfig;
    $all_data = self::get_all($only_enable, false, $xoopsModuleConfig['show_number']);
    /*--略--*/
}
   
 link to  https://github.com/tadlearn/tad_signup/commit/1239f09fdd7ea2d316afc51de4a717a415777970 \
link to  https://github.com/tadlearn/tad_signup/commit/1239f09fdd7ea2d316afc51de4a717a415777970 \