<?php
# ------------------------------------------------------------------------------
#
# The extensions distribution
#
# ------------------------------------------------------------------------------
#
# 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 12/12/2003 by Christian Eheim (hide@address.com)
#
# LAST MODIFIED:
# $Date: 2004/02/03 23:21:29 $
# $Revision: 1.1 $
# $Author: eheim $
#
# ------------------------------------------------------------------------------
$freq=array();
$query = 'select lower(reverse(substring(reverse(path), 1, locate(".", reverse(path))-1))) ext, count(*) num from movies group by ext order by num desc';
list ($anum,$rows) = query_db($query);
if ($anum) {
$query = "width=400&height=270&data=";
$other = 0;
$i=0;
$o = false;
foreach ($rows as $movie) {
if ($i>14 || $movie['num']<2) {
$other += $movie['num'];
}
else
$query .= $movie['ext']."^".$movie['num']."^^";
$i++;
}
if ($other > 0)
$query .= "other^$other^^";
portlet(localize_string("Extension Distribution"),'<img src="shared/Graph/pie_chart3d.php?'.$query.'">',"x");
} else
portlet(localize_string("Extension Distribution"),localize_string("No languages have been specified"),"x")
?>