Scripts

Zeryl Youtube Proxy Browser

Zeryl YouTube Proxy Browser ============ Presentation ------------ Zeryl YouTube Proxy Browser (Z.Y.P.B) is een gratis open source (GNU/GPL) script om gebruikers anoniem youtube te laten browsen. Deze script was op PHP 4 gebaseerd omdat mijn host alleen php4 heeft. Ook heb ik de functie fix_xml() gebruikt omdat ik niet echt wist hoe ik de feed naar array moest doen, en ook geen script kon vinden die dat deed. De XML2Array classe in NIET van mij. JW Flash Player is niet van mij, en moet gedownload worden van http://www.jeroenwijering.com/?item=JW_FLV_Player en moet geupload worden als 'player.swf' swfobject is ook niet van mij, en kan gedownload worden vanaf http://blog.deconcept.com/swfobject/ . moet geupload worden als 'swfobject.swf' De script is geschreven in het engels en zal waarschijnlijk nederlands en andere talen komen. ook ben ik van plan om comments toe te voegen Laatste versie is 1.0.1 Je kan het downloaden hier: http://www.ytexp.zeryl.net/download.php .. ook kun je de Change log zien Installatie ------------ 1. Upload de map naar je webserver. 2. CHMOD (als het nodig is) de bestanden naar 0666 en als het nodig is maak de bestanden in root. * logs.txt * config.php * install.php 3. Ga naar http://www.jou_site_url.com/jou_youtube_proxy_browser_map/install.php 4. Volg de instructies 5. Je moet eerst een database maken voordat je iets kan doen (of gebruik een dat al bestaat) Bug Tracker ----------- Alle bugs verzonden worden naar [email protected] of als een comment achter gelaten worden op phphulp als je de bugs naar de email verzendt, AUB 'ytexp bugs' in de onderwerp zetten jou feedback ------------- Je can feedback geven en/of nieuwe features aanvragen door naar [email protected] mail of comment achterlaten op phphulp als je emailt, AUB 'ytexp feedback' in de onderwerp zetten thats it volges mij.. EDIT: het blijkt dat ik niet alle bestanden toevoegen, dus zal ik alleen index.php plaatsen, als je de rest wilt, kun je het downloaden van de link http://www.ytexp.zeryl.net/download.php

zeryl-youtube-proxy-browser
======= 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]

Reacties

0
Nog geen reacties.