function set_data($snt, $commenter_info) { $t = time_of_when($snt["when"]); foreach ($commenter_info as $speaker => $commenters) { $contents = get_talk_data_or_gen($t, $speaker); $contents["commenters"] = $commenters; if (!put_talk_data($t, $speaker, $contents)) { exit(1); } } }
function reg() { $id = get_valid_id($_REQUEST["id"]); $date = get_valid_date($_REQUEST["date"]); $t = strtotime($date); $talk_data = get_talk_data_or_gen($t, $id); if (file_exists(gen_memo_filename($t, $id))) { $memo_filename = date('ymd', $t) . "_{$id}.pdf"; $link = "http://ropas.snu.ac.kr/snt_memo2/" . $memo_filename; $memo = "<a href=\"" . $link . "\">" . $memo_filename . "</a>"; } else { $memo = "등록된 메모가 없습니다."; } $arr = array("ID" => $id, "NAME" => get_member_name($id), "WHEN" => $date, "TITLE" => htmlspecialchars($talk_data["title"]), "ABSTRACT" => htmlspecialchars($talk_data["abstract"]), "MEMO" => $memo); echo replace(__ROOT__ . "/template/reg_abstract.temp", $arr); }
function reg_comment(&$ret_url) { echo "<p>코멘트를 등록합니다.</p>\n"; $id = get_valid_id($_REQUEST["id"]); $when = get_valid_time($_REQUEST["when"]); $t = strtotime($when); $ret_url = "reg_comment?id=" . $id . "&date=" . date('Y-m-d', $t); $comment = $_REQUEST["comment"]; if ($comment === "") { echo "<p>빈 코멘트입니다.</p>\n"; return false; } else { $talk_data = get_talk_data_or_gen($t, $id); $comments = $talk_data["comments"]; array_push($comments, $comment); $talk_data["comments"] = $comments; return put_talk_data($t, $id, $talk_data); } }