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_TEXT
The content type of what this posting will be for
\ID_TEXT
The content ID of what this posting will be for
boolean
Whether to accept reviews
\Tempcode
URL where form submit will go
\?string
The default post to use (null: standard courtesy warning)
\Tempcode
Posting forminject_posts_for_scoring_algorithm(array $posts)
array
Review titles
inject_rss_url(\ID_TEXT $forum, \ID_TEXT $type, \ID_TEXT $id)
\ID_TEXT
The forum we are working in
\ID_TEXT
The content type the comments are for
\ID_TEXT
The 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_LINK
Topic ID (null: none yet, set up empty structure)
integer
Maximum to load
integer
Pagination start if non-threaded
\?boolean
Whether to show in reverse date order (affects default search order only) (null: read config)
\?array
List of post IDs to load (null: no filter)
boolean
Whether to allow spacer posts to flow through the renderer
boolean
Success 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
\?integer
Number of posts to show initially (null: no limit)
integer
Maximum thread depth
boolean
Whether the current user may reply to the topic (influences what buttons show)
\?MEMBER
Member to highlight the posts of (null: none)
array
Review ratings rows
\AUTO_LINK
ID of forum this topic in in
\?array
The topic row (null: not running Conversr).
\?AUTO_LINK
Only show posts under here (null: show posts from root)
boolean
Whether to just render everything as flat (used when doing AJAX post loading). NOT actually used since we wrote better post-orphaning-fixing code.
array
Tuple: 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_LINK
The topic ID
integer
Maximum to load
boolean
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)
boolean
Whether the comment box will be invisible if there are not yet any comments (and you're not staff)
\?string
The name of the forum to use (null: default comment forum)
\?mixed
The raw comment array (null: lookup). This is useful if we want to pass it through a filter
boolean
Whether to reverse the posts
boolean
Whether the current user may reply to the topic (influences what buttons show)
\?MEMBER
Member to highlight the posts of (null: none)
boolean
Whether to allow ratings along with the comment (like reviews)
array
List of post IDs to load
\AUTO_LINK
Parent node being loaded to
\Tempcode
The Tempcode for the comment topicset_rendering_context(\ID_TEXT $rendering_context)
\ID_TEXT
Rendering context
_arrange_posts_in_tree(\?AUTO_LINK $post_id, array $posts, array $queue, integer $max_thread_depth, integer $depth = 0
) : array
\?AUTO_LINK
Reference post in thread (null: root)
array
Posts we will be rendering and have not arranged yet (only some of which will be underneath $post_id)
array
Posts we won't be rendering
integer
Maximum depth to render to
integer
Current depth in recursion
array
Array structure of rendered posts_decide_what_to_render(integer $num_to_show_limit, array $queue) : array
integer
Number of posts to show initially
array
Posts to choose from, in preference order
array
Chosen posts_get_sort_order(\?boolean $reverse) : \ID_TEXT
set | relevance rating newest oldest |
---|
\?boolean
Whether to show in reverse date order (affects default search order only) (null: read config)
\ID_TEXT
Sort order_grab_at_and_above_and_remove(\AUTO_LINK $post_id, array $queue, array $posts)
\AUTO_LINK
Reference post in thread
array
Posts to choose from (the queue)
array
Posts picked out (passed by reference)
_grab_at_and_underneath(\?AUTO_LINK $parent_post_id, array $posts_in) : array
\?AUTO_LINK
Reference post in thread (null: root)
array
Posts to choose from
array
Relevant posts_grab_full_post_details(array $posts) : array
array
Posts to load
array
Upgraded 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
integer
Maximum to load
array
Tree structure of posts
boolean
Whether the current user may reply to the topic (influences what buttons show)
\?AUTO_LINK
Only show posts under here (null: show posts from root)
array
Review ratings rows
\AUTO_LINK
ID of forum this topic in in
\?array
The topic row (null: not running Conversr).
integer
The recursion depth
\Tempcode
Rendered 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_TEXT
Content type to show topic for
$content_id
\ID_TEXT
Content ID of content type to show topic for
$allow_comments
boolean
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)
$invisible_if_no_comments
boolean
Whether the comment box will be invisible if there are not yet any comments (and you're not staff)
$forum_name
\?string
The name of the forum to use (null: default comment forum)
$post_warning
\?string
The default post to use (null: standard courtesy warning)
$preloaded_comments
\?mixed
The raw comment array (null: lookup). This is useful if we want to pass it through a filter
$explicit_allow
boolean
Whether to skip permission checks
$reverse
boolean
Whether to reverse the posts
$highlight_by_member
\?MEMBER
Member to highlight the posts of (null: none)
$allow_reviews
boolean
Whether to allow ratings along with the comment (like reviews)
$num_to_show_limit
\?integer
Maximum to load (null: default)
Returns
\Tempcode
The Tempcode for the comment topic