:::

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>

     


:::

書籍目錄

展開 | 闔起

快速登入


https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D2084%26tbsn%3D56

計數器

今天: 812812812
昨天: 1856185618561856
總計: 8776736877673687767368776736877673687767368776736