} elseif ($task == 'add_comment') { $action_id = isset($_POST['action_id']) ? (int) $_POST['action_id'] : 0; $text = isset($_POST['text']) ? trim($_POST['text']) : ''; if (strlen($text) > 1000) { $result = array('result' => 0, 'message' => SE_Language::get(690706058)); } elseif ($comment_id = he_wall::add_comment($user->user_info['user_id'], $action_id, $text)) { $comment_info = he_wall::get_comment($comment_id); $comment_info['text'] = he_wall_format_text($comment_info['text']); he_wall::new_comment_notify($action_id); $result = array('result' => 1, 'comment_info' => $comment_info); } else { $result = array('result' => 0, 'message' => 'Error'); } } elseif ($task == 'delete_comment') { $comment_id = isset($_POST['comment_id']) ? (int) $_POST['comment_id'] : 0; $result = he_wall::delete_comment($comment_id, $user->user_info['user_id']); } elseif ($task == 'show_more') { $last_action_id = isset($_POST['last_action_id']) ? (int) $_POST['last_action_id'] : false; $result = he_wall_actions_display($wall_object, $wall_object_id, false, $last_action_id); } elseif ($task == 'post_action') { $first_action_id = isset($_POST['first_action_id']) ? (int) $_POST['first_action_id'] : false; $action_privacy_level = isset($_POST['action_privacy_level']) ? (int) $_POST['action_privacy_level'] : 63; $text = isset($_POST['text']) ? trim($_POST['text']) : ''; $new_action_id = he_wall::new_action_id(); $text = he_wall_format_text($text); if (!$user->user_exists || !$text) { return false; } $replace_arr = array($user->user_info['user_username'], $user->user_displayname, $text, he_wall::get_wall_link($wall_object, $wall_object_id)); $actions->actions_add($user, 'wallpost', $replace_arr, array(), 0, false, $action_object_owner, $wall_object_id, $action_privacy_level); he_wall::new_post_notify($wall_object, $wall_object_id, $new_action_id);