public static function getValue($fld, $params, &$videolist_row, &$theme_row, $gallery_list, $width, $height, $videoid, $AllowPagination, $total_number_of_rows, $custom_itemid = 0) { $fields_theme = array('bgcolor', 'cssstyle', 'navbarstyle', 'thumbnailstyle', 'linestyle', 'listnamestyle', 'activevideotitlestyle', 'color1', 'color2', 'descr_style', 'rel', 'hrefaddon'); if (in_array($fld, $fields_theme)) { $theme_row_array = get_object_vars($theme_row); return $theme_row_array[$fld]; } switch ($fld) { case 'mediafolder': if ($theme_row->mediafolder == '') { return ''; } else { return 'images/' . $theme_row->mediafolder; } break; case 'videolist': if ($params != '') { $pair = explode(',', $params); switch ($pair[0]) { case 'title': return $videolist_row->listname; break; case 'description': return YouTubeGalleryMisc::html2txt($videolist_row->description); break; case 'author': return $videolist_row->author; break; case 'playlist': $pl = YoutubeGalleryLayoutRenderer::getPlaylistIdsOnly($gallery_list); $vlu = implode(',', $pl); break; case 'watchgroup': return $videolist_row->watchusergroup; break; case 'authorurl': return $videolist_row->authorurl; break; case 'image': return $videolist_row->image; break; case 'note': return $videolist_row->note; break; } } return $videolist_row->listname; break; case 'cols': return $theme_row->cols; break; case 'listname': return $videolist_row->listname; break; case 'videotitle': $title = str_replace('"', '"', YoutubeGalleryLayoutRenderer::getTitleByVideoID($videoid, $gallery_list)); $title = YouTubeGalleryMisc::html2txt($title); if ($theme_row->openinnewwindow == 4 or $theme_row->openinnewwindow == 5) { $title = '<div id="YoutubeGalleryVideoTitle' . $videolist_row->id . '">' . $title . '</div>'; } if ($params != '') { $pair = explode(',', $params); $words = (int) $pair[0]; if (isset($pair[1])) { $chars = (int) $pair[1]; } else { $chars = 0; } $title = YoutubeGalleryLayoutRenderer::PrepareDescription($title, $words, $chars); } return $title; break; case 'videodescription': $description = str_replace('"', '"', YoutubeGalleryLayoutRenderer::getDescriptionByVideoID($videoid, $gallery_list)); $description = YouTubeGalleryMisc::html2txt($description); if ($params != '') { $pair = explode(',', $params); $words = (int) $pair[0]; if (isset($pair[1])) { $chars = (int) $pair[1]; } else { $chars = 0; } $description = YoutubeGalleryLayoutRenderer::PrepareDescription($description, $words, $chars); } if ($theme_row->openinnewwindow == 4 or $theme_row->openinnewwindow == 5) { $description = '<div id="YoutubeGalleryVideoDescription' . $videolist_row->id . '">' . $description . '</div>'; } return $description; break; case 'videoplayer': $pair = explode(',', $params); if ($params != '') { $playerwidth = (int) $pair[0]; } else { $playerwidth = $width; } if (isset($pair[1])) { $playerheight = (int) $pair[1]; } else { $playerheight = $height; } if ($theme_row->openinnewwindow == 4 or $theme_row->openinnewwindow == 5) { //Update Player - without page reloading YoutubeGalleryLayoutRenderer::addHotReloadScript($gallery_list, $playerwidth, $playerheight, $videolist_row, $theme_row); } return YoutubeGalleryLayoutRenderer::ShowActiveVideo($gallery_list, $playerwidth, $playerheight, $videoid, $videolist_row, $theme_row); break; case 'navigationbar': //classictable $pair = explode(',', $params); if ((int) $pair[0] > 0) { $number_of_columns = (int) $pair[0]; } else { $number_of_columns = (int) $theme_row->cols; } if ($number_of_columns < 1) { $number_of_columns = 3; } if ($number_of_columns > 10) { $number_of_columns = 10; } if (isset($pair[1])) { $navbarwidth = (int) $pair[1]; } else { $navbarwidth = $width; } return YoutubeGalleryLayoutRenderer::ClassicNavTable($gallery_list, $navbarwidth, $number_of_columns, $videolist_row, $theme_row, $AllowPagination, $videoid, $custom_itemid); break; case 'thumbnails': //simple list return YoutubeGalleryLayoutRenderer::NavigationList($gallery_list, $videolist_row, $theme_row, $AllowPagination, $videoid, $custom_itemid); break; case 'count': if ($params == 'all') { return $videolist_row->TotalVideos; } else { return count($gallery_list); } break; case 'pagination': return YoutubeGalleryLayoutRenderer::Pagination($theme_row, $gallery_list, $width, $total_number_of_rows); break; case 'width': return $width; break; case 'height': return $height; break; case 'instanceid': return $videolist_row->id; break; case 'videoid': return $videoid; break; case 'link': return $link = YouTubeGalleryMisc::full_url($_SERVER); //$_SERVER['HTTP_REFERER']; break; case 'social': return YoutubeGalleryLayoutRenderer::SocialButtons('window.location.href', 'yg', $params, $videolist_row->id, $videoid); break; case 'video': $pair = explode(':', $params); if ($pair[0] != "") { $options = ''; if (isset($pair[1])) { $options = $pair[1]; } $tableFields = array('title', 'description', 'imageurl', 'videoid', 'videosource', 'publisheddate', 'duration', 'rating_average', 'rating_max', 'rating_min', 'rating_numRaters', 'keywords', 'commentcount', 'likes', 'dislikes', 'playlist'); $listitem = YoutubeGalleryLayoutRenderer::getVideoRowByID($videoid, $gallery_list, true); //YoutubeGalleryLayoutRenderer::object_to_array($videolist_row); return YoutubeGalleryLayoutRenderer::getTumbnailData($pair[0], "", "", $listitem, $tableFields, $options, $theme_row, $gallery_list, $videolist_row); } break; } //switch($fld) }