<?php /*

 ocPortal
 Copyright (c) ocProducts, 2004-2012

 See text/EN/licence.txt for full licencing information.


 NOTE TO PROGRAMMERS:
   Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
   **** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****

*/

/**
 * @license		http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright	ocProducts Ltd
 * @package		ocf_forum
 */

class Hook_addon_registry_ocf_forum
{
	/**
	 * Get a list of file permissions to set
	 *
	 * @return array			File permissions to set
	 */
	function get_chmod_array()
	{
		return array();
	}

	/**
	 * Get the version of ocPortal this addon is for
	 *
	 * @return float			Version number
	 */
	function get_version()
	{
		return ocp_version_number();
	}

	/**
	 * Get the description of the addon
	 *
	 * @return string			Description of the addon
	 */
	function get_description()
	{
		return 'The OCF forum- a modern advanced forum for members to interact on.';
	}

	/**
	 * Get a mapping of dependency types
	 *
	 * @return array			File permissions to set
	 */
	function get_dependencies()
	{
		return array(
			'requires'=>array(
				'polls'
			),
			'recommends'=>array(),
			'conflicts_with'=>array()
		);
	}

	/**
	 * Get a list of files that belong to this addon
	 *
	 * @return array			List of files
	 */
	function get_file_list()
	{
		return array(
			'sources/hooks/systems/notifications/ocf_topic_invite.php',
			'sources/hooks/systems/notifications/ocf_new_pt.php',
			'sources/hooks/systems/notifications/ocf_topic.php',
			'sources/hooks/systems/notifications/ocf_password_changed.php',
			'themes/default/images/bigicons/forums.png',
			'sources/hooks/systems/content_meta_aware/forum.php',
			'sources/hooks/systems/content_meta_aware/topic.php',
			'sources/hooks/systems/content_meta_aware/post.php',
			'sources/hooks/modules/admin_stats/ocf_posting_rates.php',
			'themes/default/images/bigicons/statistics_posting_rates.png',
			'OCF_BIRTHDAY_LINK.tpl',
			'OCF_FORUM_INTRO_QUESTION_POPUP.tpl',
			'OCF_MEMBER_PT_RULES_SCREEN.tpl',
			'OCF_POSTING_SCREEN_POST.tpl',
			'OCF_PT_BETWEEN.tpl',
			'JAVASCRIPT_OCF_FORUM.tpl',
			'forum/rules.php',
			'themes/default/images/ocf_general/redirect.png',
			'sources/hooks/modules/search/ocf_within_topic.php',
			'sources/hooks/systems/addon_registry/ocf_forum.php',
			'sources/hooks/systems/do_next_menus/ocf_forum.php',
			'sources/hooks/modules/admin_themewizard/ocf_forum.php',
			'sources/hooks/modules/admin_setupwizard/ocf_forum.php',
			'sources/hooks/modules/admin_import_types/ocf_forum.php',
			'sources/hooks/systems/profiles_tabs/posts.php',
			'sources/hooks/systems/profiles_tabs/pts.php',
			'OCF_EDIT_FORUM_SCREEN.tpl',
			'OCF_EDIT_FORUM_SCREEN_GROUPING.tpl',
			'OCF_EDIT_FORUM_SCREEN_FORUM.tpl',
			'OCF_FORUM.tpl',
			'OCF_FORUM_SCREEN.tpl',
			'OCF_FORUM_GROUPING.tpl',
			'OCF_FORUM_INTRO_QUESTION_SCREEN.tpl',
			'OCF_FORUM_IN_GROUPING.tpl',
			'OCF_FORUM_LATEST.tpl',
			'OCF_FORUM_TOPIC_ROW.tpl',
			'OCF_FORUM_TOPIC_ROW_LAST_POST.tpl',
			'OCF_FORUM_TOPIC_WRAPPER.tpl',
			'OCF_GUEST_BAR.tpl',
			'OCF_GUEST_DETAILS.tpl',
			'OCF_HISTORY_SCREEN.tpl',
			'OCF_HISTORY_POST.tpl',
			'OCF_POST_BOX.tpl',
			'OCF_MEMBER_BAR.tpl',
			'MEMBER_BAR_SEARCH.tpl',
			'OCF_NOTIFICATION.tpl',
			'BLOCK_MAIN_PT_NOTIFICATIONS.tpl',
			'OCF_PINNED_DIVIDER.tpl',
			'OCF_POSTER_GUEST.tpl',
			'OCF_POSTER_MEMBER.tpl',
			'OCF_POSTING_SCREEN_POSTS.tpl',
			'OCF_QUOTE_FCOMCODE.tpl',
			'BLOCK_MAIN_BOTTOM_BAR.tpl',
			'OCF_TOPIC_EMOTICON.tpl',
			'OCF_TOPIC_EMOTICON_NONE.tpl',
			'OCF_TOPIC_FIRST_UNREAD.tpl',
			'OCF_TOPIC_MARKER.tpl',
			'OCF_TOPIC_POLL.tpl',
			'OCF_TOPIC_POLL_ANSWER.tpl',
			'OCF_TOPIC_POLL_ANSWER_RADIO.tpl',
			'OCF_TOPIC_POLL_ANSWER_RESULTS.tpl',
			'OCF_TOPIC_POLL_BUTTON.tpl',
			'OCF_TOPIC_POLL_VIEW_RESULTS.tpl',
			'OCF_TOPIC_POST.tpl',
			'OCF_MEMBER_BOX_CUSTOM_FIELD.tpl',
			'OCF_TOPIC_ROW_LINK.tpl',
			'OCF_TOPIC_ROW_MODIFIER.tpl',
			'OCF_TOPIC_SCREEN.tpl',
			'OCF_WHISPER_CHOICE_SCREEN.tpl',
			'BLOCK_SIDE_OCF_PRIVATE_TOPICS.tpl',
			'OCF_TOPIC_POST_LAST_EDITED.tpl',
			'OCF_FORUM_LIST_LINE.tpl',
			'OCF_FORUM_TOPIC_LIST_LINE.tpl',
			'OCF_VFORUM_SCREEN.tpl',
			'forum/index.php',
			'forum/pages/comcode/.htaccess',
			'forum/pages/comcode/EN/.htaccess',
			'forum/pages/comcode/EN/index.html',
			'forum/pages/comcode/EN/panel_left.txt',
			'forum/pages/comcode/index.html',
			'forum/pages/comcode_custom/.htaccess',
			'forum/pages/comcode_custom/EN/.htaccess',
			'forum/pages/comcode_custom/EN/index.html',
			'forum/pages/comcode_custom/index.html',
			'forum/pages/html/.htaccess',
			'forum/pages/html/EN/.htaccess',
			'forum/pages/html/EN/index.html',
			'forum/pages/html/index.html',
			'forum/pages/html_custom/EN/.htaccess',
			'forum/pages/html_custom/EN/index.html',
			'forum/pages/html_custom/index.html',
			'forum/pages/index.html',
			'forum/pages/minimodules/.htaccess',
			'forum/pages/minimodules/index.html',
			'forum/pages/minimodules_custom/.htaccess',
			'forum/pages/minimodules_custom/index.html',
			'forum/pages/modules/.htaccess',
			'forum/pages/modules/forumview.php',
			'forum/pages/modules/index.html',
			'forum/pages/modules/topics.php',
			'forum/pages/modules/topicview.php',
			'forum/pages/modules/vforums.php',
			'forum/pages/modules_custom/.htaccess',
			'forum/pages/modules_custom/index.html',
			'adminzone/pages/modules/admin_ocf_categories.php',
			'adminzone/pages/modules/admin_ocf_forums.php',
			'adminzone/pages/modules/admin_ocf_history.php',
			'themes/default/images/ocf_general/index.html',
			'themes/default/images/ocf_general/new_posts.png',
			'themes/default/images/ocf_general/new_posts_redirect.png',
			'themes/default/images/ocf_general/no_new_posts.png',
			'themes/default/images/ocf_general/no_new_posts_redirect.png',
			'themes/default/images/ocf_rank_images/0.png',
			'themes/default/images/ocf_rank_images/1.png',
			'themes/default/images/ocf_rank_images/2.png',
			'themes/default/images/ocf_rank_images/3.png',
			'themes/default/images/ocf_rank_images/4.png',
			'themes/default/images/ocf_rank_images/admin.png',
			'themes/default/images/ocf_rank_images/index.html',
			'themes/default/images/ocf_rank_images/mod.png',
			'themes/default/images/ocf_topic_modifiers/announcement.png',
			'themes/default/images/ocf_topic_modifiers/closed.png',
			'themes/default/images/ocf_topic_modifiers/hot.png',
			'themes/default/images/ocf_topic_modifiers/index.html',
			'themes/default/images/ocf_topic_modifiers/involved.png',
			'themes/default/images/ocf_topic_modifiers/pinned.png',
			'themes/default/images/ocf_topic_modifiers/sunk.png',
			'themes/default/images/ocf_topic_modifiers/poll.png',
			'themes/default/images/ocf_topic_modifiers/unread.png',
			'themes/default/images/ocf_topic_modifiers/unvalidated.png',
			'sources/blocks/side_ocf_personal_topics.php',
			'sources/hooks/modules/admin_cleanup/ocf_topics.php',
			'sources/hooks/modules/admin_newsletter/ocf_forumview.php',
			'sources/hooks/modules/admin_unvalidated/ocf_posts.php',
			'sources/hooks/modules/admin_unvalidated/ocf_topics.php',
			'sources/hooks/modules/search/ocf_own_pt.php',
			'sources/hooks/modules/search/ocf_posts.php',
			'sources/hooks/systems/attachments/ocf_post.php',
			'sources/hooks/systems/preview/ocf_post.php',
			'sources/hooks/systems/rss/ocf_forumview.php',
			'sources/hooks/systems/rss/ocf_topicview.php',
			'sources/blocks/main_bottom_bar.php',
			'sources/blocks/main_member_bar.php',
			'sources/blocks/main_pt_notifications.php',
			'BLOCK_MAIN_MEMBER_BAR.tpl',
			'sources/ocf_forumview.php',
			'sources/ocf_forumview_pt.php',
			'sources/ocf_topicview.php',
			'sources/hooks/systems/awards/forum.php',
			'sources/hooks/systems/awards/post.php',
			'sources/hooks/systems/awards/topic.php',
			'themes/default/images/EN/page/forum.png',
			'themes/default/images/EN/page/threaded.png',
			'themes/default/images/EN/page/linear.png',
			'themes/default/images/EN/page/send_message.png',
			'themes/default/images/EN/page/mark_read.png',
			'themes/default/images/EN/page/mark_unread.png',
			'themes/default/images/EN/page/new_post.png',
			'themes/default/images/EN/page/new_topic.png',
			'themes/default/images/EN/page/quick_reply.png',
			'themes/default/images/EN/page/reply.png',
			'themes/default/images/EN/pageitem/quote.png',
			'themes/default/images/EN/pageitem/reply.png',
			'themes/default/images/EN/pageitem/whisper.png',
			'themes/default/images/EN/pageitem/send_message.png',
			'themes/default/images/birthday_icon.png',
			'themes/default/images/pagepics/forums.png',
			'sources/hooks/modules/topicview/.htaccess',
			'sources/hooks/modules/topicview/index.html',
			'sources/hooks/systems/ajax_tree/choose_forum_topic.php',
			'sources/hooks/systems/ajax_tree/choose_forum.php',
			'sources/hooks/systems/rss/ocf_unread_topics.php',
			'sources/hooks/systems/rss/ocf_personal_topics.php',
			'TOPIC_LIST.tpl',
			'OCF_PT_FILTERS.tpl',
			'OCF_MEMBER_PROFILE_POSTS.tpl'
		);
	}


