function entry() { echo "<div class=\"section\">\n"; echo "<h2>쇼앤텔 일정</h2>\n"; $snts = get_schedule(); echo "<ul>\n"; foreach ($snts as $key => $snt) { $t = time_of_when($snt["when"]); echo "<li>" . date('Y-m-d H:i', $t) . " @ " . $snt["where"] . "\n"; echo "<ul>\n"; $date = date('Y-m-d', $t); foreach ($snt["who"] as $id) { echo "<li><a href=\"reg_comment?id={$id}&date={$date}\">" . get_member_name($id) . "</a> "; $filename = gen_talk_data_filename($t, $id); if (file_exists($filename)) { $talk_data = get_talk_data($t, $id); $commenters = $talk_data["commenters"]; if (count($commenters) !== 0) { $commenters = array_map(function ($commenter) { return get_member_name($commenter); }, $commenters); echo "(" . implode(", ", $commenters) . ")"; } } echo "</li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; echo "</div>\n"; }
function put_talk_data($t, $id, $talk_data) { $filename = gen_talk_data_filename($t, $id); return json_put_contents($filename, $talk_data); }