+ $notice->rendered = common_render_content($notice->content, $notice);
+
+ $id = $notice->insert();
+
+ if (!$id) {
+ common_server_error(_('Problem saving notice.'));
+ return;
+ }
+
+ $orig = clone($notice);
+ $notice->uri = common_notice_uri($notice);
+
+ if (!$notice->update($orig)) {
+ common_server_error(_('Problem saving notice.'));
+ return;
+ }
+
+ common_save_replies($notice);
+ common_broadcast_notice($notice);
+
+ $returnto = $this->trimmed('returnto');
+ if ($returnto) {
+ $url = common_local_url($returnto,
+ array('nickname' => $user->nickname));
+ } else {
+ $url = common_local_url('shownotice',
+ array('notice' => $id));
+ }
+ common_redirect($url, 303);
+ }
+
+ function show_top($content=NULL) {
+ common_notice_form(NULL, $content);