Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/player/playlist.php
<?php

# ------------------------------------------------------------------------------
#
# This file contains the playlist gui for TVEz
#
# ------------------------------------------------------------------------------
#
# Copyright (C) 2003 Christian Eheim and Alex Pachikov
#                                                                               
# This file is part of TVEz (tvez.sourceforge.net).
#                                                                               
# TVEz 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 2 of the License, or
# (at your option) any later version.
#                                                                               
# TVEz 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 TVEz; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#                                                                               
# ------------------------------------------------------------------------------
#
# Created on 10/02/2003 by Christian Eheim
#
# LAST MODIFIED:
# $Date: 2004/01/25 02:11:34 $
# $Revision: 1.6 $
# $Author: eheim $
#
# ------------------------------------------------------------------------------
require "../shared/session.php";
require "../../config/config_file.php";
require "../locale/localize.php";
$TRANSLATED_TEXT = get_translation("../locale");
require "socket.php";
require "../themes/theme.php";
$theme = get_theme();
echo '
<html>
<head>
<link rel="stylesheet" type="text/css" href="../themes/theme.css.php?theme='.$theme.'">
<link rel="stylesheet" type="text/css" href="../themes/theme.css.php?theme='.$theme.'&content=player">
';
?>
</head>

<body onload="javascript:top.volume.location.reload();" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>

<form action=plcontrol.php method=post name=player>
<table cellpadding=0 cellspacing=0 class="pl">
  <tr>
	<td align=center>
	<table width=100% border=0 cellspacing=0>
<?php

$tvst = "playlist\r\n";

list($errno,$ans) = send_command($tvst);

$pl = trim($ans);
$files = split("\n", $pl);
$count = 0;
foreach ($files as $file) {
	$names = split("/", $file);
	if (!$errno && !preg_match("/^(XINE|Authentication|empty)/",$ans)) {
		$nname = substr(end($names),0,70);
		$name = preg_replace("/ /", "&nbsp;", $nname);
		if ($count%2 == 0) $class = "dark";
		else $class = "light";
		echo "<tr><td class=\"$class\">&nbsp;&nbsp;<a href=plcontrol.php?tvst=delete%20$count title=\"".localize_string("Delete from playlist")."\" class=\"pl\">[x]</a>";
		$info = false;
		if (isset($MOVIE_DIRS))
			foreach ($MOVIE_DIRS as $mdir) {
				$mdir = preg_replace("/\//","\/",$mdir);
				if ( preg_match("/$mdir/", $file))
					$info = true;
			}
		if ($info)
			echo "&nbsp;<a href=\"../tvez.php?content=movies&page=movies&field=path&search=".urlencode("/".end($names)."$")."&view=small\" target=\"main\" title=\"".localize_string("View Movie Info")."\" class=\"pl\">[?]</a>";
		else 
			echo "&nbsp;[?]";
		echo "&nbsp;&nbsp;<span class=\"count\">$count</span>&nbsp;<a href=plcontrol.php?tvst=select%20$count title=\"".localize_string("Play '==1=='",$name)."\" class=\"pl\">".$name."</a></td></tr>\n";
	}
	else {
		echo "<tr><td class=\"message\">\n";
		//
		// This is lame. When do I refresh the playlist after XINE start up???
		//
		/*
		if ($file == "XINE is not running" && preg_match("/play /", $_REQUEST{'cmd'}) ) {
			echo "<script language=javascript>\n";
			echo "onload=setTimeout(\"this.document.location.reload();\", 2000);\n";
			echo "</script>\n";
			echo $_REQUEST{'cmd'};
		}
		*/
		if (preg_match("/^empty playlist/",$file))
			echo "&nbsp;&nbsp;".localize_string("Empty Playlist")."\n";
		else
			echo "&nbsp;&nbsp;".$file."\n";
		echo "</td></tr>\n";
	}
	$count++;
}

echo "<tr><td class=reload>&nbsp;&nbsp;<a href=\"javascript:this.document.location.reload();\">&gt;".localize_string("Refresh")."&lt;</a></td></tr>\n";

?>
	</table>
  </td>
 </tr>
</table>
</form>
</body>
</html>
Return current item: TVEz - Media Library