$video_data = array(); $j = 0; foreach ($video_albums as $albums) { $new_album = new Album(VIDEO_ALBUM); $video_data[$j]['album_name'] = $albums['description']; $video_data[$j]['album_id'] = $albums['collection_id']; $new_album->collection_id = $albums['collection_id']; $video_ids = $new_album->get_contents_for_collection(); if (!empty($video_ids)) { $k = 0; $ids = array(); for ($i = 0; $i < count($video_ids); $i++) { $ids[$i] = $video_ids[$i]['content_id']; } $new_video = new Video(); $data = $new_video->load_many($ids); foreach ($data as $d) { $video_data[$j]['video_data'][$k]['content_id'] = $d['content_id']; $video_data[$j]['video_data'][$k]['video_file'] = $d['video_file']; $video_data[$j]['video_data'][$k]['video_caption'] = $d['video_caption']; $video_data[$j]['video_data'][$k]['title'] = $d['title']; $video_data[$j]['video_data'][$k]['body'] = $d['body']; $video_data[$j]['video_data'][$k]['created'] = $d['created']; $k++; } } $j++; } $parameter = js_includes("base"); html_header("user gallery", $parameter); ?>
$j++; } if ($_GET['album_type'] == 'video') { $new_album = new Album(VIDEO_ALBUM); $content_data[$j]['album_name'] = $albums['description']; $content_data[$j]['album_id'] = $albums['collection_id']; $content_data[$j]['album_type'] = $_GET['album_type']; $new_album->collection_id = $albums['collection_id']; $image_ids = $new_album->get_contents_for_collection(); if (!empty($image_ids)) { $k = 0; for ($i = 0; $i < count($image_ids); $i++) { $ids[$i] = $image_ids[$i]['content_id']; } $new_image = new Video(); $data = $new_image->load_many($ids); foreach ($data as $d) { $content_data[$j]['data'][$k]['content_id'] = $d['content_id']; $content_data[$j]['data'][$k]['file'] = $d['video_file']; $content_data[$j]['data'][$k]['caption'] = $d['video_caption']; $content_data[$j]['data'][$k]['title'] = $d['title']; $content_data[$j]['data'][$k]['body'] = $d['body']; $content_data[$j]['data'][$k]['created'] = $d['created']; $k++; } } $j++; } print html_header(); ?>
function generate_inner_html() { global $login_uid; if (!isset($_GET['gid']) || empty($_GET['gid'])) { parent::set_vars(); $frnd_list = null; if (!empty($_GET['view'])) { $frnd_list = $this->friend_list; } $sb_videos = array(); $new_album = new Album(VIDEO_ALBUM); if ($this->album_id) { $new_album = new Album(); $new_album->album_type = VIDEO_ALBUM; $new_album->load($this->album_id); $video_data['album_id'] = $new_album->collection_id; $video_data['album_name'] = $new_album->title; } else { $new_album->collection_id = $this->default_album_id; $video_data['album_id'] = $this->default_album_id; $video_data['album_name'] = $this->default_album_name; } $video_ids = $new_album->get_contents_for_collection(); if (!empty($video_ids)) { $k = 0; $ids = array(); for ($i = 0; $i < count($video_ids); $i++) { if ($video_ids[$i]['type'] != 7) { // Type 7 is for SB Content $ids[$i] = $video_ids[$i]['content_id']; } else { $tags = Tag::load_tags_for_content($video_ids[$i]['content_id']); $tags = show_tags($tags, null); //show_tags function is defined in uihelper.php $sb_videos[] = array('content_id' => $video_ids[$i]['content_id'], 'title' => $video_ids[$i]['title'], 'type' => $video_ids[$i]['type'], 'created' => $video_ids[$i]['created'], 'tags' => $tags); } } $new_video = new Video(); $data = $new_video->load_many($ids, $this->uid, $login_uid); if (count($data) > 0) { foreach ($data as $d) { $video_data[$k]['content_id'] = $d['content_id']; $video_data[$k]['video_file'] = $d['video_file']; $video_data[$k]['video_caption'] = $d['video_caption']; $video_data[$k]['title'] = $d['title']; $video_data[$k]['body'] = $d['body']; $video_data[$k]['created'] = $d['created']; $video_data[$k]['tags'] = $d['tags']; $video_data[$k]['type'] = ""; $k++; } } // Merging Media Gallery content and SB Content for ($counter = 0; $counter < count($sb_videos); $counter++) { $video_data[$k]['content_id'] = $sb_videos[$counter]['content_id']; $video_data[$k]['title'] = $sb_videos[$counter]['title']; $video_data[$k]['type'] = $sb_videos[$counter]['type']; $video_data[$k]['video_caption'] = $sb_videos[$counter]['title']; $video_data[$k]['created'] = $sb_videos[$counter]['created']; $video_data[$k]['tags'] = $sb_videos[$counter]['tags']; $k++; } } if (!empty($_GET['view'])) { if (empty($frnd_list)) { $video_data = NULL; } } $inner_template = NULL; switch ($this->mode) { default: $inner_template = dirname(__FILE__) . '/center_inner_public.tpl'; } $obj_inner_template =& new Template($inner_template); $obj_inner_template->set('links', $video_data); $obj_inner_template->set('uid', $this->uid); $obj_inner_template->set('frnd_list', $frnd_list); $obj_inner_template->set('my_all_album', $this->my_all_album); $obj_inner_template->set('show_view', $this->show_view); $inner_html = $obj_inner_template->fetch(); return $inner_html; } else { // ----- Calling parents function which set all the Require variables parent::set_group_media_gallery(); //------------- Handling the Groups Media gallery ----------- $group = ContentCollection::load_collection((int) $_GET['gid'], $_SESSION['user']['id']); $video_data = Video::load_videos_for_collection_id($_GET['gid'], $limit = 0); $video_data['album_id'] = $group->collection_id; $video_data['album_name'] = $group->title; $inner_template = NULL; switch ($this->mode) { default: $inner_template = dirname(__FILE__) . '/center_inner_public_groups.tpl'; } $obj_inner_template =& new Template($inner_template); $obj_inner_template->set('links', $video_data); $obj_inner_template->set('show_view', $this->show_view); $obj_inner_template->set('my_all_groups', $this->group_ids); $inner_html = $obj_inner_template->fetch(); return $inner_html; } }