Manage threaded topics / comment topics.
| package | core_feedback_features |
|---|
__construct()
get_posting_form(\ID_TEXT $type, \ID_TEXT $id, boolean $allow_reviews, \Tempcode $post_url, \?string $post_warning) : \Tempcode
\ID_TEXTThe content type of what this posting will be for
\ID_TEXTThe content ID of what this posting will be for
booleanWhether to accept reviews
\TempcodeURL where form submit will go
\?stringThe default post to use (null: standard courtesy warning)
\TempcodePosting forminject_posts_for_scoring_algorithm(array $posts)
arrayReview titles
inject_rss_url(\ID_TEXT $forum, \ID_TEXT $type, \ID_TEXT $id)
\ID_TEXTThe forum we are working in
\ID_TEXTThe content type the comments are for
\ID_TEXTThe content ID the comments are for
load_from_topic(\?AUTO_LINK $topic_id, integer $num_to_show_limit, integer $start= 0, \?boolean $reverse= null, \?array $posts= null, boolean $load_spacer_posts_too= false) : boolean
\?AUTO_LINKTopic ID (null: none yet, set up empty structure)
integerMaximum to load
integerPagination start if non-threaded
\?booleanWhether to show in reverse date order (affects default search order only) (null: read config)
\?arrayList of post IDs to load (null: no filter)
booleanWhether to allow spacer posts to flow through the renderer
booleanSuccess statusrender_posts(\?integer $num_to_show_limit, integer $max_thread_depth, boolean $may_reply, \?MEMBER $highlight_by_member, array $all_individual_review_ratings, \AUTO_LINK $forum_id, \?array $topic_info, \?AUTO_LINK $parent_post_id= null, boolean $maybe_missing_links= false) : array
\?integerNumber of posts to show initially (null: no limit)
integerMaximum thread depth
booleanWhether the current user may reply to the topic (influences what buttons show)
\?MEMBERMember to highlight the posts of (null: none)
arrayReview ratings rows
\AUTO_LINKID of forum this topic in in
\?arrayThe topic row (null: not running Conversr).
\?AUTO_LINKOnly show posts under here (null: show posts from root)
booleanWhether to just render everything as flat (used when doing AJAX post loading). NOT actually used since we wrote better post-orphaning-fixing code.
arrayTuple: Rendered topic, serialized options to render more posts, secure hash of serialized options to prevent tamperingrender_posts_from_topic(\AUTO_LINK $topic_id, integer $num_to_show_limit, boolean $allow_comments, boolean $invisible_if_no_comments, \?string $forum_name, \?mixed $preloaded_comments, boolean $reverse, boolean $may_reply, \?MEMBER $highlight_by_member, boolean $allow_reviews, array $posts, \AUTO_LINK $parent_id) : \Tempcode
\AUTO_LINKThe topic ID
integerMaximum to load
booleanWhether this resource allows comments (if not, this function does nothing - but it's nice to move out this common logic into the shared function)
booleanWhether the comment box will be invisible if there are not yet any comments (and you're not staff)
\?stringThe name of the forum to use (null: default comment forum)
\?mixedThe raw comment array (null: lookup). This is useful if we want to pass it through a filter
booleanWhether to reverse the posts
booleanWhether the current user may reply to the topic (influences what buttons show)
\?MEMBERMember to highlight the posts of (null: none)
booleanWhether to allow ratings along with the comment (like reviews)
arrayList of post IDs to load
\AUTO_LINKParent node being loaded to
\TempcodeThe Tempcode for the comment topicset_rendering_context(\ID_TEXT $rendering_context)
\ID_TEXTRendering context
_arrange_posts_in_tree(\?AUTO_LINK $post_id, array $posts, array $queue, integer $max_thread_depth, integer $depth = 0) : array
\?AUTO_LINKReference post in thread (null: root)
arrayPosts we will be rendering and have not arranged yet (only some of which will be underneath $post_id)
arrayPosts we won't be rendering
integerMaximum depth to render to
integerCurrent depth in recursion
arrayArray structure of rendered posts_decide_what_to_render(integer $num_to_show_limit, array $queue) : array
integerNumber of posts to show initially
arrayPosts to choose from, in preference order
arrayChosen posts_get_sort_order(\?boolean $reverse) : \ID_TEXT
| set | relevance rating newest oldest |
|---|
\?booleanWhether to show in reverse date order (affects default search order only) (null: read config)
\ID_TEXTSort order_grab_at_and_above_and_remove(\AUTO_LINK $post_id, array $queue, array $posts)
\AUTO_LINKReference post in thread
arrayPosts to choose from (the queue)
arrayPosts picked out (passed by reference)
_grab_at_and_underneath(\?AUTO_LINK $parent_post_id, array $posts_in) : array
\?AUTO_LINKReference post in thread (null: root)
arrayPosts to choose from
arrayRelevant posts_grab_full_post_details(array $posts) : array
arrayPosts to load
arrayUpgraded posts_render_post_tree(integer $num_to_show_limit, array $tree, boolean $may_reply, \?AUTO_LINK $highlight_by_member, array $all_individual_review_ratings, \AUTO_LINK $forum_id, \?array $topic_info, integer $depth = 0) : \Tempcode
integerMaximum to load
arrayTree structure of posts
booleanWhether the current user may reply to the topic (influences what buttons show)
\?AUTO_LINKOnly show posts under here (null: show posts from root)
arrayReview ratings rows
\AUTO_LINKID of forum this topic in in
\?arrayThe topic row (null: not running Conversr).
integerThe recursion depth
\TempcodeRendered tree structure$all_posts_ordered
null$error
false$first_post_id
null$is_threaded
null$rendering_context
'cns'$replied
false$reverse
false$topic_description
null$topic_description_link
null$topic_id
null$topic_info
null$topic_title
null$total_posts
null
Render a comment topic.
Parameters
$content_type
\ID_TEXTContent type to show topic for
$content_id
\ID_TEXTContent ID of content type to show topic for
$allow_comments
booleanWhether this resource allows comments (if not, this function does nothing - but it's nice to move out this common logic into the shared function)
$invisible_if_no_comments
booleanWhether the comment box will be invisible if there are not yet any comments (and you're not staff)
$forum_name
\?stringThe name of the forum to use (null: default comment forum)
$post_warning
\?stringThe default post to use (null: standard courtesy warning)
$preloaded_comments
\?mixedThe raw comment array (null: lookup). This is useful if we want to pass it through a filter
$explicit_allow
booleanWhether to skip permission checks
$reverse
booleanWhether to reverse the posts
$highlight_by_member
\?MEMBERMember to highlight the posts of (null: none)
$allow_reviews
booleanWhether to allow ratings along with the comment (like reviews)
$num_to_show_limit
\?integerMaximum to load (null: default)
Returns
\TempcodeThe Tempcode for the comment topic