function render()
 {
     $thread_obj = new MessageBoard();
     $request_info = load_info();
     $this->parent_id = $request_info['parent_id'];
     $this->parent_name_hidden = $request_info['parent_name_hidden'];
     $this->parent_type = $request_info['parent_type'];
     $this->header_title = $request_info['header_title'];
     $thread_obj->set_parent($this->parent_id, $this->parent_type);
     $this->Paging["count"] = $thread_obj->get($count = TRUE);
     $this->forum_details = $thread_obj->get($count = FALSE, $this->Paging["show"], $this->Paging["page"], 'changed', 'ASC');
     // Here we finding the ID of group owner
     $group_owner = Group::get_admin_id($_GET['ccid']);
     $this->group_owner_id = $group_owner['user_id'];
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
 function render()
 {
     global $paging;
     $request_info = load_info();
     $this->parent_id = $request_info['parent_id'];
     $this->parent_type = $request_info['parent_type'];
     $this->parent_name_hidden = $request_info['parent_name_hidden'];
     $this->header_title = $request_info['header_title'];
     $thread_obj = new MessageBoard();
     $thread_obj->set_parent($this->parent_id, $this->parent_type);
     $this->Paging["count"] = $thread_obj->get($count = TRUE);
     $this->Paging['show'] = $paging['show'];
     $this->Paging['page'] = $paging['page'];
     $this->forum_details = $thread_obj->get($count = FALSE, $this->Paging["show"], $this->Paging["page"]);
     $group_data = Group::load_group_by_id((int) $_GET['gid']);
     $this->group_name = $group_data->title;
     $this->topic_count = $this->Paging["count"];
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
 function get_forum_links()
 {
     global $paging, $base_url;
     $request_info = load_info();
     $this->parent_id = $request_info['parent_id'];
     $this->parent_type = $request_info['parent_type'];
     $this->parent_name_hidden = $request_info['parent_name_hidden'];
     $this->header_title = $request_info['header_title'];
     $thread_obj = new MessageBoard();
     $thread_obj->set_parent($this->parent_id, $this->parent_type);
     $this->Paging["count"] = $thread_obj->get($count = TRUE);
     $forum_details = $thread_obj->get($count = FALSE, $this->Paging["show"], $this->Paging["page"]);
     $cnt = count($forum_details);
     if ($cnt > 0) {
         for ($i = 1; $i <= $cnt; $i++) {
             $forum_details[$i]['hyper_link'] = $base_url . '/forum_messages.php?mid=' . $forum_details[$i]['boardmessage_id'] . '&amp;ccid=' . $_GET['gid'];
             $forum_details[$i]['edit_link'] = $base_url . '/edit_forum.php?mid=' . $forum_details[$i]['boardmessage_id'] . '&amp;gid=' . $_GET['gid'];
             $forum_details[$i]['delete_link'] = $base_url . '/deleteforumbyadmin.php?mid=' . $forum_details[$i]['boardmessage_id'] . '&amp;ccid=' . $_GET['gid'] . '" onclick="javascript:return confirm(\'Are you sure you want to delete this forum ? \');"';
         }
     }
     return $forum_details;
 }
 function render()
 {
     global $base_url;
     $request_info = load_info();
     $parent_id = $request_info['parent_id'];
     $parent_type = $request_info['parent_type'];
     $msg_board_obj = new MessageBoard();
     $msg_board_obj->parent_id = $parent_id;
     $msg_board_obj->parent_type = $parent_type;
     $this->forum_messages = $msg_board_obj->get($count = FALSE, $show = 5, $page = 1, $sort_by = 'changed', $direction = 'DESC');
     if (sizeof($this->forum_messages)) {
         $this->view_all_url = "{$base_url}/forum_home.php?gid={$parent_id}";
     }
     $this->parent_id = $parent_id;
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
示例#5
0
        $parent_cat_description = stripslashes($parent_cat_obj->description);
    } catch (PAException $e) {
        $msg = "Error occured in retreiving category information\n";
        $msg .= "<br><center><font color=\"red\">" . $e->message . "</font></center>";
        $error_code = $e->code;
        $error = TRUE;
    }
    if ($error) {
        $redirect_msg = "Category does not exist.";
        $back_to_page = $base_url . '/forums.php';
        header("Location: {$base_url}/generic_error.php?msg={$redirect_msg}&back_to_page={$back_to_page}");
        exit;
    }
    $thread_obj = new MessageBoard();
    $thread_obj->set_category_id($parent_id);
    $arr_threads = $thread_obj->get();
}
html_header($HTML_TITLE, '');
?>

<?php 
$content =& new Template(CURRENT_THEME_FSPATH . "/threads.tpl");
if ($error == TRUE) {
    $content->set('msg', $msg);
}
$content->set('uid', $uid);
$content->set('cid', $parent_id);
$header =& new Template(CURRENT_THEME_FSPATH . "/header.tpl");
$header->set('user_name', $first_name . " " . $last_name);
$content->set('header', $header);
$left_panel =& new Template(CURRENT_THEME_FSPATH . "/left_page.tpl");
function peopleaggregator_getBoardMessages($args)
{
    if ($args['authToken']) {
        $user = User::from_auth_token($args['authToken']);
    } else {
        $user = NULL;
    }
    $context = $args['context'];
    $perpage = $args['resultsPerPage'];
    $page = $args['page'];
    if (preg_match("/^group:(\\d+)\$/", $context, $m)) {
        // getting list of topics for a group
        $parent_id = $m[1];
        $parent_type = "collection";
    } else {
        if (preg_match("/^msg:(\\d+)\$/", $context, $m)) {
            // getting a thread
            $parent_id = $m[1];
            $parent_type = "message";
        } else {
            throw new PAException(INVALID_ID, "Only 'group' and 'msg' type IDs are valid contexts for getBoardMessages().");
        }
    }
    $mb = new MessageBoard();
    $mb->set_parent($parent_id, $parent_type);
    $total_messages = (int) $mb->get(TRUE);
    $msgs = $mb->get(FALSE, $perpage, $page);
    $msgs_out = array();
    foreach ($msgs as $msg) {
        $m = array("id" => "msg:" . $msg['boardmessage_id'], "title" => $msg["title"], "content" => $msg["body"], "created" => $msg['created'], "author" => array("id" => $msg["user_id"] ? "user:"******"user_id"] : ""));
        if ($msg["user_id"]) {
            $m["author"]["name"] = "" . $msg["user_name"];
        }
        $msgs_out[] = $m;
    }
    return array('success' => TRUE, 'page' => $page, 'resultsPerPage' => $perpage, 'totalMessages' => $total_messages, 'totalPages' => api_n_pages($total_messages, $perpage), 'messages' => $msgs_out);
}