Example #1
0
function gen_msg($snt)
{
    $names = array_map(function ($id) {
        return get_member_name($id);
    }, $snt["who"]);
    $talk_time = time_of_when($snt["when"]);
    $abs_time = mktime(23, 59, 0, $snt["when"]["month"], $snt["when"]["day"] - 7, $snt["when"]["year"]);
    $memo_time = mktime(9, 0, 0, $snt["when"]["month"], $snt["when"]["day"] - 2, $snt["when"]["year"]);
    $msg = replace(__ROOT__ . "/template/remind.temp", array("names" => implode(', ', $names), "talk_time" => date('Y-m-d', $talk_time), "abs_time" => date('Y-m-d H:i', $abs_time), "memo_time" => date('Y-m-d H:i', $memo_time)));
    return $msg;
}
Example #2
0
function gen_talk_msg($is_fst, $t, $where, $who)
{
    $talk = get_talk_data($t, $who);
    if ($is_fst) {
        $pdf = "";
    } else {
        $date = date('ymd', $t);
        $pdf = "http://ropas.snu.ac.kr/snt_memo2/{$date}_{$who}.pdf";
    }
    $src = array("TITLE" => $talk["title"], "SPEAKER" => get_member_name($who), "TIME" => date('M j (D)', $t) . " at " . date('H:i', $t), "WHERE" => $where, "ABSTRACT" => $talk["abstract"], "PDF" => $pdf);
    return replace(__ROOT__ . "/template/notice.temp", $src);
}
Example #3
0
function gen_msg($snt, $commenter_info)
{
    $talk_time = time_of_when($snt["when"]);
    $comment_time = mktime(18, 0, 0, $snt["when"]["month"], $snt["when"]["day"] - 1, $snt["when"]["year"]);
    $commenters_msg = "";
    foreach ($commenter_info as $speaker => $commenters) {
        $speaker_name = get_member_name($speaker);
        $commenters_name = array_map("get_member_name", $commenters);
        $commenters_msg .= $speaker_name . ": " . implode(", ", $commenters_name) . "\n";
    }
    $msg = replace(__ROOT__ . "/template/commenter.temp", array("talk_time" => date("Y-m-d H:i", $talk_time), "comment_time" => date("Y-m-d H:i", $comment_time), "chair_info" => get_member_name($snt["chair"]), "commenter_info" => $commenters_msg));
    return $msg;
}
Example #4
0
function run_talk($snt, $n, $t, $id)
{
    $talk_data = get_talk_data($t, $id);
    if (get_member_lab($id) === "ropas") {
        $who = "<r:who member=\"" . $id . "\"/>";
    } else {
        $who = "<r:who>" . get_member_name($id) . "</r:who>";
    }
    $src = array("TITLE" => htmlspecialchars($talk_data["title"]), "WHO" => $who, "WHEN" => date(DATE_ATOM, $t), "WHERE" => $snt["where"], "ABSTRACT" => htmlspecialchars($talk_data["abstract"]), "SLIDES_FILENAME" => date('md', $t) . "_" . $n . ".pdf", "MEMO_FILENAME" => date('ymd', $t) . "_" . $id . ".pdf", "ID" => $id, "DATE" => date('Y-m-d', $t));
    $temp_filename = __ROOT__ . "/template/xml.temp";
    $msg = replace($temp_filename, $src);
    $filename = __ROOT__ . "/talk_root/" . date('Y', $t) . "/" . date('md', $t) . "_" . $n . ".xml";
    if (!my_file_put_contents($filename, $msg)) {
        exit(1);
    }
}
Example #5
0
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);
}
Example #6
0
    }
    echo "</li>\n";
}
echo "</ul>\n";
?>

</div>

<div class="section">
<h2>쇼앤텔 일정</h2>

<?php 
$snts = get_schedule();
echo "<ul>\n";
foreach ($snts as $key => $snt) {
    echo "<li>" . date('Y-m-d H:i', time_of_when($snt["when"])) . " @ " . $snt["where"] . "<br>\n";
    echo "의장: " . get_member_name($snt["chair"]) . "\n";
    echo "<ul>\n";
    foreach ($snt["who"] as $id) {
        echo "<li>" . get_member_name($id) . "</li>\n";
    }
    echo "</ul>\n";
    echo "</li>\n";
}
echo "</ul>\n";
?>

</div>

<?php 
require __ROOT__ . '/template/footer.temp';
Example #7
0
function get_commenters_today()
{
    $cmtrs_all = array();
    $t = time();
    $filename = __ROOT__ . "/data/" . date('ymd', $t) . "_speaker.json";
    if (file_exists($filename)) {
        $talks = json_get_contents($filename);
        foreach ($talks as $talk) {
            $cmtrs_of_talk = array();
            foreach ($talk["speakers"] as $id) {
                $talk_data = get_talk_data($t, $id);
                $cmtrs_of_talk[get_member_name($id)] = array_map("get_member_name", $talk_data["commenters"]);
            }
            $chair_cmtrs = array("chair" => get_member_name($talk["chair"]), "commenters" => $cmtrs_of_talk);
            array_push($cmtrs_all, $chair_cmtrs);
        }
    }
    return $cmtrs_all;
}
Example #8
0
function html_of_speaker($speaker)
{
    $name = get_member_name($speaker);
    return "<h1 style=\"font-size: 1.5em;\">Comments for {$name}</h1>";
}
}
?>
    data-id="<?php 
echo $current_member->ID;
?>
">

    <div class="membercard__avatar">
        <?php 
echo show_avatar($current_member, 'avatar');
?>
    </div>
    <div class="membercard__info">
        <h5 class="membercard__name noWrap">
            <?php 
echo get_member_name($current_member);
?>
        </h5>
        <div class="membercard__status">
            <?php 
show_membership_status($current_member);
?>
        </div>
        <div class="membercard__fullProfile"></div>
    </div>

    <div class="membercard__counter">
        <div class="counter" id="finished">
            <a class="link" href="<?php 
echo get_author_posts_url($current_member->ID, $current_member->user_nicename);
?>