Function __global->get_comments

Definitions

sources/feedback.php

  • Get the Tempcode containing all the comments posted, and the comments posting form for the specified resource.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$feedback_type ID_TEXT No No required parameter N/A N/A The feedback type (downloads, etc) that this commenting is for
$allow_comments boolean No No required parameter N/A N/A Whether this resource allows comments (if not, this function does nothing - but it's nice to move out this common logic into the shared function)
$content_id ID_TEXT No No required parameter N/A N/A The ID of the type that this commenting is for
$invisible_if_no_comments boolean No No False N/A N/A Whether the comment box will be invisible if there are not yet any comments (and you're not staff)
$forum ?string No No Null N/A N/A The name of the forum to use (null: default comment forum)
$post_warning ?string No No Null N/A N/A The default post to use (null: standard courtesy warning)
$_comments ?mixed No No Null N/A N/A The raw comment array (null: lookup). This is useful if we want to pass it through a filter
$explicit_allow boolean No No False N/A N/A Whether to skip permission checks
$reverse ?boolean No No Null N/A N/A Whether to show in reverse date order (affects default search order only) (null: read config)
$highlight_by_user ?MEMBER No No Null N/A N/A User to highlight the posts of (null: none)
$allow_reviews boolean No No False N/A N/A Whether to allow ratings along with the comment (like reviews)
$num_to_show_limit ?integer No No Null N/A N/A Maximum to load (null: default)
$hidden ?Tempcode No No Null N/A N/A Hidden form fields for commenting form (null: none)

Returns

  • The Tempcode for the comment topic
  • Type: Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the Tempcode containing all the comments posted, and the comments posting form for the specified resource.
 *
 * @param  ID_TEXT $feedback_type The feedback type (downloads, etc) that this commenting is for
 * @param  boolean $allow_comments Whether this resource allows comments (if not, this function does nothing - but it's nice to move out this common logic into the shared function)
 * @param  ID_TEXT $content_id The ID of the type that this commenting is for
 * @param  boolean $invisible_if_no_comments Whether the comment box will be invisible if there are not yet any comments (and you're not staff)
 * @param  ?string $forum The name of the forum to use (null: default comment forum)
 * @param  ?string $post_warning The default post to use (null: standard courtesy warning)
 * @param  ?mixed $_comments The raw comment array (null: lookup). This is useful if we want to pass it through a filter
 * @param  boolean $explicit_allow Whether to skip permission checks
 * @param  ?boolean $reverse Whether to show in reverse date order (affects default search order only) (null: read config)
 * @param  ?MEMBER $highlight_by_user User to highlight the posts of (null: none)
 * @param  boolean $allow_reviews Whether to allow ratings along with the comment (like reviews)
 * @param  ?integer $num_to_show_limit Maximum to load (null: default)
 * @param  ?Tempcode $hidden Hidden form fields for commenting form (null: none)
 * @return Tempcode The Tempcode for the comment topic
 */

function get_comments(string $feedback_type, bool $allow_comments, string $content_id, bool $invisible_if_no_comments = false, ?string $forum = null, ?string $post_warning = null, $_comments = null, bool $explicit_allow = false, ?bool $reverse = null, ?int $highlight_by_user = null, bool $allow_reviews = false, ?int $num_to_show_limit = null, ?object $hidden = null) : object