Function __global->cns_validate_post

Definitions

sources/cns_posts_action3.php

  • Validate a post.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$post_id AUTO_LINK No No required parameter N/A N/A The ID of the post
$topic_id ?AUTO_LINK No No Null N/A N/A The ID of the topic that contains the post (null: find out from the DB)
$forum_id ?AUTO_LINK No No Null N/A N/A The forum that the topic containing the post is in (null: find out from the DB)
$poster ?MEMBER No No Null N/A N/A The member that made the post being validated (null: find out from the DB)
$post ?LONG_TEXT No No Null N/A N/A The post, in Comcode format (null: It'll have to be looked-up)

Returns

  • The ID of the topic (while this could be known without calling this function, as we've gone to effort and grabbed it from the DB, it might turn out useful for something)
  • Type: AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Validate a post.
 *
 * @param  AUTO_LINK $post_id The ID of the post
 * @param  ?AUTO_LINK $topic_id The ID of the topic that contains the post (null: find out from the DB)
 * @param  ?AUTO_LINK $forum_id The forum that the topic containing the post is in (null: find out from the DB)
 * @param  ?MEMBER $poster The member that made the post being validated (null: find out from the DB)
 * @param  ?LONG_TEXT $post The post, in Comcode format (null: It'll have to be looked-up)
 * @return AUTO_LINK The ID of the topic (while this could be known without calling this function, as we've gone to effort and grabbed it from the DB, it might turn out useful for something)
 */

function cns_validate_post(int $post_id, ?int $topic_id = null, ?int $forum_id = null, ?int $poster = null, ?string $post = null) : int