Click to See Complete Forum and Search --> : Php TV Menagement system


sadek
12-07-2005, 07:57 AM
Hi,
I am looking for kind of Management System designed for handling many video files. I want to do sort of tv showing video files located on my server. I could probably write script by myself but i am looking for something like PhpAdNew (http://phpadsnew.com/two/) (Ads Management), so I could set all kinds of options like playlist etc. Thanks in advance for all help.

LiLcRaZyFuZzY
12-07-2005, 10:13 AM
it's not too common, so i guess you'd have to write it yourself
--

hey, you're the guy from flashroom.com, aren't you?

ShrineDesigns
12-07-2005, 02:08 PM
sorting the files is fairly simple, example<?php
function sort_name($a, $b)
{
return strnatcasecmp($a['name'], $b['name']);
}
function sort_size($a, $b)
{
if($a['size'] > $b['size'])
{
return -1;
}
else if($a['size'] < $b['size'])
{
return 1;
}
return 0;
}
$dir = 'path/to/videos/';
$videos = array();

if($dh = @opendir($dir))
{
while($x = readdir($dh))
{
if($x != '.' && $x != '..')
{
if(is_file($dir . $x))
{
$videos[] = array('name' => $x, 'size' => filesize($dir . $x));
}
}
}
@closedir($dh);
$names = $videos;
uasort($names, 'sort_name');
$sizes = $videos;
uasort($sizes, 'sort_size');
print_r($videos);
print_r($names);
print_r($sizes);
}
?>btw, nice avatar the laughing man logo

sadek
12-07-2005, 02:49 PM
Thx for help, and I am glad You like avatar. Not many people recognize this stuff :-)))

ShrineDesigns
12-07-2005, 04:28 PM
no problem, i am a big fan of shirow's works