Function __global->cns_make_forum

Definitions

sources/cns_forums_action.php

  • Make a forum.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name SHORT_TEXT No No required parameter N/A N/A The name of the forum
$description SHORT_TEXT No No required parameter N/A N/A The description for the forum
$forum_grouping_id ?AUTO_LINK No No required parameter N/A N/A What forum grouping the forum will be filed with (null: this is the root forum)
$access_mapping ?array No No required parameter N/A N/A Permission map (null: do it the standard way, outside of this function). This parameter is for import/compatibility only and works upon an emulation of 'access levels', and it is recommended to use the normal crud_module functionality for permissions setting.
$parent_forum ?AUTO_LINK No No required parameter N/A N/A The ID of the parent forum (null: this is the root forum)
$position integer No No 1 N/A N/A The position of this forum relative to other forums viewable on the same screen (if parent forum hasn't specified automatic ordering)
$post_count_increment BINARY No No 1 N/A N/A Whether post counts will be incremented if members post in the forum
$order_sub_alpha BINARY No No 0 N/A N/A Whether the ordering of subforums is done automatically, alphabetically)
$intro_question LONG_TEXT No No Blank (empty string) N/A N/A The question that is shown for newbies to the forum (blank: none)
$intro_answer SHORT_TEXT No No Blank (empty string) N/A N/A The answer to the question (blank: no specific answer.. if there's a 'question', it just requires a click-through).
$redirection SHORT_TEXT No No Blank (empty string) N/A N/A Either blank for no redirection, the ID of another forum we are mirroring, or a URL to redirect to
$order ID_TEXT No No last_post N/A N/A The order the topics are shown in, by default
$is_threaded BINARY No No 0 N/A N/A Whether the forum is threaded
$allows_anonymous_posts BINARY No No 0 N/A N/A Whether anonymous posts are allowed
$mail_email_address EMAIL No No Blank (empty string) N/A N/A Mailing list e-mail address (blank: not set / use centrally configured)
$mail_server_type SHORT_TEXT No No Blank (empty string) imap imaps imaps_nocert imapt imapt_nocert pop3 pop3s pop3s_nocert pop3t pop3t_nocert N/A Mailing list server type (blank: not set / use centrally configured)
$mail_server_host SHORT_TEXT No No Blank (empty string) N/A N/A Mailing list server host (blank: not set / use centrally configured)
$mail_server_port ?integer No No Null N/A N/A Mailing list server port (null: not set / use centrally configured)
$mail_folder SHORT_TEXT No No Blank (empty string) N/A N/A Mailing list folder (blank: not set)
$mail_username SHORT_TEXT No No Blank (empty string) N/A N/A Mailing list username (blank: not set)
$mail_password SHORT_TEXT No No Blank (empty string) N/A N/A Mailing list password (blank: not set / use centrally configured)
$mail_nonmatch_policy ID_TEXT No No post_as_guest block post_as_guest create_account N/A Mailing list policy for non-matched users
$mail_unconfirmed_notice BINARY No No 1 N/A N/A Mailing list policy: whether to highlight that members are not fully confirmed
$poll_default_options_xml LONG_TEXT No No Blank (empty string) N/A N/A XML which defines enforced options for polls within this forum

Returns

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

Preview

Code (PHP)

/**
 * Make a forum.
 *
 * @param  SHORT_TEXT $name The name of the forum
 * @param  SHORT_TEXT $description The description for the forum
 * @param  ?AUTO_LINK $forum_grouping_id What forum grouping the forum will be filed with (null: this is the root forum)
 * @param  ?array $access_mapping Permission map (null: do it the standard way, outside of this function). This parameter is for import/compatibility only and works upon an emulation of 'access levels', and it is recommended to use the normal crud_module functionality for permissions setting.
 * @param  ?AUTO_LINK $parent_forum The ID of the parent forum (null: this is the root forum)
 * @param  integer $position The position of this forum relative to other forums viewable on the same screen (if parent forum hasn't specified automatic ordering)
 * @param  BINARY $post_count_increment Whether post counts will be incremented if members post in the forum
 * @param  BINARY $order_sub_alpha Whether the ordering of subforums is done automatically, alphabetically)
 * @param  LONG_TEXT $intro_question The question that is shown for newbies to the forum (blank: none)
 * @param  SHORT_TEXT $intro_answer The answer to the question (blank: no specific answer.. if there's a 'question', it just requires a click-through).
 * @param  SHORT_TEXT $redirection Either blank for no redirection, the ID of another forum we are mirroring, or a URL to redirect to
 * @param  ID_TEXT $order The order the topics are shown in, by default
 * @param  BINARY $is_threaded Whether the forum is threaded
 * @param  BINARY $allows_anonymous_posts Whether anonymous posts are allowed
 * @param  EMAIL $mail_email_address Mailing list e-mail address (blank: not set / use centrally configured)
 * @param  SHORT_TEXT $mail_server_type Mailing list server type (blank: not set / use centrally configured)
 * @set imap imaps imaps_nocert imapt imapt_nocert pop3 pop3s pop3s_nocert pop3t pop3t_nocert
 * @param  SHORT_TEXT $mail_server_host Mailing list server host (blank: not set / use centrally configured)
 * @param  ?integer $mail_server_port Mailing list server port (null: not set / use centrally configured)
 * @param  SHORT_TEXT $mail_folder Mailing list folder (blank: not set)
 * @param  SHORT_TEXT $mail_username Mailing list username (blank: not set)
 * @param  SHORT_TEXT $mail_password Mailing list password (blank: not set / use centrally configured)
 * @param  ID_TEXT $mail_nonmatch_policy Mailing list policy for non-matched users
 * @set block post_as_guest create_account
 * @param  BINARY $mail_unconfirmed_notice Mailing list policy: whether to highlight that members are not fully confirmed
 * @param  LONG_TEXT $poll_default_options_xml XML which defines enforced options for polls within this forum
 * @return AUTO_LINK The ID of the newly created forum
 */

function cns_make_forum(string $name, string $description, ?int $forum_grouping_id, ?array $access_mapping, ?int $parent_forum, int $position = 1, int $post_count_increment = 1, int $order_sub_alpha = 0, string $intro_question = '', string $intro_answer = '', string $redirection = '', string $order = 'last_post', int $is_threaded = 0, int $allows_anonymous_posts = 0, string $mail_email_address = '', string $mail_server_type = '', string $mail_server_host = '', ?int $mail_server_port = null, string $mail_folder = '', string $mail_username = '', string $mail_password = '', string $mail_nonmatch_policy = 'post_as_guest', int $mail_unconfirmed_notice = 1, string $poll_default_options_xml = '') : int