1) { $seo_title = array_pop($p_url); } $_GET['q'] = $frontpage_keyword; // ################# Start getting Youtube GData ############################## $video_list = YT_ListByTag($_GET['q'], $_GET['p']); // ################# 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 ########################## $tpl->assign('total',ceil($video_list[0]['opensearch:totalresults'] / $config['list_per_page'])); $tpl->assign('videos',$video_list[0][entry]); $tpl->assign('keyword',urldecode(stripslashes($_GET['q']))); $tpl->assign('next_page',$next_page); $tpl->assign('prev_page',$prev_page); $tpl->assign('curr_page',$_GET['p']); $tpl->display('list.html'); ?>