	/**
	 * Get mapping between template names and the method of this class that can render a preview of them
	 *
	 * @return array			The mapping
	 */
	function tpl_previews()
	{
		return array(
			'OCF_TOPIC_POST_AVATAR.tpl'=>'ocf_topic_screen',
			'OCF_FORUM_TOPIC_WRAPPER.tpl'=>'ocf_forum',
			'OCF_EDIT_FORUM_SCREEN_GROUPING.tpl'=>'administrative__ocf_edit_forum_screen',
			'OCF_USER_MEMBER.tpl'=>'ocf_topic_screen',
			'OCF_MEMBER_BOX.tpl'=>'ocf_topic_screen',
			'OCF_EDIT_FORUM_SCREEN_FORUM.tpl'=>'administrative__ocf_edit_forum_screen',
			'OCF_EDIT_FORUM_SCREEN.tpl'=>'administrative__ocf_edit_forum_screen',
			'OCF_HISTORY_POST.tpl'=>'administrative__ocf_history_screen',
			'OCF_HISTORY_SCREEN.tpl'=>'administrative__ocf_history_screen',
			'OCF_RANK_IMAGE.tpl'=>'ocf_rank_image',
			'OCF_POST_BOX.tpl'=>'ocf_isolated_post',
			'BLOCK_SIDE_OCF_PRIVATE_TOPICS.tpl'=>'block_side_ocf_personal_topics',
			'BLOCK_MAIN_PT_NOTIFICATIONS.tpl'=>'block_pt_notifications',
			'OCF_NOTIFICATION.tpl'=>'block_pt_notifications',
			'OCF_FORUM_TOPIC_ROW_LAST_POST.tpl'=>'ocf_forum',
			'OCF_TOPIC_ROW_LINK.tpl'=>'ocf_forum',
			'OCF_TOPIC_ROW_MODIFIER.tpl'=>'ocf_forum',
			'OCF_TOPIC_EMOTICON.tpl'=>'ocf_forum',
			'OCF_TOPIC_EMOTICON_NONE.tpl'=>'ocf_forum',
			'OCF_PT_BETWEEN.tpl'=>'ocf_forum',
			'OCF_TOPIC_MARKER.tpl'=>'ocf_forum',
			'OCF_FORUM_TOPIC_ROW.tpl'=>'ocf_forum',
			'OCF_FORUM_TOPIC_LIST_LINE.tpl'=>'ocf_forum_topic_list_line',
			'OCF_FORUM_LIST_LINE.tpl'=>'ocf_forum_list_line',
			'OCF_FORUM_INTRO_QUESTION_POPUP.tpl'=>'ocf_forum_intro_question_popup',
			'OCF_MEMBER_BOX_CUSTOM_FIELD.tpl'=>'ocf_topic_screen',
			'OCF_POSTER_MEMBER.tpl'=>'ocf_topic_screen',
			'OCF_GUEST_DETAILS.tpl'=>'ocf_topic_screen',
			'OCF_POSTER_GUEST.tpl'=>'ocf_isolated_post',
			'OCF_TOPIC_POST_LAST_EDITED.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_POST.tpl'=>'ocf_topic_screen',
			'OCF_MEMBER_BAR.tpl'=>'block_main_member_bar_member',
			'MEMBER_BAR_SEARCH.tpl'=>'block_main_member_bar_search',
			'OCF_GUEST_BAR.tpl'=>'block_main_member_bar_guest',
			'OCF_BIRTHDAYS.tpl'=>'block_main_bottom_bar',
			'OCF_BIRTHDAY_LINK.tpl'=>'block_main_bottom_bar',
			'BLOCK_MAIN_MEMBER_BAR.tpl'=>'block_main_member_bar_member',
			'BLOCK_MAIN_BOTTOM_BAR.tpl'=>'block_main_bottom_bar',
			'OCF_FORUM_INTRO_QUESTION_SCREEN.tpl'=>'ocf_forum_intro_question_screen',
			'OCF_FORUM_LATEST.tpl'=>'ocf_forum',
			'OCF_FORUM_IN_GROUPING.tpl'=>'ocf_forum',
			'OCF_FORUM_GROUPING.tpl'=>'ocf_forum',
			'OCF_PINNED_DIVIDER.tpl'=>'ocf_forum',
			'OCF_FORUM.tpl'=>'ocf_forum',
			'OCF_FORUM_SCREEN.tpl'=>'ocf_forum',
			'OCF_VFORUM_SCREEN.tpl'=>'ocf_vforum',
			'OCF_WHISPER_CHOICE_SCREEN.tpl'=>'ocf_whisper_choice_screen',
			'OCF_QUOTE_FCOMCODE.tpl'=>'ocf_quote_fcomcode',
			'OCF_MEMBER_PT_RULES_SCREEN.tpl'=>'ocf_member_pt_rules_screen',
			'OCF_POSTING_SCREEN_POST.tpl'=>'ocf_posting_screen_posts',
			'OCF_POSTING_SCREEN_POSTS.tpl'=>'ocf_posting_screen_posts',
			'OCF_TOPIC_FIRST_UNREAD.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_POLL_BUTTON.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_POLL_ANSWER_RESULTS.tpl'=>'ocf_topic_voted_wrap',
			'OCF_TOPIC_POLL_ANSWER.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_POLL_ANSWER_RADIO.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_POLL.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_SCREEN.tpl'=>'ocf_topic_screen',
			'NOTIFICATION_BUTTONS.tpl'=>'ocf_topic_screen',
			'OCF_TOPIC_POLL_VIEW_RESULTS.tpl'=>'ocf_topic_voted_wrap',
			'TOPIC_LIST.tpl'=>'topic_list',
			'OCF_PT_FILTERS.tpl'=>'ocf_forum',
			'OCF_MEMBER_PROFILE_POSTS.tpl'=>'ocf_member_profile_posts'
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__topic_list()
	{
		require_css('ocf');

		return array(
			lorem_globalise(do_lorem_template('TOPIC_LIST', array(
				'POSTER_URL'=>placeholder_url(),
				'TOPIC_URL'=>placeholder_url(),
				'TITLE'=>lorem_phrase(),
				'DATE'=>placeholder_time(),
				'DATE_RAW'=>placeholder_date_raw(),
				'USERNAME'=>lorem_word(),
				'NUM_POSTS'=>placeholder_number()
			)), NULL, '', true)
		);
	}
	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__administrative__ocf_edit_forum_screen()
	{
		require_css('ocf');
		require_css('ocf_editor');

		require_lang('ocf');

		$orderings="<option>1</option><option>2</option><option>3</option>";

		$orderings='<label for="order_' . strval(1) . '">' . do_lang('ORDER') . ' <select id="order_' . strval(1) . '" name="order_' . strval(1) . '">' . $orderings . '</select></label>';

		$categories=do_lorem_template('OCF_EDIT_FORUM_SCREEN_GROUPING', array(
			'ORDERINGS'=>$orderings,
			'GROUPING'=>lorem_word_2(),
			'SUBFORUMS'=>lorem_phrase()
		));

		$root_forum=do_lorem_template('OCF_EDIT_FORUM_SCREEN_FORUM', array(
			'ID'=>placeholder_id(),
			'ORDERINGS'=>lorem_phrase(),
			'CATEGORIES'=>$categories,
			'CLASS'=>lorem_phrase(),
			'FORUM'=>lorem_phrase(),
			'VIEW_URL'=>placeholder_url(),
			'EDIT_URL'=>placeholder_url()
		));

		return array(
			lorem_globalise(do_lorem_template('OCF_EDIT_FORUM_SCREEN', array(
				'REORDER_URL'=>placeholder_url(),
				'TITLE'=>lorem_title(),
				'ROOT_FORUM'=>$root_forum
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__administrative__ocf_history_screen()
	{
		require_css('ocf');

		require_lang('ocf');

		$content=do_lorem_template('OCF_HISTORY_POST', array(
			'LABEL'=>lorem_phrase(),
			'LINK'=>placeholder_url(),
			'BUTTONS'=>lorem_phrase(),
			'ACTION'=>lorem_phrase(),
			'ACTION_DATE_AND_TIME'=>placeholder_time(),
			'ACTION_DATE_AND_TIME_RAW'=>placeholder_date_raw(),
			'CREATE_DATE_AND_TIME_RAW'=>placeholder_date_raw(),
			'CREATE_DATE_AND_TIME'=>placeholder_time(),
			'OWNER_MEMBER'=>lorem_phrase(),
			'ALTERER_MEMBER'=>lorem_phrase(),
			'BEFORE'=>lorem_phrase()
		));

		return array(
			lorem_globalise(do_lorem_template('OCF_HISTORY_SCREEN', array(
				'PAGINATION'=>placeholder_pagination(),
				'TITLE'=>lorem_title(),
				'CONTENT'=>$content
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_rank_image()
	{
		require_css('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_RANK_IMAGE', array(
				'GROUP_NAME'=>lorem_word(),
				'USERNAME'=>lorem_word(),
				'IMG'=>placeholder_img_code(''),
				'IS_LEADER'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_isolated_post()
	{
		require_css('ocf');

		require_lang('ocf');

		$first_unread=do_lorem_template('OCF_TOPIC_FIRST_UNREAD');

		$last_edited=do_lorem_template('OCF_TOPIC_POST_LAST_EDITED', array(
			'LAST_EDIT_DATE_RAW'=>placeholder_date_raw(),
			'LAST_EDIT_DATE'=>placeholder_date(),
			'LAST_EDIT_PROFILE_URL'=>placeholder_url(),
			'LAST_EDIT_USERNAME'=>lorem_word()
		));

		$custom_fields=do_lorem_template('OCF_MEMBER_BOX_CUSTOM_FIELD', array(
			'NAME'=>lorem_phrase(),
			'VALUE'=>placeholder_ip()
		));

		$poster_details=do_lorem_template('OCF_GUEST_DETAILS', array(
			'CUSTOM_FIELDS'=>$custom_fields
		));

		$poster=do_lorem_template('OCF_POSTER_GUEST', array(
			'LOOKUP_IP_URL'=>placeholder_url(),
			'POSTER_DETAILS'=>$poster_details,
			'POSTER_USERNAME'=>lorem_word()
		));

		$post_avatar=do_lorem_template('OCF_TOPIC_POST_AVATAR', array(
			'AVATAR'=>placeholder_image_url()
		));

		$rank_images=do_lorem_template('OCF_RANK_IMAGE', array(
			'GROUP_NAME'=>lorem_phrase(),
			'USERNAME'=>lorem_word(),
			'IMG'=>'ocf_rank_images/' . placeholder_img_code('ocf_rank_images'),
			'IS_LEADER'=>lorem_phrase()
		));

		$buttons=do_lorem_template('SCREEN_ITEM_BUTTON', array(
			'REL'=>lorem_word(),
			'IMMEDIATE'=>false,
			'IMG'=>placeholder_img_code('pageitem'),
			'TITLE'=>lorem_phrase(),
			'URL'=>placeholder_url()
		));

		$post=do_lorem_template('OCF_TOPIC_POST', array(
			'ID'=>placeholder_id(),
			'TOPIC_FIRST_POST_ID'=>placeholder_id(),
			'TOPIC_FIRST_POSTER'=>lorem_phrase(),
			'POST_ID'=>placeholder_id(),
			'URL'=>placeholder_url(),
			'CLASS'=>lorem_phrase(),
			'EMPHASIS'=>lorem_phrase(),
			'FIRST_UNREAD'=>$first_unread,
			'POSTER_TITLE'=>lorem_phrase(),
			'POST_TITLE'=>lorem_phrase(),
			'POST_DATE_RAW'=>placeholder_date_raw(),
			'POST_DATE'=>placeholder_time(),
			'POST'=>lorem_phrase(),
			'TOPIC_ID'=>placeholder_id(),
			'LAST_EDITED_RAW'=>lorem_phrase(),
			'LAST_EDITED'=>$last_edited,
			'POSTER_ID'=>placeholder_id(),
			'POSTER'=>$poster,
			'POSTER_DETAILS'=>$poster_details,
			'POST_AVATAR'=>$post_avatar,
			'RANK_IMAGES'=>$rank_images,
			'BUTTONS'=>$buttons,
			'SIGNATURE'=>lorem_phrase(),
			'UNVALIDATED'=>lorem_phrase(),
			'DESCRIPTION'=>lorem_phrase()
		));

		return array(
			lorem_globalise(do_lorem_template('OCF_POST_BOX', array(
				'ID'=>placeholder_id(),
				'POST'=>$post,
				'URL'=>placeholder_url(),
				'BREADCRUMBS'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__block_side_ocf_personal_topics()
	{
		require_css('ocf');

		require_lang('ocf');

		$out=new ocp_tempcode();
		foreach (placeholder_array() as $k=>$v)
		{
			$out->attach(do_lorem_template('TOPIC_LIST', array(
				'POSTER_URL'=>placeholder_url(),
				'TOPIC_URL'=>placeholder_url(),
				'TITLE'=>lorem_phrase(),
				'DATE'=>placeholder_time(),
				'DATE_RAW'=>placeholder_date_raw(),
				'USERNAME'=>lorem_word(),
				'NUM_POSTS'=>placeholder_number()
			)));
		}

		return array(
			lorem_globalise(do_lorem_template('BLOCK_SIDE_OCF_PRIVATE_TOPICS', array(
				'SEND_URL'=>placeholder_url(),
				'VIEW_URL'=>placeholder_url(),
				'CONTENT'=>$out,
				'FORUM_NAME'=>lorem_word_html()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_forum_topic_list_line()
	{
		require_css('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_FORUM_TOPIC_LIST_LINE', array(
				'PRE'=>lorem_phrase(),
				'TOPIC_TITLE'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_forum_list_line()
	{
		require_css('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_FORUM_LIST_LINE', array(
				'PRE'=>lorem_phrase(),
				'NAME'=>lorem_word(),
				'CAT_BIT'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_forum_intro_question_popup()
	{
		require_css('ocf');

		require_lang('ocf');

		$content=do_lorem_template('OCF_FORUM_INTRO_QUESTION_POPUP', array(
			'QUESTION'=>lorem_phrase(),
			'ANSWER'=>lorem_phrase()
		));

		return array(
			lorem_globalise($content, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__block_main_member_bar_guest()
	{
		require_css('ocf');

		require_lang('ocf');

		$bar=do_lorem_template('OCF_GUEST_BAR', array(
			'LOGIN_URL'=>placeholder_url(),
			'JOIN_URL'=>placeholder_url(),
			'FULL_LOGIN_URL'=>placeholder_url(),
			'INLINE_PERSONAL_POSTS_URL'=>placeholder_url()
		));

		$member_bar=do_lorem_template('BLOCK_MAIN_MEMBER_BAR',array('BAR'=>$bar));

		return array(
			lorem_globalise($member_bar, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__block_main_member_bar_search()
	{
		require_css('ocf');

		require_lang('ocf');

		$bar=do_template('MEMBER_BAR_SEARCH',array());

		return array(
			lorem_globalise($bar, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__block_main_member_bar_member()
	{
		require_css('ocf');

		require_lang('ocf');

		$details=new ocp_tempcode();
		$links=new ocp_tempcode();
		$details->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINE', array(
			'KEY'=>lorem_word(),
			'VALUE'=>placeholder_number()
		)));
		$links->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINK', array(
			'NAME'=>lorem_word(),
			'URL'=>placeholder_url(),
			'REL'=>'me'
		)));

		$bar=do_template('OCF_MEMBER_BAR',array(
				'AVATAR_URL'=>placeholder_image_url(),
				'PROFILE_URL'=>placeholder_url(),
				'USERNAME'=>lorem_phrase(),
				'LOGOUT_URL'=>placeholder_url(),
				'NUM_POINTS_ADVANCE'=>placeholder_number(),
				'NUM_POINTS'=>placeholder_number(),
				'NUM_POSTS'=>placeholder_number(),
				'PRIMARY_GROUP'=>lorem_phrase(),
				'LAST_VISIT_DATE_RAW'=>placeholder_date_raw(),
				'LAST_VISIT_DATE'=>placeholder_date(),
				'PRIVATE_TOPIC_URL'=>placeholder_url(),
				'NEW_POSTS_URL'=>placeholder_url(),
				'UNREAD_TOPICS_URL'=>placeholder_url(),
				'RECENTLY_READ_URL'=>placeholder_url(),
				'INLINE_PERSONAL_POSTS_URL'=>placeholder_url(),
				'PT_EXTRA'=>'',
				'NUM_UNREAD_PTS'=>placeholder_number(),
				'NEW_TOPICS'=>placeholder_number(),
				'NEW_POSTS'=>placeholder_number(),
				'MAX_AVATAR_HEIGHT'=>placeholder_number(),
				'LINKS'=>$links,
				'DETAILS'=>$details
		));

		$member_bar=do_lorem_template('BLOCK_MAIN_MEMBER_BAR',array('BAR'=>$bar));

		return array(
			lorem_globalise($member_bar, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__block_pt_notifications()
	{
		require_css('ocf');

		require_lang('ocf');

		$notifications=do_lorem_template('OCF_NOTIFICATION', array(
			'ADDITIONAL_POSTS'=>placeholder_number(),
			'_ADDITIONAL_POSTS'=>lorem_phrase(),
			'ID'=>placeholder_id(),
			'U_TITLE'=>lorem_phrase(),
			'IGNORE_URL'=>placeholder_url(),
			'IGNORE_URL_2'=>placeholder_url(),
			'REPLY_URL'=>placeholder_url(),
			'TOPIC_URL'=>placeholder_url(),
			'POST'=>lorem_phrase(),
			'DESCRIPTION'=>lorem_paragraph_html(),
			'TIME'=>placeholder_date(),
			'TIME_RAW'=>placeholder_date_raw(),
			'BY'=>lorem_phrase(),
			'PROFILE_URL'=>placeholder_url(),
			'TYPE'=>lorem_phrase()
		));

		$notifications_bar=do_lorem_template('BLOCK_MAIN_PT_NOTIFICATIONS',array('NOTIFICATIONS'=>$notifications));

		return array(
			lorem_globalise($notifications_bar, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__block_main_bottom_bar()
	{
		require_css('ocf');

		require_lang('ocf');

		$birthdays=new ocp_tempcode();
		foreach (placeholder_array() as $k=>$v)
		{
			$birthdays->attach(do_lorem_template('OCF_BIRTHDAY_LINK', array(
				'AGE'=>placeholder_number(),
				'PROFILE_URL'=>placeholder_url(),
				'USERNAME'=>lorem_word(),
				'BIRTHDAY_URL'=>placeholder_url()
			)));
		}
		$birthdays=do_lorem_template('OCF_BIRTHDAYS', array(
			'BIRTHDAYS'=>$birthdays
		));

		$foot=do_lorem_template('BLOCK_MAIN_BOTTOM_BAR', array(
			'NEWEST_MEMBER_PROFILE_URL'=>placeholder_url(),
			'NEWEST_MEMBER_USERNAME'=>lorem_word(),
			'NUM_MEMBERS'=>placeholder_number(),
			'NUM_TOPICS'=>placeholder_number(),
			'NUM_POSTS'=>placeholder_number(),
			'BIRTHDAYS'=>$birthdays,
			'USERS_ONLINE'=>lorem_phrase(),
			'USERS_ONLINE_URL'=>placeholder_url(),
			'page'=>lorem_phrase(),
			'GID'=>placeholder_id(),
			'GCOLOUR'=>lorem_word(),
			'GTITLE'=>lorem_word(),
			'GROUPS'=>placeholder_array()
		));

		return array(
			lorem_globalise($foot, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_forum_intro_question_screen()
	{
		require_css('ocf');

		require_lang('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_FORUM_INTRO_QUESTION_SCREEN', array(
				'ANSWER'=>lorem_phrase(),
				'TITLE'=>lorem_title(),
				'URL'=>placeholder_url(),
				'QUESTION'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_forum()
	{
		require_css('ocf');

		require_lang('ocf');

		//buttons
		$buttons=new ocp_tempcode();
		foreach (placeholder_array() as $k=>$v)
		{
			$buttons->attach(do_lorem_template('SCREEN_BUTTON', array(
				'REL'=>lorem_word(),
				'URL'=>placeholder_url(),
				'IMG'=>placeholder_img_code('page'),
				'TITLE'=>lorem_word(),
				'IMMEDIATE'=>false
			)));
		}


		//topics
		$topics=new ocp_tempcode();
		foreach (placeholder_array() as $k=>$v)
		{
			$marker=do_lorem_template('OCF_TOPIC_MARKER', array(
				'ID'=>placeholder_id()
			));

			$topic_row_links=do_lorem_template('OCF_TOPIC_ROW_LINK', array(
				'URL'=>placeholder_url(),
				'IMG'=>placeholder_img_code('ocf_topic_modifiers'),
				'ALT'=>lorem_phrase()
			));

			$topic_row_modifiers=do_lorem_template('OCF_TOPIC_ROW_MODIFIER', array(
				'IMG'=>placeholder_img_code('ocf_topic_modifiers'),
				'ALT'=>lorem_phrase()
			));

			$emoticon=do_lorem_template('OCF_TOPIC_EMOTICON', array(
				'EMOTICON'=>'ocf_emoticons/constipated'
			));
			$emoticon->attach(do_lorem_template('OCF_TOPIC_EMOTICON_NONE', array()));

			$b=do_lorem_template('OCF_USER_MEMBER', array(
				'COLOUR'=>lorem_word(),
				'PROFILE_URL'=>placeholder_url(),
				'USERNAME'=>lorem_word(),
				'AT'=>lorem_phrase()
			));

			$post=do_lorem_template('OCF_PT_BETWEEN', array(
				'A'=>lorem_phrase(),
				'B'=>$b
			));

			$last_post=do_lorem_template('OCF_FORUM_TOPIC_ROW_LAST_POST', array(
				'ID'=>placeholder_id(),
				'DATE_RAW'=>placeholder_date_raw(),
				'DATE'=>placeholder_time(),
				'POSTER'=>lorem_phrase(),
				'LAST_URL'=>placeholder_url()
			));

			$topics->attach(do_lorem_template('OCF_FORUM_TOPIC_ROW', array(
				'BREADCRUMBS'=>placeholder_breadcrumbs(),
				'RAW_TIME'=>placeholder_date_raw(),
				'UNREAD'=>lorem_phrase(),
				'ID'=>placeholder_random(),
				'HOVER'=>lorem_phrase(),
				'PAGES'=>lorem_phrase(),
				'MARKER'=>$marker,
				'TOPIC_ROW_LINKS'=>$topic_row_links,
				'TOPIC_ROW_MODIFIERS'=>$topic_row_modifiers,
				'POST'=>lorem_phrase(),
				'EMOTICON'=>$emoticon,
				'DESCRIPTION'=>lorem_paragraph(),
				'URL'=>placeholder_url(),
				'TITLE'=>lorem_phrase(),
				'POSTER'=>$post,
				'NUM_POSTS'=>placeholder_number(),
				'NUM_VIEWS'=>placeholder_number(),
				'LAST_POST'=>$last_post
			)));
		}


		//categories
		$categories=new ocp_tempcode();
		foreach (placeholder_array(1) as $k=>$v)
		{
			$forums=new ocp_tempcode();
			foreach (placeholder_array() as $_k=>$_v)
			{
				$poster=do_lorem_template('OCF_USER_MEMBER', array(
					'USERNAME'=>lorem_word(),
					'PROFILE_URL'=>placeholder_url(),
					'AT'=>lorem_phrase()
				));

				$latest=do_lorem_template('OCF_FORUM_LATEST', array(
					'DATE'=>placeholder_time(),
					'DATE_RAW'=>placeholder_date_raw(),
					'TOPIC_URL'=>placeholder_url(),
					'TOPIC_TITLE'=>lorem_phrase(),
					'POSTER'=>$poster,
					'MEMBER_ID'=>placeholder_id(),
					'ID'=>placeholder_id()
				));

				$forums->attach(do_lorem_template('OCF_FORUM_IN_GROUPING', array(
					'ID'=>placeholder_random(),
					'NEW_POST_OR_NOT'=>placeholder_img_code('ocf_general'),
					'LANG_NEW_POST_OR_NOT'=>lorem_word(),
					'FORUM_NAME'=>lorem_phrase(),
					'FORUM_URL'=>placeholder_url(),
					'DESCRIPTION'=>lorem_phrase(),
					'NUM_POSTS'=>placeholder_number(),
					'NUM_TOPICS'=>placeholder_number(),
					'LATEST'=>$latest,
					'SUBFORUMS'=>lorem_phrase(),
					'EDIT_URL'=>placeholder_url(),
					'FORUM_RULES_URL'=>placeholder_url(),
					'INTRO_QUESTION_URL'=>placeholder_url()
				)));
				if ($_k==1)
					$forums->attach(do_lorem_template('OCF_PINNED_DIVIDER', array()));
			}

			$categories->attach(do_lorem_template('OCF_FORUM_GROUPING', array(
				'GROUPING_ID'=>placeholder_random(),
				'EXPAND_TYPE'=>'expand',
				'DISPLAY'=>'',
				'GROUPING_TITLE'=>lorem_phrase(),
				'GROUPING_DESCRIPTION'=>lorem_phrase(),
				'FORUMS'=>$forums
			)));
		}

		$filters=do_lorem_template('OCF_PT_FILTERS', array(
			'FILTERS'=>array(),
			'RESET_URL'=>placeholder_url()
		));

		$pagination=placeholder_pagination();
		$topic_wrapper=do_lorem_template('OCF_FORUM_TOPIC_WRAPPER', array(
			'TYPE'=>'misc',
			'MAX'=>lorem_phrase(),
			'ORDER'=>lorem_phrase(),
			'MAY_CHANGE_MAX'=>lorem_phrase(),
			'TREE'=>lorem_phrase(),
			'BUTTONS'=>$buttons,
			'STARTER_TITLE'=>lorem_phrase(),
			'PAGINATION'=>$pagination,
			'MODERATOR_ACTIONS'=>placeholder_options(),
			'ACTION_URL'=>placeholder_url(),
			'TOPICS'=>$topics,
			'FORUM_NAME'=>lorem_word()
		));
		$content=do_lorem_template('OCF_FORUM', array(
			'BREADCRUMBS'=>placeholder_breadcrumbs(),
			'FILTERS'=>$filters,
			'FORUM_NAME'=>lorem_word_html(),
			'STARTER_TITLE'=>lorem_phrase(),
			'BUTTONS'=>$buttons,
			'TOPIC_WRAPPER'=>$topic_wrapper,
			'CATEGORIES'=>$categories,
			'ID'=>placeholder_id(),
			'DESCRIPTION'=>lorem_phrase()
		));

		$screen=do_lorem_template('OCF_FORUM_SCREEN', array(
			'TITLE'=>lorem_title(),
			'CONTENT'=>$content,
		));

		return array(
			lorem_globalise($screen, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_vforum()
	{
		require_css('ocf');

		require_lang('ocf');

		$content=do_lorem_template('OCF_VFORUM_SCREEN', array(
			'TITLE'=>lorem_title(),
			'CONTENT'=>lorem_phrase()
		));

		return array(
			lorem_globalise($content, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_whisper_choice_screen()
	{
		require_css('ocf');

		require_lang('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_WHISPER_CHOICE_SCREEN', array(
				'URL'=>placeholder_url(),
				'TITLE'=>lorem_title(),
				'USERNAME'=>lorem_word()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_quote_fcomcode()
	{
		require_css('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_QUOTE_FCOMCODE', array(
				'ID'=>placeholder_id(),
				'TITLE'=>lorem_phrase(),
				'POST'=>lorem_phrase(),
				'BY'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_member_pt_rules_screen()
	{
		require_css('ocf');

		require_lang('ocf');

		return array(
			lorem_globalise(do_lorem_template('OCF_MEMBER_PT_RULES_SCREEN', array(
				'TITLE'=>lorem_title(),
				'USERNAME'=>lorem_word(),
				'MEMBER_ID'=>placeholder_id(),
				'URL'=>placeholder_url(),
				'RULES'=>lorem_phrase()
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_posting_screen_posts()
	{
		require_css('ocf');

		require_lang('ocf');

		$posts=new ocp_tempcode();
		foreach (placeholder_array() as $k=>$v)
		{
			$post=do_lorem_template('OCF_POST_BOX', array(
				'ID'=>placeholder_id(),
				'POST'=>placeholder_fields_as_divs(),
				'MAIN_TITLE'=>lorem_word(),
				'TITLE'=>lorem_phrase(),
				'URL'=>placeholder_url(),
				'DATE'=>placeholder_time(),
				'POSTER'=>lorem_phrase(),
				'BREADCRUMBS'=>lorem_phrase()
			));
			$posts->attach(do_lorem_template('OCF_POSTING_SCREEN_POST', array(
				'TITLE'=>lorem_phrase(),
				'ID'=>placeholder_id(),
				'POSTER'=>lorem_phrase(),
				'POST'=>$post
			)));
		}

		return array(
			lorem_globalise(do_lorem_template('OCF_POSTING_SCREEN_POSTS', array(
				'POSTS'=>$posts
			)), NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_member_profile_posts()
	{
		require_css('ocf');

		//topics
		$topics=new ocp_tempcode();
		if (addon_installed('ocf_forum'))
		{
			foreach (placeholder_array() as $k=>$v)
			{
				$marker=do_lorem_template('OCF_TOPIC_MARKER', array(
					'ID'=>placeholder_id()
				));

				$topic_row_links=do_lorem_template('OCF_TOPIC_ROW_LINK', array(
					'URL'=>placeholder_url(),
					'IMG'=>placeholder_img_code('ocf_topic_modifiers'),
					'ALT'=>lorem_phrase()
				));

				$topic_row_modifiers=do_lorem_template('OCF_TOPIC_ROW_MODIFIER', array(
					'IMG'=>placeholder_img_code('ocf_topic_modifiers'),
					'ALT'=>lorem_phrase()
				));

				$emoticon=do_lorem_template('OCF_TOPIC_EMOTICON', array(
					'EMOTICON'=>'ocf_emoticons/depressed'
				));

				$b=do_lorem_template('OCF_USER_MEMBER', array(
					'COLOUR'=>lorem_word(),
					'PROFILE_URL'=>placeholder_url(),
					'USERNAME'=>lorem_word(),
					'AT'=>lorem_phrase()
				));

				$post=do_lorem_template('OCF_PT_BETWEEN', array(
					'A'=>lorem_phrase(),
					'B'=>$b
				));

				$last_post=do_lorem_template('OCF_FORUM_TOPIC_ROW_LAST_POST', array(
					'ID'=>placeholder_id(),
					'DATE_RAW'=>placeholder_date_raw(),
					'DATE'=>placeholder_time(),
					'POSTER'=>lorem_phrase(),
					'LAST_URL'=>placeholder_url()
				));

				$topics->attach(do_lorem_template('OCF_FORUM_TOPIC_ROW', array(
					'BREADCRUMBS'=>placeholder_breadcrumbs(),
					'RAW_TIME'=>placeholder_date_raw(),
					'UNREAD'=>lorem_phrase(),
					'ID'=>placeholder_id(),
					'HOVER'=>lorem_phrase(),
					'PAGES'=>lorem_phrase(),
					'MARKER'=>$marker,
					'TOPIC_ROW_LINKS'=>$topic_row_links,
					'TOPIC_ROW_MODIFIERS'=>$topic_row_modifiers,
					'POST'=>lorem_phrase(),
					'EMOTICON'=>$emoticon,
					'DESCRIPTION'=>lorem_paragraph(),
					'URL'=>placeholder_url(),
					'TITLE'=>lorem_phrase(),
					'POSTER'=>$post,
					'NUM_POSTS'=>placeholder_number(),
					'NUM_VIEWS'=>placeholder_number(),
					'LAST_POST'=>$last_post
				)));
			}
		}

		$pagination=placeholder_pagination();

		$buttons=lorem_phrase();

		$topic_wrapper=do_lorem_template('OCF_FORUM_TOPIC_WRAPPER', array(
			'TYPE'=>'',
			'MAX'=>lorem_phrase(),
			'ORDER'=>lorem_phrase(),
			'MAY_CHANGE_MAX'=>lorem_phrase(),
			'TREE'=>lorem_phrase(),
			'BUTTONS'=>$buttons,
			'STARTER_TITLE'=>lorem_phrase(),
			'PAGINATION'=>$pagination,
			'MODERATOR_ACTIONS'=>placeholder_options(),
			'ACTION_URL'=>placeholder_url(),
			'TOPICS'=>$topics,
			'FORUM_NAME'=>lorem_word()
		));

		$tab_content=do_lorem_template('OCF_MEMBER_PROFILE_POSTS', array(
			'MEMBER_ID'=>placeholder_id(),
			'TOPICS'=>$topic_wrapper
		));
		return array(
			lorem_globalise($tab_content, NULL, '', true)
		);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_topic_screen()
	{
		return $this->_tpl_preview__ocf_topic_screen();
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function tpl_preview__ocf_topic_voted_wrap()
	{
		return $this->_tpl_preview__ocf_topic_screen(true);
	}

	/**
	 * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
	 * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
	 * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
	 *
	 * @param  boolean			Whether to show for a has-voted-poll or not.
	 * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
	 */
	function _tpl_preview__ocf_topic_screen($voted=false)
	{
		require_css('ocf');

		require_lang('ocf');
		require_lang('polls');

		$warning_details=do_lorem_template('WARNING_BOX', array(
			'WARNING'=>lorem_phrase()
		));

		foreach (placeholder_array() as $k=>$v)
		{
			$members_viewing=new ocp_tempcode();
			foreach (placeholder_array() as $_k=>$_v)
			{
				$members_viewing->attach(do_lorem_template('OCF_USER_MEMBER', array(
					'PROFILE_URL'=>placeholder_url(),
					'USERNAME'=>lorem_word(),
					'AT'=>lorem_phrase(),
					'COLOUR'=>lorem_word()
				)));
			}

			$pagination=placeholder_pagination();

			$quick_reply=do_lorem_template('COMMENTS_POSTING_FORM', array(
				'JOIN_BITS'=>lorem_phrase_html(),
				'FIRST_POST'=>lorem_paragraph_html(),
				'USE_CAPTCHA'=>false,
				'GET_EMAIL'=>false,
				'EMAIL_OPTIONAL'=>true,
				'GET_TITLE'=>false,
				'POST_WARNING'=>'',
				'COMMENT_TEXT'=>'',
				'EM'=>placeholder_emoticon_chooser(),
				'EXPAND_TYPE'=>'expand',
				'DISPLAY'=>'',
				'MORE_URL'=>placeholder_url(),
				'FIRST_POST_URL'=>placeholder_url(),
				'COMMENT_URL'=>placeholder_url(),
				'TITLE'=>lorem_word(),
				'MAKE_POST'=>true,
				'CREATE_TICKET_MAKE_POST'=>true
			));

			$poll=new ocp_tempcode();
			$num_choices=do_lorem_template('PARAGRAPH', array(
				'TEXT'=>lorem_phrase(),
				'CLASS'=>lorem_word()
			));
			$private=$num_choices;

			if (!$voted)
			{
				$answers=new ocp_tempcode();
				$answer_tpl=new ocp_tempcode();
				foreach (placeholder_array() as $_k=>$_v)
				{
					$answer_tpl->attach(do_lorem_template('OCF_TOPIC_POLL_ANSWER_RADIO', array(
						'REAL_BUTTON'=>'',
						'ID'=>placeholder_random(),
						'ANSWER'=>lorem_phrase(),
						'I'=>placeholder_random()
					)));
				}
				$answers->attach($answer_tpl);

				$answer_tpl=new ocp_tempcode();
				foreach (placeholder_array() as $_k=>$_v)
				{
					$answer_tpl->attach(do_lorem_template('OCF_TOPIC_POLL_ANSWER', array(
						'REAL_BUTTON'=>'',
						'ID'=>placeholder_random(),
						'ANSWER'=>lorem_phrase(),
						'I'=>placeholder_random()
					)));
				}
				$answers->attach($answer_tpl);


				$button=do_lorem_template('OCF_TOPIC_POLL_BUTTON', array(
					'RESULTS_URL'=>placeholder_url()
				));

				$poll->attach(do_lorem_template('OCF_TOPIC_POLL', array(
					'ID'=>placeholder_random(),
					'NUM_CHOICES'=>$num_choices,
					'PRIVATE'=>$private,
					'QUESTION'=>lorem_phrase(),
					'ANSWERS'=>$answers,
					'REAL_BUTTON'=>'',
					'BUTTON'=>$button,
					'VOTE_URL'=>placeholder_url(),
					'MINIMUM_SELECTIONS'=>placeholder_number(),
					'MAXIMUM_SELECTIONS'=>placeholder_number()
				)));

			}
			else
			{
				$answers=new ocp_tempcode();

				$answer_tpl=new ocp_tempcode();
				$answer_tpl->attach(do_lorem_template('OCF_TOPIC_POLL_ANSWER_RESULTS', array(
					'ID'=>placeholder_random(),
					'NUM_VOTES'=>'10',
					'WIDTH'=>'30',
					'ANSWER'=>lorem_phrase(),
					'I'=>placeholder_random()
				)));
				$answer_tpl->attach(do_lorem_template('OCF_TOPIC_POLL_ANSWER_RESULTS', array(
					'ID'=>placeholder_random(),
					'NUM_VOTES'=>'15',
					'WIDTH'=>'45',
					'ANSWER'=>lorem_phrase(),
					'I'=>placeholder_random()
				)));
				$answer_tpl->attach(do_lorem_template('OCF_TOPIC_POLL_ANSWER_RESULTS', array(
					'ID'=>placeholder_random(),
					'NUM_VOTES'=>'20',
					'WIDTH'=>'60',
					'ANSWER'=>lorem_phrase(),
					'I'=>placeholder_random()
				)));

				$answers->attach($answer_tpl);

				$button=new ocp_tempcode();

				$poll->attach(do_lorem_template('OCF_TOPIC_POLL_VIEW_RESULTS', array(
					'ID'=>placeholder_random(),
					'NUM_CHOICES'=>$num_choices,
					'PRIVATE'=>$private,
					'QUESTION'=>lorem_phrase(),
					'ANSWERS'=>$answers,
					'REAL_BUTTON'=>'',
					'BUTTON'=>$button,
					'VOTE_URL'=>placeholder_url(),
					'MINIMUM_SELECTIONS'=>placeholder_number(),
					'MAXIMUM_SELECTIONS'=>placeholder_number()
				)));
			}

			//buttons
			$buttons=new ocp_tempcode();
			foreach (placeholder_array(1) as $_k=>$_v)
			{
				$buttons->attach(do_lorem_template('SCREEN_BUTTON', array(
					'REL'=>lorem_word(),
					'IMMEDIATE'=>NULL,
					'URL'=>placeholder_url(),
					'IMG'=>placeholder_img_code('page'),
					'TITLE'=>lorem_word()
				)));
			}

			//posts
			$posts=new ocp_tempcode();
			$first_unread=do_lorem_template('OCF_TOPIC_FIRST_UNREAD');

			$last_edited=do_lorem_template('OCF_TOPIC_POST_LAST_EDITED', array(
				'LAST_EDIT_DATE_RAW'=>placeholder_date_raw(),
				'LAST_EDIT_DATE'=>placeholder_time(),
				'LAST_EDIT_PROFILE_URL'=>placeholder_url(),
				'LAST_EDIT_USERNAME'=>lorem_word()
			));

			$custom_fields=do_lorem_template('OCF_MEMBER_BOX_CUSTOM_FIELD', array(
				'NAME'=>lorem_phrase(),
				'VALUE'=>placeholder_ip()
			));

			$poster_details=do_lorem_template('OCF_GUEST_DETAILS', array(
				'CUSTOM_FIELDS'=>$custom_fields
			));
			$poster_details_mem=do_lorem_template('OCF_MEMBER_BOX', array(
				'AVATAR_URL'=>placeholder_image_url(),
				'ONLINE'=>false,
				'POSTS'=>placeholder_number(),
				'POINTS'=>placeholder_number(),
				'JOIN_DATE_RAW'=>placeholder_date_raw(),
				'POSTER'=>lorem_phrase(),
				'JOIN_DATE'=>placeholder_time(),
				'PRIMARY_GROUP_NAME'=>lorem_phrase(),
				'CUSTOM_FIELDS'=>lorem_phrase(),
				'CUSTOM_FIELDS_FULL'=>lorem_phrase()
			));
			$poster=do_lorem_template('OCF_POSTER_MEMBER', array(
				'ID'=>placeholder_random(),
				'POSTER_DETAILS'=>$poster_details_mem,
				'PROFILE_URL'=>placeholder_url(),
				'POSTER_USERNAME'=>lorem_word(),
				'OTHER_USERGROUPS'=>array(
					lorem_word_html()
				),
				'POSTER'=>placeholder_number(),
				'HIGHLIGHT_NAME'=>lorem_word_html(),
				'ONLINE'=>false
			));

			$post_avatar=do_lorem_template('OCF_TOPIC_POST_AVATAR', array(
				'AVATAR'=>placeholder_image_url()
			));

			$rank_images=do_lorem_template('OCF_RANK_IMAGE', array(
				'GROUP_NAME'=>lorem_phrase(),
				'USERNAME'=>lorem_word(),
				'IMG'=>'ocf_rank_images/'.placeholder_img_code('ocf_rank_images'),
				'IS_LEADER'=>lorem_phrase()
			));

			//buttons
			$buttons=new ocp_tempcode();
			foreach (placeholder_array(1) as $_k=>$_v)
			{
				$buttons->attach(do_lorem_template('SCREEN_ITEM_BUTTON', array(
					'REL'=>lorem_word(),
					'IMMEDIATE'=>'',
					'URL'=>placeholder_url(),
					'IMG'=>placeholder_img_code('pageitem'),
					'TITLE'=>lorem_word()
				)));
			}


			$posts->attach(do_lorem_template('OCF_TOPIC_POST', array(
				'ID'=>placeholder_random(),
				'TOPIC_FIRST_POST_ID'=>placeholder_random(),
				'TOPIC_FIRST_POSTER'=>lorem_phrase(),
				'POST_ID'=>placeholder_random(),
				'URL'=>placeholder_url(),
				'CLASS'=>lorem_phrase(),
				'EMPHASIS'=>lorem_phrase(),
				'FIRST_UNREAD'=>$first_unread,
				'POSTER_TITLE'=>lorem_word(),
				'POST_TITLE'=>lorem_word(),
				'POST_DATE_RAW'=>placeholder_date_raw(),
				'POST_DATE'=>placeholder_time(),
				'POST'=>lorem_phrase(),
				'TOPIC_ID'=>placeholder_id(),
				'LAST_EDITED_RAW'=>lorem_phrase(),
				'LAST_EDITED'=>$last_edited,
				'POSTER_ID'=>placeholder_id(),
				'POSTER'=>$poster,
				'POSTER_DETAILS'=>$poster_details,
				'POST_AVATAR'=>$post_avatar,
				'RANK_IMAGES'=>$rank_images,
				'BUTTONS'=>$buttons,
				'SIGNATURE'=>lorem_phrase(),
				'UNVALIDATED'=>lorem_phrase(),
				'DESCRIPTION'=>lorem_phrase()
			)));
		}

		//buttons
		$buttons=new ocp_tempcode();
		foreach (placeholder_array(1) as $k=>$v)
		{
			$buttons->attach(do_lorem_template('SCREEN_BUTTON', array(
				'REL'=>lorem_word(),
				'IMMEDIATE'=>'',
				'URL'=>placeholder_url(),
				'IMG'=>placeholder_img_code('pageitem'),
				'TITLE'=>lorem_word()
			)));
		}

		$topic_tpl=do_lorem_template('OCF_TOPIC_SCREEN', array(
			'TITLE'=>lorem_title(),
			'THREADED'=>false,
			'ID'=>placeholder_id(),
			'_TITLE'=>lorem_phrase(),
			'WARNING_DETAILS'=>$warning_details,
			'MAX'=>lorem_phrase(),
			'ACTION_URL'=>placeholder_url(),
			'NUM_GUESTS'=>placeholder_number(),
			'NUM_MEMBERS'=>placeholder_number(),
			'MEMBERS_VIEWING'=>$members_viewing,
			'PAGINATION'=>$pagination,
			'MODERATOR_ACTIONS'=>placeholder_options(),
			'MARKED_POST_ACTIONS'=>placeholder_options(),
			'QUICK_REPLY'=>$quick_reply,
			'BREADCRUMBS'=>placeholder_breadcrumbs(),
			'POLL'=>$poll,
			'SCREEN_BUTTONS'=>$buttons,
			'POSTS'=>$posts,
			'MAY_CHANGE_MAX'=>lorem_word(),
			'LAST_POSTER'=>placeholder_random()
		));

		return array(
			lorem_globalise($topic_tpl, NULL, '', true)
		);
	}
}
