:::

5-5-2 加入分頁工具

您沒有觀看影片的權限

您沒有觀看影片的權限

請先登入,登入後,確認您的權限後,即可觀看影片。

  1. 修改 class\Club_apply.php 加入分頁語法(https://www.tad0616.net/modules/tad_book3/page.php?tbsn=15&tbdsn=1710),並套用偏好設定
    //取得所有資料陣列
    public static function get_all($only_enable = true, $auto_key = false)
    {
        global $xoopsDB, $xoopsModuleConfig, $xoopsTpl;
        $myts = \MyTextSanitizer::getInstance();
    
        $and_enable = $only_enable ? "and `enable` = '1' and `action_date` >= now()" : '';
    
        $sql = "select * from `" . $xoopsDB->prefix("tad_signup_actions") . "` where 1 $and_enable";
    
        if (!$_SESSION['api_mode']) {
            //Utility::getPageBar($原sql語法, 每頁顯示幾筆資料, 最多顯示幾個頁數選項);
            $PageBar = Utility::getPageBar($sql, $xoopsModuleConfig['show_number'], 10);
            $bar = $PageBar['bar'];
            $sql = $PageBar['sql'];
            $total = $PageBar['total'];
            $xoopsTpl->assign('bar', $bar);
            $xoopsTpl->assign('total', $total);
        }
    
        $result = $xoopsDB->query($sql) or Utility::web_error($sql, __FILE__, __LINE__);
        /*--略--*/
        return $data_arr;
    }

     

  2. 最後修改 templates\op_tad_signup_actions_index.tpl ,加入分頁標籤即可:
    <h2 class="my">活動列表</h2>
    
    <table class="table table-light table-bordered">
        <!--略-->
    </table>
    
    <{$bar}>
    
    <{if $can_add}>
        <!--略-->
    <{/if}>

     

link to https://github.com/tadlearn/tad_signup/commit/f68fd764fffcd9e021f75607343c3d224e9cd186 \


:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D48%26tbdsn%3D1701

書籍目錄

展開 | 闔起

線上使用者

34人線上 (11人在瀏覽線上書籍)

會員: 0

訪客: 34

更多…