Example #1
0
 /**
  * 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_personal_stats()
 {
     $content = new ocp_tempcode();
     $links = new ocp_tempcode();
     $content->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_2', array('NAME' => lorem_word_2(), 'DESCRIPTION' => lorem_phrase(), 'URL' => placeholder_url())));
     $links->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINK', array('NAME' => lorem_word(), 'URL' => placeholder_url(), 'REL' => 'me')));
     $links->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LOGOUT', array('NAME' => do_lang_tempcode('LOGOUT'), 'URL' => placeholder_url())));
     $content->attach(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS_LINE_COMPLEX', array('KEY' => do_lang_tempcode('GROUP'), 'VALUE' => placeholder_link())));
     $staff_actions = new ocp_tempcode();
     $staff_actions->attach(form_input_list_entry(lorem_word(), true, lorem_phrase()));
     return array(lorem_globalise(do_lorem_template('BLOCK_SIDE_PERSONAL_STATS', array('AVATAR_URL' => placeholder_avatar(), 'LINKS' => $links, 'HAS_SU' => true, 'CONTENT' => $content, 'USERNAME' => lorem_word(), 'STAFF_ACTIONS' => $staff_actions)), NULL, '', true));
 }
Example #2
0
 /**
  * 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_post_clean_wrap()
 {
     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_time(), 'LAST_EDIT_PROFILE_URL' => placeholder_url(), 'LAST_EDIT_USERNAME' => lorem_word()));
     $custom_fields = do_lorem_template('OCF_TOPIC_POST_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('IP_LINK' => placeholder_url(), 'POSTER_DETAILS' => $poster_details, 'POSTER_USERNAME' => lorem_word()));
     $post_avatar = do_lorem_template('OCF_TOPIC_POST_AVATAR', array('AVATAR' => placeholder_avatar()));
     $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_TOPIC_POST_CLEAN_WRAP', array('POST' => $post)), NULL, '', true));
 }
Example #3
0
 /**
  * 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_screen()
 {
     require_lang('news');
     $sections = array('contact' => lorem_word(), 'profile' => lorem_word_2(), 'views' => lorem_word(), 'usage' => lorem_word_2(), 'content' => lorem_word());
     $actions = array();
     $i = 0;
     $links = new ocp_tempcode();
     foreach ($sections as $section_code => $section_title) {
         $links->attach(do_lorem_template('OCF_MEMBER_ACTION', array('ID' => strval($i), 'URL' => placeholder_url(), 'LANG' => lorem_word(), 'REL' => '')));
         $actions[$section_code] = do_lorem_template('OCF_MEMBER_ACTION', array('ID' => strval($i), 'URL' => placeholder_url(), 'LANG' => lorem_word(), 'REL' => '', 'NAME' => $section_title, 'VALUE' => $links));
         $i++;
     }
     require_lang('menus');
     $tabs = array();
     $tab_content = do_lorem_template('OCF_MEMBER_PROFILE_ABOUT', array('RIGHT_MARGIN' => lorem_phrase(), 'AVATAR_WIDTH' => placeholder_id(), 'PHOTO_WIDTH' => placeholder_id(), 'MOST_ACTIVE_FORUM' => lorem_phrase(), 'TIME_FOR_THEM' => placeholder_time(), 'TIME_FOR_THEM_RAW' => placeholder_date_raw(), 'SUBMIT_DAYS_AGO' => lorem_phrase(), 'SUBMIT_TIME_RAW' => placeholder_time(), 'LAST_VISIT_TIME_RAW' => placeholder_date_raw(), 'ONLINE_NOW' => lorem_phrase(), '_ONLINE_NOW' => false, 'BANNED' => lorem_phrase(), 'USER_AGENT' => lorem_phrase(), 'OPERATING_SYSTEM' => lorem_phrase(), 'DOB' => lorem_phrase(), 'IP_ADDRESS' => lorem_phrase(), 'COUNT_POSTS' => placeholder_number(), 'COUNT_POINTS' => placeholder_number(), 'PRIMARY_GROUP' => lorem_phrase(), 'PRIMARY_GROUP_ID' => placeholder_id(), 'PHOTO_URL' => placeholder_image_url(), 'PHOTO_THUMB_URL' => placeholder_image_url(), 'EMAIL_ADDRESS' => lorem_word(), 'AVATAR_URL' => placeholder_avatar(), 'SIGNATURE' => lorem_phrase(), 'JOIN_DATE' => placeholder_time(), 'JOIN_DATE_RAW' => placeholder_date_raw(), 'CUSTOM_FIELDS' => array(array('NAME' => lorem_phrase(), 'VALUE' => lorem_phrase(), 'ENCRYPTED_VALUE' => '')), 'ACTIONS_contact' => $actions['contact'], 'ACTIONS_profile' => $actions['profile'], 'ACTIONS_views' => $actions['views'], 'ACTIONS_usage' => $actions['usage'], 'ACTIONS_content' => $actions['content'], 'USERNAME' => lorem_word(), 'MEMBER_ID' => placeholder_id(), 'SECONDARY_GROUPS' => placeholder_array(), 'VIEW_PROFILES' => true, 'ON_PROBATION' => lorem_phrase(), 'USERGROUP' => lorem_word(), 'CLUBS' => lorem_phrase()));
     $tabs[] = array('TAB_CODE' => placeholder_id() . '0', 'TAB_TITLE' => lorem_title(), 'TAB_CONTENT' => $tab_content, 'TAB_FIRST' => true, 'TAB_LAST' => false);
     $tabs2 = array();
     $fields = new ocp_tempcode();
     $name = placeholder_random_id();
     $input = do_lorem_template('FORM_SCREEN_INPUT_INTEGER', array('TABINDEX' => placeholder_number(), 'REQUIRED' => '', 'NAME' => $name, 'DEFAULT' => ''));
     $fields->attach(do_lorem_template('FORM_SCREEN_FIELD', array('REQUIRED' => true, 'SKIP_LABEL' => false, 'BORING_NAME' => $name, 'NAME' => lorem_word(), 'DESCRIPTION' => lorem_sentence_html(), 'DESCRIPTION_SIDE' => '', 'INPUT' => $input, 'COMCODE' => '')));
     $tabs2[] = array('TAB_TITLE' => lorem_title(), 'TAB_FIELDS' => $fields, 'TAB_TEXT' => lorem_paragraph(), 'TAB_FIRST' => true, 'TAB_LAST' => true);
     $tab_content = do_lorem_template('OCF_MEMBER_PROFILE_EDIT', array('URL' => placeholder_url(), 'SUBMIT_NAME' => lorem_phrase(), 'AUTOCOMPLETE' => false, 'SKIP_VALIDATION' => true, 'TABS' => $tabs2, 'HIDDEN' => ''));
     $tabs[] = array('TAB_CODE' => placeholder_id() . '1', 'TAB_TITLE' => lorem_title(), 'TAB_CONTENT' => $tab_content, 'TAB_FIRST' => false, 'TAB_LAST' => true);
     return array(lorem_globalise(do_lorem_template('OCF_MEMBER_PROFILE_SCREEN', array('TITLE' => lorem_title(), 'MEMBER_ID' => placeholder_id(), 'TABS' => $tabs)), NULL, '', true));
 }
Example #4
0
 /**
  * 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__chat_message()
 {
     require_lang('submitban');
     $chat_actions = do_lorem_template('CHAT_STAFF_ACTIONS', array('CHAT_BAN_URL' => placeholder_url(), 'CHAT_UNBAN_URL' => placeholder_url(), 'EDIT_URL' => placeholder_url(), 'BAN_URL' => placeholder_url()));
     return array(lorem_globalise(do_lorem_template('CHAT_MESSAGE', array('SYSTEM_MESSAGE' => lorem_phrase(), 'STAFF' => "1", 'OLD_MESSAGES' => lorem_phrase(), 'AVATAR_URL' => placeholder_avatar(), 'STAFF_ACTIONS' => $chat_actions, 'USER' => lorem_word(), 'MESSAGE' => lorem_phrase(), 'TIME' => placeholder_time(), 'RAW_TIME' => placeholder_time(), 'FONT_COLOUR' => 'blue', 'FONT_FACE' => 'Arial')), NULL, '', true));
 }