Exemple #1
0
 /**
  * Standard modular render function for profile tab hooks.
  *
  * @param  MEMBER			The ID of the member who is being viewed
  * @param  MEMBER			The ID of the member who is doing the viewing
  * @param  boolean		Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later
  * @return array			A triple: The tab title, the tab contents, the suggested tab order
  */
 function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
 {
     $title = do_lang_tempcode('PERSONAL_TOPICS_INBOX');
     $order = 80;
     if ($leave_to_ajax_if_possible) {
         return array($title, NULL, $order);
     }
     require_code('ocf_forumview');
     require_code('ocf_topics');
     require_code('ocf_general');
     require_lang('ocf');
     $id = NULL;
     $current_filter_cat = get_param('category', '');
     $root = get_param_integer('keep_forum_root', db_get_first_id());
     global $NON_CANONICAL_PARAMS;
     $NON_CANONICAL_PARAMS[] = 'start';
     $max = get_param_integer('max', 10);
     $start = get_param_integer('start', get_param_integer('kfs', 0));
     $root = db_get_first_id();
     list($content, , , ) = ocf_render_forumview($id, $current_filter_cat, $max, $start, $root, $member_id_of);
     return array($title, $content, $order);
 }
Exemple #2
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     if (get_forum_type() != 'ocf') {
         warn_exit(do_lang_tempcode('NO_OCF'));
     } else {
         ocf_require_all_forum_stuff();
     }
     require_code('ocf_forumview');
     global $NON_CANONICAL_PARAMS;
     foreach (array_keys($_GET) as $key) {
         if (substr($key, 0, 3) == 'kfs') {
             $NON_CANONICAL_PARAMS[] = $key;
         }
     }
     $NON_CANONICAL_PARAMS[] = 'order';
     $type = get_param('type', 'misc');
     $current_filter_cat = get_param('category', '');
     $default_max = intval(get_option('forum_topics_per_page'));
     $max = get_param_integer('max', $default_max);
     if ($max > 50 && !has_specific_permission(get_member(), 'remove_page_split')) {
         $max = $default_max;
     }
     $root = get_param_integer('keep_forum_root', db_get_first_id());
     if ($type == 'pt') {
         $id = NULL;
         $start = get_param_integer('start', get_param_integer('kfs', 0));
         $of_member_id = get_param_integer('id', get_member());
     } else {
         $id = get_param_integer('id', db_get_first_id());
         $start = get_param_integer('start', get_param_integer('kfs' . strval($id), 0));
         $of_member_id = NULL;
     }
     $test = ocf_render_forumview($id, $current_filter_cat, $max, $start, $root, $of_member_id);
     if (is_array($test)) {
         list($content, $ltitle, $tree, $forum_name) = $test;
     } else {
         return $test;
     }
     if ($type != 'pt') {
         global $SEO_TITLE;
         $SEO_TITLE = $forum_name;
         breadcrumb_add_segment($tree);
     }
     if (addon_installed('awards')) {
         require_code('awards');
         $awards = is_null($id) ? array() : find_awards_for('forum', strval($id));
     } else {
         $awards = array();
     }
     $title = get_page_title($ltitle, false, NULL, NULL, $awards);
     $ret = ocf_wrapper($title, $content, true, $type != 'pt', $id);
     return $ret;
 }