Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/menu/portlets/movie_new.php
<?php

# ------------------------------------------------------------------------------
#
# Latest Additions Portlet
#
# ------------------------------------------------------------------------------
#
# 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 02/12/2003 by Christian Eheim (hide@address.com)
#
# LAST MODIFIED:
# $Date: 2004/01/25 02:11:33 $
# $Revision: 1.6 $
# $Author: eheim $
#
# ------------------------------------------------------------------------------

	# The length in characters the movie title will be cut to
	$chopto = 16;

	# New Additions
    $query = "SELECT * from movies ORDER by date DESC,title LIMIT 0,10";
    list($num,$d_movies) = query_db($query);

	if ($num) {
		$content = "";
		foreach ($d_movies as $m) {
			$ms = $m['id'];
			$mt = substr($m['title'],0,$chopto);
			if (strlen($m['title']) > $chopto) $mt .= "...";
			if (isset($_SESSION['tvezAccess']) || !$LOGIN_ENABLED)
				$content .= "<a href=\"player/plcontrol.php?tvst=play ".$m{"path"}."\" target=playlist><img src=images/right.gif border=0 alt=\"".localize_string("Play")."\" title=\"".localize_string("Play '==1=='", $m{'title'})."\"></a>&nbsp;";
			$content .= "<a href=\"".$_SERVER['PHP_SELF']."?content=movies&page=movies&field=id&search=$ms&view=small\" title=\"".localize_string("View Movie Info")."\">".$mt."</a><br>\n";
		}
		menu(localize_string("10 New Movies"),$content);
   	}
	else
		menu(localize_string("10 New Movies"),localize_string("No movies have been added"));

?>
Return current item: TVEz - Media Library