Function __global->cns_render_topic
Definitions
sources/cns_forumview.php
- Render a topic row (i.e. a row in a forum or results view), from given details (from cns_get_topic_array).
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $topic | array | No | No | required parameter | N/A | N/A | The details (array containing: last_post_id, id, modifiers, emoticon, first_member_id, first_username, first_post, num_posts, num_views) |
| $has_topic_marking | boolean | No | No | required parameter | N/A | N/A | Whether the viewing member has the facility to mark off topics (send as false if there are no actions for them to perform) |
| $pt | boolean | No | No | False | N/A | N/A | Whether the topic is a Private Topic |
| $show_forum | ?Tempcode | No | No | Null | N/A | N/A | The forum name (null: do not show the forum name) |
Returns
- The topic row
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Render a topic row (i.e. a row in a forum or results view), from given details (from cns_get_topic_array).
*
* @param array $topic The details (array containing: last_post_id, id, modifiers, emoticon, first_member_id, first_username, first_post, num_posts, num_views)
* @param boolean $has_topic_marking Whether the viewing member has the facility to mark off topics (send as false if there are no actions for them to perform)
* @param boolean $pt Whether the topic is a Private Topic
* @param ?Tempcode $show_forum The forum name (null: do not show the forum name)
* @return Tempcode The topic row
*/
function cns_render_topic(array $topic, bool $has_topic_marking, bool $pt = false, ?object $show_forum = null) : object
* Render a topic row (i.e. a row in a forum or results view), from given details (from cns_get_topic_array).
*
* @param array $topic The details (array containing: last_post_id, id, modifiers, emoticon, first_member_id, first_username, first_post, num_posts, num_views)
* @param boolean $has_topic_marking Whether the viewing member has the facility to mark off topics (send as false if there are no actions for them to perform)
* @param boolean $pt Whether the topic is a Private Topic
* @param ?Tempcode $show_forum The forum name (null: do not show the forum name)
* @return Tempcode The topic row
*/
function cns_render_topic(array $topic, bool $has_topic_marking, bool $pt = false, ?object $show_forum = null) : object
