public function createForumPost($topicID, $authorID, $post, $extra = [])
    {
        $data = ["topic" => $topicID, "author" => $authorID, "post" => $post];
        $data = array_merge($data, $extra);

        $validator = \Validator::make($data, [
            "topic"       => "required|numeric",
            "author"      => "required|numeric",
            "post"        => "required|string",
            "author_name" => "required_if:author,0|string",
            "date"        => "date_format:YYYY-mm-dd H:i:s",
            "ip_address"  => "ip",
            "hidden"      => "in:-1,0,1",
        ]);

        if ($validator->fails()) {
            $message = head(array_flatten($validator->messages()));
            throw new Exceptions\InvalidFormat($message);
        }

        return $this->postRequest("forums/posts", $data);
    }
public function createForumPost($topicID, $authorID, $post, $extra = [])
    {
        $data = ["topic" => $topicID, "author" => $authorID, "post" => $post];
        $data = array_merge($data, $extra);

        $validator = \Validator::make($data, [
            "topic"       => "required|numeric",
            "author"      => "required|numeric",
            "post"        => "required|string",
            "author_name" => "required_if:author,0|string",
            "date"        => "date_format:YYYY-mm-dd H:i:s",
            "ip_address"  => "ip",
            "hidden"      => "in:-1,0,1",
        ]);

        if ($validator->fails()) {
            $message = head(array_flatten($validator->messages()));
            throw new Exceptions\InvalidFormat($message);
        }

        return $this->postRequest("forums/posts", $data);
    }
public function createForumPost ( $ topicID , $ authorID , $ post , $ extra = [ ] ) { $ data = [ "topic" => $ topicID , "author" => $ authorID , "post" => $ post ] ; $ data = array_merge ( $ data , $ extra ) ; $ validator = \ Validator :: make ( $ data , [ "topic" => "required|numeric" , "author" => "required|numeric" , "post" => "required|string" , "author_name" => "required_if:author,0|string" , "date" => "date_format:YYYY-mm-dd H:i:s" , "ip_address" => "ip" , "hidden" => "in:-1,0,1" , ] ) ; if ( $ validator -> fails ( ) ) { $ message = head ( array_flatten ( $ validator -> messages ( ) ) ) ; throw new Exceptions \ InvalidFormat ( $ message ) ; } return $ this -> postRequest ( "forums/posts" , $ data ) ; }
Create a forum post with the given data.

@param integer $topicID  The ID of the topic to add the post to.
@param integer $authorID The ID of the author for the post (if set to 0, author_name is used)
@param string $post      The HTML content of the post.
@param array $extra

@return mixed
@throws Exceptions\InvalidFormat
@throws Exceptions\IpboardMemberEmailExists
@throws Exceptions\IpboardMemberInvalidGroup
@throws Exceptions\IpboardMemberUsernameExists
@throws IpboardInvalidApiKey
@throws IpboardMemberIdInvalid
@throws IpboardThrottled
@throws \Exception
Create a forum post with the given data .