Functions

Find the URL to the latest unread post in a topic.

find_first_unread_url(\AUTO_LINK $id) : \URLPATH

Parameters

$id

\AUTO_LINK

The topic ID.

Returns

\URLPATHThe URL.

Find the URL to a post.

find_post_id_url(\AUTO_LINK $post_id) : \URLPATH

Parameters

$post_id

\AUTO_LINK

The post ID.

Returns

\URLPATHThe URL.

Mass-load details for a list of members into memory, to reduce queries when we access it later.

ocf_cache_member_details(array $members) 

Parameters

$members

array

List of members.

Turn a post row, into a detailed map of information that is suitable for use as display parameters for that post.

ocf_get_details_to_show_post(array $_postdetails, boolean $only_post) : array

Parameters

$_postdetails

array

The post row.

$only_post

boolean

Whether the post is the only post in the topic.

Returns

arrayThe detailed map.

Get a map of details relating to the view of a certain forum of a certain member.

ocf_get_forum_view(integer $start, \?integer $max, \?MEMBER $forum_id) : array

Parameters

$start

integer

The start row for getting details of topics in the forum (i.e. 0 is newest, higher is starting further back in time).

$max

\?integer

The maximum number of topics to get detail of (NULL: default).

$forum_id

\?MEMBER

The member viewing (NULL: current member).

Returns

arrayThe details.

Get post emphasis Tempcode.

ocf_get_post_emphasis(array $_postdetails) : \tempcode

Parameters

$_postdetails

array

Map of post info.

Returns

\tempcodeThe tempcode.

Get a map of details relating to the Private Topics of a certain member.

ocf_get_private_topics(integer $start, \?integer $max, \?MEMBER $member_id) : array

Parameters

$start

integer

The start row for getting details of topics in the Private Topic forum (i.e. 0 is newest, higher is starting further back in time).

$max

\?integer

The maximum number of topics to get detail of (NULL: default).

$member_id

\?MEMBER

The member to get Private Topics of (NULL: current member).

Returns

arrayThe details.

Get details of a topic (to show eventually as a row in a forum or results view).

ocf_get_topic_array(array $topic_row, \MEMBER $member_id, integer $hot_topic_definition, boolean $involved) : array

This is a helper function, and thus the interface is not very user friendly.

Parameters

$topic_row

array

The DB row of the topic.

$member_id

\MEMBER

The member the details are being prepared for.

$hot_topic_definition

integer

The hot topic definition (taken from the config options).

$involved

boolean

Whether the viewing member has a post in the topic.

Returns

arrayThe details.

Read in a great big map of details relating to a topic.

ocf_read_in_topic(\?AUTO_LINK $topic_id, integer $start, integer $max, boolean $view_poll_results, boolean $check_perms) : array

Parameters

$topic_id

\?AUTO_LINK

The ID of the topic we are getting details of (NULL: whispers).

$start

integer

The start row for getting details of posts in the topic (i.e. 0 is start of topic, higher is further through).

$max

integer

The maximum number of posts to get detail of.

$view_poll_results

boolean

Whether we are viewing poll results for the topic (if there is no poll for the topic, this is irrelevant).

$check_perms

boolean

Whether to check permissions.

Returns

arrayThe map of details.

Render the OCF forumview.

ocf_render_forumview(\?integer $id, string $current_filter_cat, integer $max, integer $start, \AUTO_LINK $root, \?MEMBER $of_member_id) : mixed

Parameters

$id

\?integer

Forum ID (NULL: personal topics).

$current_filter_cat

string

The filter category (blank if no filter)

$max

integer

Maximum results to show

$start

integer

Offset for result showing

$root

\AUTO_LINK

Virtual root

$of_member_id

\?MEMBER

The member to show personal topics of (NULL: not showing personal topics)

Returns

mixedEither Tempcode (an interface that must be shown) or a Tuple: The main Tempcode, a title to use (also Tempcode), breadcrumbs (also Tempcode), the forum name (string). For a PT view, it is always a tuple, never raw Tempcode (as it can go inside a tabset).

Get buttons for showing under a post.

ocf_render_post_buttons(array $topic_info, array $_postdetails, boolean $may_reply) : \tempcode

Parameters

$topic_info

array

Map of topic info.

$_postdetails

array

Map of post info.

$may_reply

boolean

Whether the current member may reply to the topic

Returns

\tempcodeThe buttons.

Render a topic row (i.e.

ocf_render_topic(array $topic, boolean $has_topic_marking, boolean $pt, \?string $show_forum) : \tempcode

a row in a forum or results view), from given details (from ocf_get_topic_array).

Parameters

$topic

array

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

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

Whether the topic is a Private Topic.

$show_forum

\?string

The forum name (NULL: do not show the forum name).

Returns

\tempcodeThe topic row.