Function CMS_Topic->render_posts

Definitions

sources/topics.php

  • Render a topic's posts.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$num_to_show_limit ?integer No No required parameter N/A N/A Number of posts to show initially (null: no limit)
$max_thread_depth integer No No required parameter N/A N/A Maximum thread depth
$may_reply boolean No No required parameter N/A N/A Whether the current user may reply to the topic (influences what buttons show)
$highlight_by_member ?MEMBER No No required parameter N/A N/A Member to highlight the posts of (null: none)
$all_individual_review_ratings array No No required parameter N/A N/A Review ratings rows
$forum_id AUTO_LINK No No required parameter N/A N/A ID of forum this topic in in
$topic_info ?array No No required parameter N/A N/A The topic row (null: not running Conversr)
$parent_post_id ?AUTO_LINK No No Null N/A N/A Only show posts under here (null: show posts from root)
$maybe_missing_links boolean No No False N/A N/A Whether to just render everything as flat (used when doing AJAX post loading). NOT actually used since we wrote better post-orphaning-fixing code.

Returns

  • Tuple: Rendered topic, serialized options to render more posts, secure hash of serialized options to prevent tampering
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Render a topic's posts.
 *
 * @param  ?integer $num_to_show_limit Number of posts to show initially (null: no limit)
 * @param  integer $max_thread_depth Maximum thread depth
 * @param  boolean $may_reply Whether the current user may reply to the topic (influences what buttons show)
 * @param  ?MEMBER $highlight_by_member Member to highlight the posts of (null: none)
 * @param  array $all_individual_review_ratings Review ratings rows
 * @param  AUTO_LINK $forum_id ID of forum this topic in in
 * @param  ?array $topic_info The topic row (null: not running Conversr)
 * @param  ?AUTO_LINK $parent_post_id Only show posts under here (null: show posts from root)
 * @param  boolean $maybe_missing_links Whether to just render everything as flat (used when doing AJAX post loading). NOT actually used since we wrote better post-orphaning-fixing code.
 * @return array Tuple: Rendered topic, serialized options to render more posts, secure hash of serialized options to prevent tampering
 */

public function render_posts(?int $num_to_show_limit, int $max_thread_depth, bool $may_reply, ?int $highlight_by_member, array $all_individual_review_ratings, int $forum_id, ?array $topic_info, ?int $parent_post_id = null, bool $maybe_missing_links = false) : array