Function Forum_driver_cns->get_forum_topic_posts

Definitions

sources/forum/cns.php

  • Get an array of maps for the topic in the given forum.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$topic_id integer No No required parameter N/A N/A The topic ID
&$count ?integer Yes No Null N/A N/A The comment count will be returned here by reference (null: do not gather it)
$max ?integer No No 100 N/A N/A Maximum comments to returned (null: no limit)
$start integer No No 0 N/A N/A Comment to start at
$mark_read boolean No No True N/A N/A Whether to mark the topic read
$reverse boolean No No False N/A N/A Whether to show in reverse
$light_if_threaded boolean No No False N/A N/A Whether to only load minimal details if it is a threaded topic
$posts ?array No No Null N/A N/A List of post IDs to load (null: no filter)
$load_spacer_posts_too boolean No No False N/A N/A Whether to load spacer posts
$sort ID_TEXT No No date date rating N/A Preferred sort order (appropriate will use rating if threaded, other

Returns

  • The array of maps (Each map is: title, message, member, date) (-1 for no such forum, -2 for no such topic)
  • Type: mixed
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get an array of maps for the topic in the given forum.
 *
 * @param  integer $topic_id The topic ID
 * @param  ?integer $count The comment count will be returned here by reference (null: do not gather it)
 * @param  ?integer $max Maximum comments to returned (null: no limit)
 * @param  integer $start Comment to start at
 * @param  boolean $mark_read Whether to mark the topic read
 * @param  boolean $reverse Whether to show in reverse
 * @param  boolean $light_if_threaded Whether to only load minimal details if it is a threaded topic
 * @param  ?array $posts List of post IDs to load (null: no filter)
 * @param  boolean $load_spacer_posts_too Whether to load spacer posts
 * @param  ID_TEXT $sort Preferred sort order (appropriate will use rating if threaded, other
 * @set date rating
 * @return mixed The array of maps (Each map is: title, message, member, date) (-1 for no such forum, -2 for no such topic)
 */

public function get_forum_topic_posts(int $topic_id, ?int &$count = null, ?int $max = 100, int $start = 0, bool $mark_read = true, bool $reverse = false, bool $light_if_threaded = false, ?array $posts = null, bool $load_spacer_posts_too = false, string $sort = 'date')