function render()
{
global $login_uid;
if ($this->type == 'group') {
$this->outer_template = 'outer_show_content_group_module.tpl';
$group = new Group();
$group->collection_id = $this->gid;
if ($this->content_type == NULL) {
$this->content_type = 'all';
}
//$type = 'all',$cnt=FALSE, $show='ALL', $page=0, $sort_by='created', $direction='DESC'
if (!empty($this->content_type)) {
$this->Paging["count"] = $this->links = $group->get_contents_for_collection($this->content_type, TRUE, 10, 1, 'created', 'DESC', TRUE);
$this->contents = $group->get_contents_for_collection($this->content_type, FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC', TRUE);
} else {
$this->Paging["count"] = $this->links = $group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC');
$this->contents = $group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC');
}
$this->group_owner = FALSE;
if (Group::is_admin($group->collection_id, $login_uid)) {
$this->group_owner = TRUE;
}
$this->group_member = FALSE;
if (Group::member_exists($group->collection_id, $login_uid)) {
$this->group_member = TRUE;
}
/*
if($this->html_block_id_flag == 1) {
$this->Paging["count"] = $this->links = $group->get_contents_for_collection($type = 'all',$cnt=TRUE,'all' , 0, $sort_by='created', $direction='DESC');
$this->contents = $group->get_contents_for_collection($type = 'all', $cnt=FALSE, $this->Paging["show"], $this->Paging["page"],'created','DESC');
} else {
$this->contents = $group->get_contents_for_collection($this->content_type,FALSE, 10, 1, 'created', 'DESC',TRUE);
}*/
$this->title = $this->group_details['title'] . '\'s Group Blog';
} else {
if ($this->type == "tag") {
$this->Paging["count"] = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = TRUE);
$this->contents = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
} else {
if ($this->type == "search") {
$this->Paging["count"] = Content::content_search($this->search_string_array, $cnt = TRUE);
$this->contents = Content::content_search($this->search_string_array, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
} else {
//print $this->content_type; exit;
$this->Paging["count"] = Content::load_content_id_array($this->uid, $this->content_type, $cnt = TRUE);
$contents = Content::load_content_id_array($this->uid, $this->content_type, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
$this->contents = $contents;
}
}
}
$this->orientation = LEFT;
if ($this->type == 'user') {
$this->block_type = 'ShowContentUserBlock';
$this->do_pagination = TRUE;
} else {
if ($this->type == 'group') {
if ($this->html_block_id_flag == 1) {
$this->block_type = 'ShowAllContent';
$this->do_pagination = TRUE;
} else {
$this->block_type = 'ShowContentGroupBlock';
}
} else {
if ($this->type == "tag") {
$this->block_type = 'ShowAllContent';
$this->do_pagination = TRUE;
} else {
if ($this->type == "search") {
$this->block_type = 'ShowAllContent';
$this->do_pagination = TRUE;
} else {
if ($this->show_all == 1) {
$this->block_type = 'ShowAllContent';
$this->do_pagination = TRUE;
} else {
$this->block_type = 'ShowContentBlock';
$this->do_pagination = TRUE;
}
}
}
}
}
$this->inner_HTML = $this->generate_inner_html($this->contents, $this->type);
$Pagination = new Pagination();
$Pagination->setPaging($this->Paging);
$this->page_first = $Pagination->getFirstPage();
$this->page_last = $Pagination->getLastPage();
$this->page_links = $Pagination->getPageLinks();
$content = parent::render();
return $content;
}