function addPost() { global $current_user; if (!$current_user->id) { return; } $body = isset(Request::$post['body']) ? Request::$post['body'] : false; $subject = isset(Request::$post['subject']) ? Request::$post['subject'] : false; $body = prepare_review($body); $subject = prepare_review($subject, ''); if (!$body) { throw new Exception('post body missed'); } if ($body) { $event = new Event(); $event->event_PostAdd($current_user->id, $body, $subject); $event->push(); ob_end_clean(); header('Location: ' . Config::need('www_path') . '/me/wall/self'); exit; } }