function render() { $this->links = NULL; $Pagination = new CNPagination(); switch ($this->type) { case IMAGE: $this->links = CNContent::load_content_id_array($this->uid, IMAGE); $this->type_image = PA::$theme_url . "/img/type-image.gif"; break; case AUDIO: $this->links = CNContent::load_content_id_array($this->uid, AUDIO); $this->type_image = PA::$theme_url . "/img/type-audio.gif"; break; case VIDEO: $this->links = CNContent::load_content_id_array($this->uid, VIDEO); $this->type_image = PA::$theme_url . "/img/type-video.gif"; break; case BLOGPOST: $this->links = CNContent::load_content_id_array($this->uid, BLOGPOST); $this->type_image = PA::$theme_url . "/img/type-blog.gif"; break; default: $this->links = CNContent::load_content_id_array($this->uid, NULL); break; } $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
public function render() { // group recent posts if ($this->type == 'group') { $group = new Group(); $group->collection_id = $this->gid; $this->links = $group->get_contents_for_collection('all', FALSE, $this->limit, 1, 'created', 'DESC', TRUE); // user recent posts } else { if ($this->type == 'user') { $this->links = CNContent::get_user_content($this->uid); // network recent posts } else { $this->links = CNContent::load_content_id_array($user_id = 0, $type = NULL, $cnt = FALSE, $show = $this->limit, $page = 1, $sort_by = 'created', $direction = 'DESC', $only_homepage = false); } } $this->view_all_url = count($this->links) > 0 ? $this->view_all_url : ''; $this->inner_HTML = $this->generate_inner_html($this->links); $content = parent::render(); return $content; }
function render() { if ($this->type == 'group') { $this->outer_template = 'outer_show_content_module_group.php'; 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 = $this->group->get_contents_for_collection($this->content_type, TRUE, 10, 1, 'created', 'DESC', TRUE); $this->contents = $this->group->get_contents_for_collection($this->content_type, FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC', TRUE); } else { $this->Paging["count"] = $this->links = $this->group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC'); $this->contents = $this->group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC'); } $this->title = chop_string(sprintf(__("%s's Group Blog"), $this->group->title, 32)); } 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"]); if (!empty($this->contents)) { foreach ($this->contents as $key => $value) { $this->contents[$key]['content_id'] = $value['id']; } } } else { if ($this->type == "search") { $this->Paging["count"] = CNContent::content_search($this->search_string_array, $cnt = TRUE); $this->contents = CNContent::content_search($this->search_string_array, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]); } else { $this->Paging["count"] = CNContent::load_content_id_array($this->uid, $this->content_type, $cnt = TRUE); $contents = CNContent::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); if ($this->do_pagination) { $CNPagination = new CNPagination(); $CNPagination->setPaging($this->Paging); $this->page_first = $CNPagination->getFirstPage(); $this->page_last = $CNPagination->getLastPage(); $this->page_links = $CNPagination->getPageLinks(); } $content = parent::render(); return $content; }