1) { $seo_title = array_pop($p_url); } $randomData = categories_getRandom(); $exploded = explode("||",$randomData); $randID = $exploded[0]; $randKeyword = $exploded[1]; if (empty($_GET['orderby'])) { $orderby = "relevance"; }else{ $orderby = $_GET['orderby']; } // ################# Start getting Youtube GData ############################## $keyword = str_replace("-"," ",urldecode($randKeyword)); $video_list = YT_ListByTag($keyword, $_GET['p'],$orderby); // ################# Start parse xml attributes manually ###################### preg_match_all('/<[^>]+>/s',$video_list[1],$tags); $i=0; foreach ($tags[0] as $k => $v) { $v = str_replace('"',"\'",$v); if (substr($v, 0, 12) == ' $v) { $id_raw = explode('/',$video_list[0][entry][$k][id]); $video_list[0][entry][$k][id] = array_pop($id_raw); $video_list[0][entry][$k][author] = $video_list[0][entry][$k][author][0][name]; $video_list[0][entry][$k][description] = $video_list[0][entry][$k]['media:group'][0]['media:description']; $video_list[0][entry][$k][category] = $video_list[0][entry][$k]['media:group'][0]['media:category']; $video_list[0][entry][$k][thumbnail][0] = "http://img.youtube.com/vi/" . $video_list[0][entry][$k][id] . "/0.jpg"; $video_list[0][entry][$k][thumbnail][1] = "http://img.youtube.com/vi/" . $video_list[0][entry][$k][id] . "/1.jpg"; $video_list[0][entry][$k][thumbnail][2] = "http://img.youtube.com/vi/" . $video_list[0][entry][$k][id] . "/2.jpg"; $video_list[0][entry][$k][thumbnail][3] = "http://img.youtube.com/vi/" . $video_list[0][entry][$k][id] . "/3.jpg"; $keywords_raw = explode(',',$video_list[0][entry][$k]['media:group'][0]['media:keywords']); $i=0; foreach($keywords_raw as $k2 => $v2) { $video_list[0][entry][$k][keywords][$i] = trim($v2); $i++; } } // ################# Start calculate pagination ############################### if((($_GET['p']+1) * $config['list_per_page']) < $video_list[0]['opensearch:totalresults']) { $next_page = $_GET['p'] + 1; } if($_GET['p']>1) { $prev_page = $_GET['p'] - 1; } // ################# Start assign template variables ########################## if($config["enable_home_player"]) { if($config['longtail_enabled']) { $player_longtail_param = '&channel='.$config["longtail_channel"].'&plugins=ltas'; $player_longtail_js = $config["longtail_js"]; $player_autostart = "true"; }else{ $player_longtail_param = ''; $player_longtail_js = ''; $player_autostart = "true"; } if($config['cplayer_skin'] == "default") $player_skin = ""; else $player_skin = "&skin=".$config["website_url"]."player/skins/".$config["cplayer_skin"]; $player_file = urlencode($config["website_url"].'xml.playlist.php?tag='.stripslashes($randKeyword)); $player_colors = '&backcolor='. $config["player_backcolor"]. '&frontcolor='. $config["player_frontcolor"]. '&lightcolor='. $config["player_lightcolor"]. '&screencolor='. $config["player_screencolor"]; } $tpl->assign('enable_home_player',$config["enable_home_player"]); if($config["enable_home_player"]) { $tpl->assign('player_file',$player_file); $tpl->assign('player_skin',$player_skin); $tpl->assign('player_custom_plugins_home',$config["player_custom_plugins_home"]); $tpl->assign('enable_player_colors',$config["enable_player_colors"]); $tpl->assign('player_colors',$player_colors); $tpl->assign('player_longtail_param',$player_longtail_param); $tpl->assign('player_longtail_js',$player_longtail_js); $tpl->assign('player_autostart',$player_autostart); } $tpl->assign('total',ceil($video_list[0]['opensearch:totalresults'] / $config['list_per_page'])); $tpl->assign('videos',$video_list[0][entry]); $tpl->assign('keyword',$keyword ); $tpl->assign('next_page',$next_page); $tpl->assign('prev_page',$prev_page); $tpl->assign('curr_page',$_GET['p']); $tpl->assign('orderby',$orderby); $tpl->assign('list_mode',$config["home_videos_view_mode"]); $tpl->display('home.html'); include "footer.php"; ?>