From f0a30cc89ddf82e3c774800d24f0ea3664065d9c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 8 May 2008 22:16:04 -0400 Subject: read-only stuff darcs-hash:20080509021604-84dde-f785fc09dd435fc12741b3a75184e2425721d03d.gz --- actions/shownotice.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 actions/shownotice.php (limited to 'actions/shownotice.php') diff --git a/actions/shownotice.php b/actions/shownotice.php new file mode 100644 index 000000000..4d4876122 --- /dev/null +++ b/actions/shownotice.php @@ -0,0 +1,45 @@ +arg('notice'); + $notice = Notice::staticGet($id); + + if (!$notice) { + $this->no_such_notice(); + } + + if (!$notice->getProfile()) { + $this->no_such_notice(); + } + + # Looks like we're good; show the header + + common_show_header($profile->nickname); + + $this->show_notice($notice); + + common_show_footer(); + } + + function no_such_notice() { + common_user_error('No such notice.'); + } + + function show_notice($notice) { + $profile = $notice->getProfile(); + # XXX: RDFa + common_start_element('div', array('class' => 'notice')); + # FIXME: add the avatar + common_start_element('a', array('href' => $profile->profileurl, + 'class' => 'nickname'), + $profile->nickname); + # FIXME: URL, image, video, audio + common_element('span', array('class' => 'content'), $notice->content); + common_element('span', array('class' => 'date'), + common_date_string($notice->created)); + common_end_element('div'); + } +} -- cgit v1.2.3-54-g00ecf