Functions

Assign points to the current member for rating.

actualise_give_rating_points() 

Add comments to the specified resource.

actualise_post_comment(boolean $allow_comments, \ID_TEXT $content_type, \ID_TEXT $content_id, mixed $content_url, \?string $content_title, \?string $forum = null, boolean $avoid_captcha = false, \?BINARY $validated = null, boolean $explicit_allow = false, boolean $no_success_message = false, boolean $private = false, \?string $post_title = null, \?string $post = null, \?TIME $time = null) : boolean
package core_feedback_features

Parameters

$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)

$content_type

\ID_TEXT

The type (download, etc) that this commenting is for

$content_id

\ID_TEXT

The ID of the type that this commenting is for

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know, but not first post so not important)

$forum

\?string

The name of the forum to use (null: default comment forum)

$avoid_captcha

boolean

Whether to not require a captcha

$validated

\?BINARY

Whether the post is validated (null: unknown, find whether it needs to be marked unvalidated initially). This only works with the Conversr driver (hence is the last parameter).

$explicit_allow

boolean

Whether to force allowance

$no_success_message

boolean

Whether to skip a success message

$private

boolean

Whether posts made should not be shared

$post_title

\?string

Title of the post (null: lookup from POST environment)

$post

\?string

Body of the post (null: lookup from POST environment)

$time

\?TIME

Time of comment topic (null: now)

Returns

booleanWhether a hidden post has been made

Add trackbacks to the specified resource.

actualise_post_trackback(boolean $allow_trackbacks, \ID_TEXT $content_type, \ID_TEXT $content_id) : boolean
package core_feedback_features

Parameters

$allow_trackbacks

boolean

Whether this resource allows trackback (if not, this function does nothing - but it's nice to move out this common logic into the shared function)

$content_type

\ID_TEXT

The type (download, etc) that this trackback is for

$content_id

\ID_TEXT

The ID of the type that this trackback is for

Returns

booleanWhether trackbacks are on

Actually adds a rating to the specified resource.

actualise_rating(boolean $allow_rating, \ID_TEXT $content_type, \ID_TEXT $content_id, mixed $content_url, \?string $content_title) 

It performs full checking of inputs, and will log a hackattack if the rating is not between 1 and 10.

package core_feedback_features

Parameters

$allow_rating

boolean

Whether this resource allows rating (if not, this function does nothing - but it's nice to move out this common logic into the shared function)

$content_type

\ID_TEXT

The type (download, etc) that this rating is for

$content_id

\ID_TEXT

The ID of the type that this rating is for

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know, but not first post so not important)

Implement a rating at the quantum level.

actualise_specific_rating(\?integer $rating, \ID_TEXT $page_name, \MEMBER $member_id, \ID_TEXT $content_type, \ID_TEXT $type, \ID_TEXT $content_id, mixed $content_url, \?string $content_title) 
package core_feedback_features
range 1 10

Parameters

$rating

\?integer

Rating given (null: unrate)

$page_name

\ID_TEXT

The page name the rating is on

$member_id

\MEMBER

The member doing the rating

$content_type

\ID_TEXT

The type (download, etc) that this rating is for

$type

\ID_TEXT

The second level type (probably blank)

$content_id

\ID_TEXT

The ID of the type that this rating is for

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know)

Find whether you have rated the specified resource before.

already_rated(array $rating_for_types, \ID_TEXT $content_id) : boolean
package core_feedback_features

Parameters

$rating_for_types

array

List of types (download, etc) that this rating is for. All need to be rated for it to return true.

$content_id

\ID_TEXT

The ID of the type that this rating is for

Returns

booleanWhether the resource has already been rated

Display rating using images

display_rating(mixed $content_url, \?string $content_title, \ID_TEXT $content_type, \ID_TEXT $content_id, \ID_TEXT $display_tpl = 'RATING_INLINE_STATIC', \?MEMBER $submitter = null) : \Tempcode
package core_feedback_features

Parameters

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know, but not first post so not important)

$content_type

\ID_TEXT

The type (download, etc) that this rating is for

$content_id

\ID_TEXT

The ID of the type that this rating is for

$display_tpl

\ID_TEXT

The template to use to display the rating box

$submitter

\?MEMBER

Content owner (null: none)

Returns

\TempcodeTempcode for complete trackback box

Main wrapper function to embed miscellaneous feedback systems into a module output.

embed_feedback_systems(\ID_TEXT $page_name, \ID_TEXT $content_id, \BINARY $allow_rating, integer $allow_comments, \BINARY $allow_trackbacks, \BINARY $validated, \?MEMBER $submitter, mixed $content_url, \SHORT_TEXT $content_title, \?string $forum, \?TIME $time = null) : array
package core_feedback_features
set 0 1 2

