Function __global->cns_make_topic

Definitions

sources/cns_topics_action.php

  • Add a topic.This does not create the first post, you need to do an cns_make_post call for that. Conversr allows topics with zero posts.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$forum_id ?AUTO_LINK No No required parameter N/A N/A The ID of the forum the topic will be in (null: Private Topic)
$description SHORT_TEXT No No Blank (empty string) N/A N/A Description of the topic
$emoticon SHORT_TEXT No No Blank (empty string) N/A N/A The theme image code of the emoticon for the topic
$validated ?BINARY No No Null N/A N/A Whether the topic is validated (null: detect whether it should be)
$open BINARY No No 1 N/A N/A Whether the topic is open
$pinned BINARY No No 0 N/A N/A Whether the topic is pinned
$cascading BINARY No No 0 N/A N/A Whether the topic is cascading
$pt_from ?MEMBER No No Null N/A N/A If it is a Private Topic, who is it 'from' (null: not a Private Topic)
$pt_to ?MEMBER No No Null N/A N/A If it is a Private Topic, who is it 'to' (null: not a Private Topic)
$check_perms boolean No No True N/A N/A Whether to check the poster has permissions for the given topic settings
$num_views integer No No 0 N/A N/A The number of times the topic has been viewed
$id ?AUTO_LINK No No Null N/A N/A Force an ID (null: don't force an ID)
$description_link SHORT_TEXT No No Blank (empty string) N/A N/A Link related to the topic (e.g. link to view a ticket).

Returns

  • The ID of the newly created topic
  • Type: AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add a topic.This does not create the first post, you need to do an cns_make_post call for that. Conversr allows topics with zero posts.
 *
 * @param  ?AUTO_LINK $forum_id The ID of the forum the topic will be in (null: Private Topic)
 * @param  SHORT_TEXT $description Description of the topic
 * @param  SHORT_TEXT $emoticon The theme image code of the emoticon for the topic
 * @param  ?BINARY $validated Whether the topic is validated (null: detect whether it should be)
 * @param  BINARY $open Whether the topic is open
 * @param  BINARY $pinned Whether the topic is pinned
 * @param  BINARY $cascading Whether the topic is cascading
 * @param  ?MEMBER $pt_from If it is a Private Topic, who is it 'from' (null: not a Private Topic)
 * @param  ?MEMBER $pt_to If it is a Private Topic, who is it 'to' (null: not a Private Topic)
 * @param  boolean $check_perms Whether to check the poster has permissions for the given topic settings
 * @param  integer $num_views The number of times the topic has been viewed
 * @param  ?AUTO_LINK $id Force an ID (null: don't force an ID)
 * @param  SHORT_TEXT $description_link Link related to the topic (e.g. link to view a ticket).
 * @return AUTO_LINK The ID of the newly created topic
 */

function cns_make_topic(?int $forum_id, string $description = '', string $emoticon = '', ?int $validated = null, int $open = 1, int $pinned = 0, int $cascading = 0, ?int $pt_from = null, ?int $pt_to = null, bool $check_perms = true, int $num_views = 0, ?int $id = null, string $description_link = '') : int