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); } }
<?php if (!defined('__ROOT__')) { define('__ROOT__', realpath(dirname(dirname(__FILE__)))); } require_once __ROOT__ . "/lib/log.php"; require_once __ROOT__ . "/lib/read_data.php"; require_once __ROOT__ . "/lib/replace.php"; require_once __ROOT__ . "/lib/schedule.php"; require_once __ROOT__ . "/lib/send_mail.php"; require_once __ROOT__ . "/lib/comment.php"; require_once __ROOT__ . "/lib/validate_input.php"; $title = "코멘트 보기"; require __ROOT__ . '/template/header_noback.temp'; $id = get_valid_id($_REQUEST["id"]); $t = strtotime(get_valid_date($_REQUEST["date"])); if ($id !== NULL) { echo gen_comment_msg($t, $id); } require __ROOT__ . '/template/footer.temp';