Parameters

$page_name

\ID_TEXT

The page name

$content_id

\ID_TEXT

Content ID

$allow_rating

\BINARY

Whether rating is allowed

$allow_comments

integer

Whether comments/reviews is allowed (reviews allowed=2)

$allow_trackbacks

\BINARY

Whether trackbacks are allowed

$validated

\BINARY

Whether the content is validated

$submitter

\?MEMBER

Content owner (null: none)

$content_url

mixed

URL to view the content

$content_title

\SHORT_TEXT

Content title

$forum

\?string

Forum to post comments in (null: site-wide default)

$time

\?TIME

Time of comment topic (null: now)

Returns

arrayTuple: Rating details, Comment details, Trackback details

Topic titles/descriptions (depending on forum driver) are encoded for both human readable data, and a special ID code: this will extract just the ID code, or return the whole thing if no specific pattern match

extract_topic_identifier(string $full_text) : string
package core_feedback_features

Parameters

$full_text

string

Potentially complex topic title

Returns

stringSimplified topic title

Get the Tempcode for the manipulation of the feedback fields for some content, if they are enabled in the Admin Zone.

feedback_fields(boolean $allow_rating, boolean $allow_comments, \?boolean $allow_trackbacks, boolean $send_trackbacks, \LONG_TEXT $notes, \?boolean $allow_reviews = null, boolean $default_off = false, boolean $has_notes = true, boolean $show_header = true, string $field_name_prefix = '') : \Tempcode
package core_feedback_features

Parameters

$allow_rating

boolean

Whether rating is currently/by-default allowed for this resource

$allow_comments

boolean

Whether comments are currently/by-default allowed for this resource

$allow_trackbacks

\?boolean

Whether trackbacks are currently/by-default allowed for this resource (null: this resource does not support trackbacks regardless)

$send_trackbacks

boolean

Whether we're allowed to send trackbacks for this resource

$notes

\LONG_TEXT

The current/by-default notes for this content

$allow_reviews

\?boolean

Whether reviews are currently/by-default allowed for this resource (null: no reviews allowed here)

$default_off

boolean

Whether the default values for the allow options is actually off (this determines how the tray auto-hides itself)

$has_notes

boolean

If there's to be a notes field

$show_header

boolean

Whether to show a header

$field_name_prefix

string

Field name prefix

Returns

\TempcodeThe feedback editing fields

Get the comment topic forum for a feedback scenario.

find_overridden_comment_forum(\ID_TEXT $feedback_code, \?ID_TEXT $category_id = null) : \ID_TEXT
package core_feedback_features

Parameters

$feedback_code

\ID_TEXT

The feedback code, which we may have overridden the comment forum against

$category_id

\?ID_TEXT

The category ID, which we may have overridden the comment forum against (null: no category ID to override against)

Returns

\ID_TEXTThe comment topic forum (may be integer as string, or string forum name - so use forum_id_from_name on the result)

Get the Tempcode containing all the comments posted, and the comments posting form for the specified resource.

get_comments(\ID_TEXT $content_type, boolean $allow_comments, \ID_TEXT $content_id, boolean $invisible_if_no_comments = false, \?string $forum = null, \?string $post_warning = null, \?mixed $_comments = null, boolean $explicit_allow = false, \?boolean $reverse = null, \?MEMBER $highlight_by_user = null, boolean $allow_reviews = false, \?integer $num_to_show_limit = null) : \Tempcode
package core_feedback_features

Parameters

$content_type

\ID_TEXT

The type (download, etc) that this commenting is 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)

$content_id

\ID_TEXT

The ID of the type that this commenting is for

$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

\?string

The name of the forum to use (null: default comment forum)

$post_warning

\?string

The default post to use (null: standard courtesy warning)

$_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 show in reverse date order (affects default search order only) (null: read config)

$highlight_by_user

\?MEMBER

User 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

\TempcodeThe Tempcode for the comment topic

Find who submitted a piece of feedbackable content.

get_details_behind_feedback_code(\ID_TEXT $content_type, \ID_TEXT $content_id) : array
package core_feedback_features

Parameters

$content_type

\ID_TEXT

Content type

$content_id

\ID_TEXT

Content ID

Returns

arrayA tuple: Content title (null: unknown), Submitter (null: unknown), URL (for use within current browser session), URL (for use in emails / sharing), Content meta aware info array

Get Tempcode for doing ratings (sits above get_rating_simple_array)

get_rating_box(mixed $content_url, \?string $content_title, \ID_TEXT $content_type, \ID_TEXT $content_id, boolean $allow_rating, \?MEMBER $submitter = null) : \Tempcode
package core_feedback_features

Parameters

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know, but not first post so not important)

$content_type

\ID_TEXT

The type (download, etc) that this rating is for

