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

» Return to Contents



sources/ocf_general.php

Global_functions_ocf_general.php

Function summary

array ocf_get_forums_stats ()
array ocf_read_in_member_profile (MEMBER member_id, boolean lite)
string get_group_colour (GROUP gid)
tempcode ocf_wrapper (tempcode title, tempcode content, boolean show_personal_bar, boolean show_stats, ?AUTO_LINK forum_id)
array ocf_find_birthdays (?TIME time)
tempcode ocf_screen_button_wrap (array buttons)

array ocf_get_forums_stats()

Get some forum stats.

Parameters…

Returns…

Description A map of forum stats.
Type array

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

array ocf_read_in_member_profile(MEMBER member_id, boolean lite)

Get details on a member profile.

Parameters…

Name member_id
Description The member to get details of.
Type MEMBER

Name lite
Description Whether to get a 'lite' version (contains less detail, therefore less costly).
Default value boolean-true
Type boolean

Returns…

Description A map of details.
Type array

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

string get_group_colour(GROUP gid)

Get a usergroup colour based on it's ID number.

Parameters…

Name gid
Description ID number.
Type GROUP

Returns…

Description Colour.
Type string

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

tempcode ocf_wrapper(tempcode title, tempcode content, boolean show_personal_bar, boolean show_stats, ?AUTO_LINK forum_id)

Do the wrapper that fits around OCF module output.

Parameters…

Name title
Description The title for the module output that we are wrapping.
Type tempcode

Name content
Description The module output that we are wrapping.
Type tempcode

Name show_personal_bar
Description Whether to include the personal bar in the wrap.
Default value boolean-true
Type boolean

Name show_stats
Description Whether to include statistics in the wrap.
Default value boolean-true
Type boolean

Name forum_id
Description The forum to make the search link search under (NULL: Users own PT forum/unknown).
Default value
Type ?AUTO_LINK

Returns…

Description The wrapped output.
Type tempcode

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

array ocf_find_birthdays(?TIME time)

Find all the birthdays in a certain day.

Parameters…

Name time
Description A timestamps that exists in the certain day (NULL: now).
Default value
Type ?TIME

Returns…

Description List of maps describing the members whose birthday it is on the certain day.
Type array

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

tempcode ocf_screen_button_wrap(array buttons)

Turn a list of maps describing buttons, into a tempcode button panel.

Parameters…

Name buttons
Description List of maps (each map contains: url, img, title).
Type array

Returns…

Description The button panel.
Type tempcode

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

sources/ocf_general_action.php

Global_functions_ocf_general_action.php

Function summary

AUTO_LINK ocf_make_post_template (SHORT_TEXT title, LONG_TEXT text, SHORT_TEXT forum_multi_code, BINARY use_default_forums)
void ocf_make_emoticon (SHORT_TEXT code, ID_TEXT theme_img_code, integer relevance_level, BINARY use_topics, BINARY is_special)
AUTO_LINK ocf_make_welcome_email (SHORT_TEXT name, SHORT_TEXT subject, LONG_TEXT text, integer send_time, ?AUTO_LINK newsletter)

AUTO_LINK ocf_make_post_template(SHORT_TEXT title, LONG_TEXT text, SHORT_TEXT forum_multi_code, BINARY use_default_forums)

Make a post template.

Parameters…

Name title
Description The title for the template.
Type SHORT_TEXT

Name text
Description The text of the template.
Type LONG_TEXT

Name forum_multi_code
Description The multi code specifying which forums this is applicable in.
Type SHORT_TEXT

Name use_default_forums
Description Whether to use this as the default post in applicable forum.
Type BINARY

Returns…

Description The added ID
Type AUTO_LINK

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

void ocf_make_emoticon(SHORT_TEXT code, ID_TEXT theme_img_code, integer relevance_level, BINARY use_topics, BINARY is_special)

Make an emoticon.

Parameters…

Name code
Description The textual code entered to make the emoticon appear.
Type SHORT_TEXT

