Home  ›  Plugin API  ›  Pluggable Functions

Pluggable Functions

Most of the page rendering code within Simple:Press Forum is constructed of ‘pluggable functions’. This makes them easy for users to replace our display functions with their own without having to edit the plugin code. This pluggable feature allows for major customization to the look and feel of the forum that goes well beyond CSS and program hooks.

To use pluggable functions, find the file sf-pluggable.txt (simple-forum/forum/sf-pluggable.txt) and rename it to sf-pluggabe.php prior to writing any code. Save it in the same directory that sf-pluggable.txt was located in. To replace any SPF display function, simply copy the current function from the SPF core code and paste it into the pluggable file ‘sf-pluggable.php’. Do NOT remove the original function from the core code.

Then, within sf-pluggable.php, for the routine you want to provide your own display function, remove the ‘if(!function_exists()’ call on the first line and the ‘endif’ line at the end. Then make whatever changes you wish to our base display code. You can, if you like, replace the entire function.

The next time the forum is displayed, it will use this new ‘plugged’ function instead of the original display function. For further information on each the pluggable functions, please consult the comments in the actual SPF core code.

The SPF functions which are pluggable consist of:

Page View Components (simple-forum/forum/sf-page-components.php):

sf_render_queued_message
sf_render_lockdown
sf_render_admin_strip
sf_render_login_strip
sf_render_login_form
sf_render_sub_count
sf_render_watch_count
sf_render_inbox_count
sf_render_custom_icons
sf_render_searchbar
sf_render_searchform
sf_render_breadcrumbs
sf_pn_next
sf_pn_previous
sf_pn_url
sf_render_main_header_table
sf_render_inline_pagelinks
sf_render_topic_statusflag
sf_render_first_last_post_cell
sf_render_bottom_iconstrip
sf_render_stats
sf_render_online_stats
sf_render_forum_stats
sf_render_member_stats
sf_render_ownership
sf_render_forum_quicklinks
sf_render_newpost_quicklinks
sf_render_admin_quicklinks

Group View Components (simple-forum/forum/sf-group-components.php)

sf_render_group_column_header_row
sf_render_forum_entry_row
sf_render_forum_title
sf_render_forum_status_icons
sf_render_forum_pagelinks
sf_render_special_group_message

Forum View Components (simple-forum/forum/sf-forum-components.php)

sf_render_search_heading
sf_compile_paged_topics
sf_render_topic_pagelinks
sf_render_forum_icon_legend
sf_render_special_forum_message
sf_render_forum_column_header_row
sf_render_topic_entry_row
sf_render_topic_icon
sf_render_topic_title
sf_render_topic_lock_icon
sf_render_topic_pinned_icon
sf_render_user_subscribed_icon
sf_render_user_watching_icon
sf_render_bloglink_icon
sf_render_topic_tag_dropdown
sf_render_topic_status_dropdown
sf_render_topic_tools
sf_render_searchall_column_header_row
sf_render_searchall_entry_row
sf_render_topic_ratings

Topic View Components (simple-forum/forum/sf-topic-components.php)

sf_compile_paged_posts
sf_render_post_pagelinks
sf_render_topic_icon_legend
sf_render_topic_column_header_row
sf_render_poster_details_above
sf_render_poster_details_side
sf_render_online_status
sf_render_post_icon_strip
sf_render_post_content
sf_render_signature_strip
sf_render_topic_status_updater
sf_render_post_user_quoteicon
sf_render_report_post_icon
sf_render_post_user_sendpmicon
sf_render_post_user_editicon
sf_render_post_ratings
sf_render_post_editicons

Common Display Components (simple-forum/library/sf-common-display.php)

sf_render_group_forum_select
sf_render_usertype
sf_render_user_ranking
sf_render_avatar
sf_render_topic_tags

Common Display Components (simple-forum/linking/sf-links-blog.php)

sf_blog_show_link

Common Display Components (simple-forum/credentials/sf-new-user-email.php)

wp_new_user_notification

Article written by steve on January 24, 2010 and last modified by steve on January 24, 2010