$content_id

\ID_TEXT

The ID of the type that this rating is for

$allow_rating

boolean

Whether this resource allows rating (if not, this function does nothing - but it's nice to move out this common logic into the shared function)

$submitter

\?MEMBER

Content owner (null: none)

Returns

\TempcodeTempcode for complete rating box

Get rating information for the specified resource.

get_rating_simple_array(mixed $content_url, \?string $content_title, \ID_TEXT $content_type, \ID_TEXT $content_id, \ID_TEXT $form_tpl = 'RATING_FORM', \?MEMBER $submitter = null) : \?array
package core_feedback_features

Parameters

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know, but not first post so not important)

$content_type

\ID_TEXT

The type (download, etc) that this rating is for

$content_id

\ID_TEXT

The ID of the type that this rating is for

$form_tpl

\ID_TEXT

The template to use to display the rating box

$submitter

\?MEMBER

Content owner (null: none)

Returns

\?arrayCurrent rating information (ready to be passed into a template). RATING is the rating (out of 10), NUM_RATINGS is the number of ratings so far, RATING_FORM is the Tempcode of the rating box (null: rating disabled)

Get the Tempcode containing all the trackbacks received, and the trackback posting form for the specified resource.

get_trackbacks(\ID_TEXT $content_type, \ID_TEXT $content_id, boolean $allow_trackback, \ID_TEXT $type = '') : \Tempcode
package core_feedback_features

Parameters

$content_type

\ID_TEXT

The type (download, etc) that this trackback is for

$content_id

\ID_TEXT

The ID of the type that this trackback is for

$allow_trackback

boolean

Whether this resource allows trackback (if not, this function does nothing - but it's nice to move out this common logic into the shared function)

$type

\ID_TEXT

The type of details being fetched (currently: blank or XML)

Returns

\TempcodeTempcode for complete trackback box

Do an AJAX comment post

post_comment_script() 

Get the comment topic forum for a feedback scenario, and move an existing comment topic to a different forum if the category has moved and the categories have divergent configured comment topic forums (Conversr only).

process_overridden_comment_forum(\ID_TEXT $feedback_code, \ID_TEXT $id, \ID_TEXT $category_id, \ID_TEXT $old_category_id) : \ID_TEXT
package core_feedback_features

Parameters

$feedback_code

\ID_TEXT

The feedback code, which we may have overridden the comment forum against

$id

\ID_TEXT

The resource ID whose comment topic may need moving

$category_id

\ID_TEXT

The new/current category ID, which we may have overridden the comment forum against

$old_category_id

\ID_TEXT

The old category ID, which we may have overridden the comment forum against

Returns

\ID_TEXTThe comment topic forum

Send a trackback to somebody else's website.

send_trackbacks(string $_urls, string $title, string $excerpt) : boolean
package core_feedback_features

Parameters

$_urls

string

A comma-separated list of URLs to which we should trackback

$title

string

The article title

$excerpt

string

The excerpt to send

Returns

booleanSuccess?

Set an overridden comment topic forum for a feedback scenario. Moves topics if required.

set_comment_forum_for(\ID_TEXT $feedback_code, \?ID_TEXT $category_id, \ID_TEXT $forum_id) 
package core_feedback_features

Parameters

$feedback_code

\ID_TEXT

The feedback code to override the comment topic forum for

$category_id

\?ID_TEXT

The category ID to override the comment topic forum for (null: none)

$forum_id

\ID_TEXT

The new comment topic forum

Output the trackback script and handle trackbacks.

trackback_script() 

Update the spacer post of a comment topic, after an edit.

update_spacer_post(boolean $allow_comments, \ID_TEXT $content_type, \ID_TEXT $content_id, mixed $content_url, \?string $content_title, \?string $forum = null, \?AUTO_LINK $post_id = null
package core_feedback_features

Parameters

$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)

$content_type

\ID_TEXT

The type (download, etc) that this commenting is for

$content_id

\ID_TEXT

The ID of the type that this commenting is for

$content_url

mixed

The URL to where the commenting will pass back to (to put into the comment topic header) (URLPATH or Tempcode)

$content_title

\?string

The title to where the commenting will pass back to (to put into the comment topic header) (null: don't know, but not first post so not important)

$forum

\?string

The name of the forum to use (null: default comment forum)

$post_id

\?AUTO_LINK

ID of spacer post (null: unknown)

Classes, interfaces, and traits

CMS_Topic

Manage threaded topics / comment topics.

« More »

Constants

 

MAX_LIKES_TO_SHOW

MAX_LIKES_TO_SHOW = 20 
 

RATING_TYPE_like_dislike

RATING_TYPE_like_dislike = 1 
 

RATING_TYPE_star_choice

RATING_TYPE_star_choice = 0