Name theme_img_code
Description The image code used for the emoticon.
Type ID_TEXT

Name relevance_level
Description The relevance level.
Default value 1
Type integer
Value range 0 4

Name use_topics
Description Whether this may be used as a topic emoticon.
Default value 1
Type BINARY

Name is_special
Description Whether this may only be used by privileged members
Default value 0
Type BINARY

(No return value)


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

AUTO_LINK ocf_make_welcome_email(SHORT_TEXT name, SHORT_TEXT subject, LONG_TEXT text, integer send_time, ?AUTO_LINK newsletter)

Make a Welcome E-mail.

Parameters…

Name name
Description A name for the Welcome E-mail
Type SHORT_TEXT

Name subject
Description The subject of the Welcome E-mail
Type SHORT_TEXT

Name text
Description The message body of the Welcome E-mail
Type LONG_TEXT

Name send_time
Description The number of hours before sending the e-mail
Type integer

Name newsletter
Description What newsletter to send out to instead of members (NULL: none)
Default value 0
Type ?AUTO_LINK

Returns…

Description The ID
Type AUTO_LINK

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

sources/ocf_moderation.php

Global_functions_ocf_moderation.php

Function summary

array ocf_list_multi_moderations (AUTO_LINK forum_id)
boolean ocf_may_perform_multi_moderation (AUTO_LINK forum_id, ?MEMBER member_id)
boolean ocf_may_warn_members (?MEMBER member_id)
array ocf_get_warnings (MEMBER member_id)

array ocf_list_multi_moderations(AUTO_LINK forum_id)

List all the multi moderations that may be used in a certain forum.

Parameters…

Name forum_id
Description The forum we are listing for.
Type AUTO_LINK

Returns…

Description List of multi moderations.
Type array

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

boolean ocf_may_perform_multi_moderation(AUTO_LINK forum_id, ?MEMBER member_id)

Whether a certain member may perform multi moderations in a certain forum.

Parameters…

Name forum_id
Description The forum.
Type AUTO_LINK

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

Returns…

Description Answer.
Type boolean

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

boolean ocf_may_warn_members(?MEMBER member_id)

Whether a certain member may give formal warnings to other members.

Parameters…

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

Returns…

Description Answer.
Type boolean

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

array ocf_get_warnings(MEMBER member_id)

Get all the warning rows for a certain member.

Parameters…

Name member_id
Description The member.
Type MEMBER

Returns…

Description The warning rows.
Type array

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

sources/ocf_moderation_action.php

Global_functions_ocf_moderation_action.php

Function summary

AUTO_LINK ocf_make_multi_moderation (SHORT_TEXT name, LONG_TEXT post_text, ?AUTO_LINK move_to, BINARY pin_state, BINARY sink_state, BINARY open_state, SHORT_TEXT forum_multi_code, SHORT_TEXT title_suffix)

AUTO_LINK ocf_make_multi_moderation(SHORT_TEXT name, LONG_TEXT post_text, ?AUTO_LINK move_to, BINARY pin_state, BINARY sink_state, BINARY open_state, SHORT_TEXT forum_multi_code, SHORT_TEXT title_suffix)

Add a multi moderation to the system.

Parameters…

Name name
Description The name of the multi moderation.
Type SHORT_TEXT

Name post_text
Description The post text to add when applying (blank: don't add a post).
Type LONG_TEXT

Name move_to
Description The forum to move the topic when applying (NULL: do not move).
Type ?AUTO_LINK

Name pin_state
Description The pin state after applying.
Type BINARY

Name sink_state
Description The sink state after applying.
Type BINARY

Name open_state
Description The open state after applying.
Type BINARY

Name forum_multi_code
Description The forum multi code for where this multi moderation may be applied.
Default value *
Type SHORT_TEXT

Name title_suffix
Description The title suffix.
Default value
Type SHORT_TEXT

Returns…

Description The ID of the multi moderation just added.
Type AUTO_LINK

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