HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: OCF views

» Return to Contents



sources/ocf_forumview.php

Global_functions_ocf_forumview.php

Function summary

mixed ocf_render_forumview (?integer id, string current_filter_cat, integer max, integer start, AUTO_LINK root, ?MEMBER of_member_id)
array ocf_get_topic_array (array topic_row, MEMBER member_id, integer hot_topic_definition, boolean involved)
tempcode ocf_render_topic (array topic, boolean has_topic_marking, boolean pt, ?string show_forum)
array ocf_get_forum_view (integer start, ?integer max, ?MEMBER forum_id)

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

Render the OCF forumview.

Parameters…

Name id
Description Forum ID (NULL: personal topics).
Type ?integer

Name current_filter_cat
Description The filter category (blank if no filter)
Type string

Name max
Description Maximum results to show
Type integer

Name start
Description Offset for result showing
Type integer

Name root
Description Virtual root
Type AUTO_LINK

Name of_member_id
Description The member to show personal topics of (NULL: not showing personal topics)
Type ?MEMBER

Returns…

Description Either 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).
Type mixed

Return to the function index for this class Expand: View the source code to this function

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

Get details of a topic (to show eventually as a row in a forum or results view). This is a helper function, and thus the interface is not very user friendly.

Parameters…

Name topic_row
Description The DB row of the topic.
Type array

Name member_id
Description The member the details are being prepared for.
Type MEMBER

Name hot_topic_definition
Description The hot topic definition (taken from the config options).
Type integer

Name involved
Description Whether the viewing member has a post in the topic.
Type boolean

Returns…

Description The details.
Type array

Return to the function index for this class Expand: View the source code to this function

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

Render a topic row (i.e. a row in a forum or results view), from given details (from ocf_get_topic_array).

Parameters…

Name topic
Description The details (array containing: last_post_id, id, modifiers, emoticon, first_member_id, first_username, first_post, num_posts, num_views).
Type array

Name has_topic_marking
Description Whether the viewing member has the facility to mark off topics (send as false if there are no actions for them to perform).
Type boolean

Name pt
Description Whether the topic is a Private Topic.
Default value boolean-false
Type boolean

Name show_forum
Description The forum name (NULL: do not show the forum name).
Default value
Type ?string

Returns…

Description The topic row.
Type tempcode

Return to the function index for this class Expand: View the source code to this function

array ocf_get_forum_view(integer start, ?integer max, ?MEMBER forum_id)

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

Parameters…

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

Name max
Description The maximum number of topics to get detail of (NULL: default).
Default value
Type ?integer

Name forum_id
Description The member viewing (NULL: current member).
Default value
Type ?MEMBER

Returns…

Description The details.
Type array

Return to the function index for this class Expand: View the source code to this function

sources/ocf_topicview.php

Global_functions_ocf_topicview.php

Function summary

URLPATH find_post_id_url (AUTO_LINK post_id)
URLPATH find_first_unread_url (AUTO_LINK id)
array ocf_get_details_to_show_post (array _postdetails, boolean only_post)
array ocf_read_in_topic (?AUTO_LINK topic_id, integer start, integer max, boolean view_poll_results, boolean check_perms)
void ocf_cache_member_details (array members)
tempcode ocf_render_post_buttons (array topic_info, array _postdetails, boolean may_reply)
tempcode ocf_get_post_emphasis (array _postdetails)

URLPATH find_post_id_url(AUTO_LINK post_id)

Find the URL to a post.

Parameters…

Name post_id
Description The post ID.
Type AUTO_LINK

Returns…

Description The URL.
Type URLPATH

Return to the function index for this class Expand: View the source code to this function

URLPATH find_first_unread_url(AUTO_LINK id)

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

Parameters…

Name id
Description The topic ID.
Type AUTO_LINK

Returns…

Description The URL.
Type URLPATH

Return to the function index for this class Expand: View the source code to this function

array ocf_get_details_to_show_post(array _postdetails, boolean only_post)

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

Parameters…

Name _postdetails
Description The post row.
Type array

Name only_post
Description Whether the post is the only post in the topic.
Default value boolean-false
Type boolean

Returns…

Description The detailed map.
Type array

Return to the function index for this class Expand: View the source code to this function

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

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

Parameters…

Name topic_id
Description The ID of the topic we are getting details of (NULL: whispers).
Type ?AUTO_LINK

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

Name max
Description The maximum number of posts to get detail of.
Type integer

Name view_poll_results
Description Whether we are viewing poll results for the topic (if there is no poll for the topic, this is irrelevant).
Default value boolean-false
Type boolean

Name check_perms
Description Whether to check permissions.
Default value boolean-true
Type boolean

Returns…

Description The map of details.
Type array

Return to the function index for this class Expand: View the source code to this function

void ocf_cache_member_details(array members)

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

Parameters…

Name members
Description List of members.
Type array

(No return value)


Return to the function index for this class Expand: View the source code to this function

tempcode ocf_render_post_buttons(array topic_info, array _postdetails, boolean may_reply)

Get buttons for showing under a post.

Parameters…

Name topic_info
Description Map of topic info.
Type array

Name _postdetails
Description Map of post info.
Type array

Name may_reply
Description Whether the current member may reply to the topic
Type boolean

Returns…

Description The buttons.
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode ocf_get_post_emphasis(array _postdetails)

Get post emphasis Tempcode.

Parameters…

Name _postdetails
Description Map of post info.
Type array

Returns…

Description The tempcode.
Type tempcode

Return to the function index for this class Expand: View the source code to this function