======= index.php (je kun de rest vinden als je de script download) =======

[code]<?php
/*****
 *  Copyright 2008 Hoshang Sadiq, Zeryl
 *
 *  JW FLV Media Player v3.14
 *  by Jeroen Wijering - http://www.jeroenwijering.com/
 *
 *  SWFObject v1.5
 *  by Geoff Stearns - http://blog.deconcept.com/swfobject/
 *  2007
 *
 *  For more information on this script, visit:
 *  http://ytexp.zeryl.net/
 *
 *  This file is part of Zeryl YouTube Proxy Browser (Z.Y.P.B.).
 *
 *  Z.Y.P.B. is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Z.Y.P.B. is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Z.Y.P.B.  If not, see <http://www.gnu.org/licenses/>.
 *******/

include_once('functions.php');
include_once('xml2array.class.php');
include_once('youtube.class.php');
include_once('connect.php');

$stag = '';
$tag = checkget('tag');
if($tag != '') {
	$stag = urlencode($tag);
}

$type = checkget('type');
if($type == '') {
	$type = 'top_rated';
}

//die(idOnly('http://www.youtube.com/watch?v=cI1AwZN4ZYg'));
$yt = new youtube($type, $stag);
$res = $yt->display();
if(isset($res['videos'])) {
	$video_list = $res['videos'];
} else {
	$video_list = array();
}
$first_vid = $res['video_id'];
$first_index = $res['video_index'];
$pages = $res['pages'];

$get_array = YoutubeGetLink($first_vid);
$link = $get_array['link'];
$img = $get_array['imglink'];

if($log_videos == true) {
	$sql = "SELECT `yt_id`, `yt_views`, `yt_downloads` FROM `downloads` WHERE `yt_id` = '".$first_vid."';";
	$query = @mysql_query($sql) or yt_log(mysql_error(), 'Could not select from downloads', __LINE__, __FILE__);
	$results = @mysql_fetch_assoc($query);
}

if(!(isset($results['yt_id']) && $results['yt_id'] == $first_vid)) {
	$results['yt_id'] = $first_vid;
	$results['yt_views'] = 0;
	$results['yt_downloads'] = 0;
}

include('header.php');
?>		<div id="rightmenu">
			<h2><?php echo fromlist($video_list, $first_index, 'title', 'Unknown'); ?></h2>

			<div id="flashplayer"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>

			<script type="text/javascript">
			<!--
				var object = new SWFObject("player.swf", "mediaplayer", "425", "350", "7");
				object.addParam("allowfullscreen", "true");
				object.addVariable("width", "425");
				object.addVariable("height", "351");
				object.addVariable("showstop", "true");
				object.addVariable("file", encodeURIComponent("<?php echo $link; ?>"));
				object.addVariable("image", encodeURIComponent("<?php echo $img; ?>"));
				object.addVariable("type", "flv");
				object.write("flashplayer");
			-->
			</script>

			<div class="stats">
				Author: <span class="statVal"><?php echo fromlist($video_list, $first_index, 'authorname', 'Unknown'); ?></span><br />
				Views: <span class="statVal"><?php echo $get_array['views']; ?> (YouTube Only)</span><br />
				Views: <span class="statVal"><?php echo $results['yt_views']; ?> (Zeryl Only)</span><br />
				Comments: <span class="statVal"><?php echo $get_array['comments']; ?></span><br />
				Added: <span class="statVal"><?php echo $get_array['posted_on']; ?></span><br />
				Tags: <span class="statVal"><?php echo generate_tags($get_array['tags']); ?></span><br />
				Download: <span class="statVal"><a href="<?php echo $get_array['dllink']; ?>">download</a></span><br />
				Downloads: <span class="statVal"><?php echo $results['yt_downloads']; ?> (Zeryl Only)</span><br />
				YouTube link: <a href="<?php echo fromlist($video_list, $first_index, 'url', '0'); ?>" target="_blank"><?php echo fromlist($video_list, $first_index, 'url', '0'); ?></a>
			</div>
			<br /><br />
			<div id="description">
				<?php echo nl2br(stripslashes(htmlspecialchars($get_array['desc']))); ?>
			</div>
		</div>
		<div id="inside">
			<form method="get" action="index.php">
				View <select name="type">
                  <option value="top_rated" <?php echo ($type == '' || $type == 'top_rated') ? 'selected="selected"' : ''; ?>>Top rated</option>
                  <option value="top_favorites" <?php echo ($type == 'top_favorites') ? 'selected="selected"' : ''; ?>>Top favorites</option>
                  <option value="most_viewed" <?php echo ($type == 'most_viewed') ? 'selected="selected"' : ''; ?>>Most viewed</option>
                  <option value="most_recent" <?php echo ($type == 'most_recent') ? 'selected="selected"' : ''; ?>>Most recent</option>
                  <option value="most_discussed" <?php echo ($type == 'most_discussed') ? 'selected="selected"' : ''; ?>>Most discussed</option>
                  <option value="most_linked" <?php echo ($type == 'most_linked') ? 'selected="selected"' : ''; ?>>Most linked</option>
                  <option value="most_responded" <?php echo ($type == 'most_responded') ? 'selected="selected"' : ''; ?>>Most responded</option>
                  <option value="recently_featured" <?php echo ($type == 'recently_featured') ? 'selected="selected"' : ''; ?>>Recently featured</option>
                </select>
				<input value="Go" type="submit" />
			</form>
			<?php pages($pages); ?>
			<table id="results">
				<tbody>
<?php
// loop through each video in the list and display it for design purposes
$i = 0;
if(isset($_GET['page']) && $_GET['page'] != '' && $_GET['page'] != 0) {
	$stag .= '&amp;page='.$_GET['page'];
}
$tr = true;
if(isset($video_list) && count($video_list) > 0) {
	foreach ($video_list as $index => $video) {
		if ($tr == true) {
			echo '					<tr>'."\n";
			$tr = false;
		}
		// limit the title's length so it doesn't break the design
		$title = shorten($video['title'], 10, $video['id'], $stag);
		$thumburl = 'get.php?vid='.$video['id'].'&amp;get_image_only=true&amp;file_type=.jpg';
		$length = sec2hms($video['length']);
		$ustag = ($stag != '') ? 'tag='.$stag.'&amp;' : '';
		$ustag .= 'type='.$type.'&amp;';
		$rating = (isset($video['avrating']) && $video['avrating'] > 0) ? $video['avrating'].' / '.$video['totalrates'] : '0 / 0';
		echo '						<td class="thumb">'."\n";
		echo '							<a href="?'.$ustag.'video_id='.$video['id'].'"><img src="'.$thumburl.'" alt="'.htmlspecialchars($video['title']).'" /></a><br />'."\n";
		echo '							<span class="title_short">'.$title.'</span><br />'."\n";
		echo '							<span class="length_short">length: '.$length.'</span><br />'."\n";
		echo '							<span class="rating_short">'.$rating.'</span><br />'."\n";
		echo '						</td>'."\n";
		// only 4 videos per row
		$i++;
		if ($i == 4) {
			echo '					</tr>'."\n";
			$i = 0;
			$tr = true;
		}
	}
} else {
	echo '<br /><br /><br /><h1>Something went wrong, please try again later</h1><br /><br />';
}
?>
				</tbody>
			</table>
			<?php pages($pages); ?>
		</div>
<?php include('footer.php'); ?>[/code]