:::

6-3-2 建立「活動報名焦點」區塊的樣板

您沒有觀看影片的權限

您沒有觀看影片的權限

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

  1. 建立 templates\blocks\action_signup.tpl,如:
    <h2 class="my">
        <{if $block.enable && $block.number > $block.signup|@count && $block.end_date|strtotime >= $smarty.now}>
            <i class="fa fa-check text-success" aria-hidden="true"></i>
        <{else}>
            <i class="fa fa-times text-danger" aria-hidden="true"></i>
        <{/if}>
        <{$block.title}>
    </h2>
    
    <div class="alert alert-info">
        <{$block.detail}>
    </div>
    
    <h4 class="my">
        <small>
            <div><i class="fa fa-calendar" aria-hidden="true"></i> 活動日期:<{$block.action_date|substr:0:-3}></div>
            <div><i class="fa fa-calendar-check-o" aria-hidden="true"></i> 報名截止:<{$block.end_date|substr:0:-3}></div>
            <div><i class="fa fa-users" aria-hidden="true"></i> 報名狀況:<{$block.signup|@count}>/<{$block.number}></div>
        </small>
    </h4>
    
    <div class="text-center my-3">
        <a href="<{$xoops_url}>/modules/tad_signup/index.php?op=tad_signup_data_create&action_id=<{$block.id}>" class="btn btn-lg btn-info <{if !($block.enable && $block.number > $block.signup|@count && $xoops_isuser && $block.end_date|strtotime >= $smarty.now)}>disabled<{/if}>"><i class="fa fa-plus" aria-hidden="true"></i> 立即報名</a>
    </div>

     

  2. 欲取得報名人數,故修改 blocks\action_signup.phpaction_signup()
    // 活動報名焦點
    function action_signup($options)
    {
        $block = Tad_signup_actions::get($options[0], true);
        $block['signup'] = Tad_signup_data::get_all($options[0], null, true);
        return $block;
    }

     

  3. 至此可更新模組並安裝區塊

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


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1732%26tbsn%3D48

書籍目錄

展開 | 闔起

線上使用者

57人線上 (16人在瀏覽線上書籍)

會員: 0

訪客: 57

更多…