跳至主內容區

XOOPS輕鬆架

:::

主內容區域

選擇後會自動跳轉頁面

10-1 修改學生看到的所有投稿主題畫面

  1. 修改 op_submission_index.tpl
    <!--投稿主題-->
    <td><a href="<{$smarty.server.PHP_SELF}>?id=<{$data.id}>"><{$data.title}></a><{$data.files}></td>

    將連結改為<{$smarty.server.PHP_SELF}>,其值為$_SERVER['PHP_SELF'],也就是目前網址所執行的檔案,這樣的好處是可以在index.phpsetup.php共用

  2. 修改 index.php 的流程,使學生也能看投稿主題的內容
    //預設動作
    default:
        if (empty($id)) {
            ...略...
        } else {
            $where_arr['id'] = $id;
            Submission::show($where_arr);
            $op = 'submission_show';
        }
        break;

     

  3. 修改 class/Submission.php 中的 get(),加入:
    $data['start_ts'] = \strtotime($data['start']);
    $data['end_ts']   = \strtotime($data['end']);
    $data['now']      = \time();
  4. 修改 templates/op_submission_show.tpl 在下方加入:
    <div class="text-center my-3">
        <{if $now < $start_ts}>
            <div class="fs-1 text-info">尚未開始</div>
        <{elseif $data.now > $data.end_ts}>
            <div class="fs-1 text-muted">已結束</div>
        <{else}>
            <a href="index.php?op=submission_data_create&submission_id=<{$id}>" class="btn btn-primary btn-lg"><i class="fa-solid fa-pen-nib"></i> 我要投稿</a>
        <{/if}>
    </div>
  5. 標題的「回投稿管理列表」連結也請改成環境變數:
    <h1 class="my text-center">
        <a href="<{$smarty.server.PHP_SELF}>" class="text-black-50" data-bs-toggle="tooltip" title="回投稿管理列表">
        <i class="fa-solid fa-turn-up fa-rotate-270"></i>
        </a>
        <{$title}>
    </h1>

     

選擇後會自動跳轉頁面

:::

左邊區域內容

書籍目錄

展開 | 闔起

快速登入


右邊區域內容

請掃此 QR Code 可連至此頁面

計數器

今天: 362362362
昨天: 2727272727272727
總計: 9391117939111793911179391117939111793911179391117

頁尾區域