I am trying to get this script t pull information from a localo file, because my recordings have a random title assigned by the script, the thumbnails are random also, what I need is the last 30 pulled by creation time and date, this script is not based in mysql, it is just working from a local file----pulling data from a file called flv.
<?php
include("header.php");
include("inc.php");
if (($rec=$_GET['delete'])&&$delete_from)
{
echo "Deleting $rec ...";
if (file_exists($file = $delete_from . $rec . ".flv")) unlink($file);
if (file_exists($file = $delete_from . $rec . ".key")) unlink($file);
if (file_exists($file = $delete_from . $rec . ".meta")) unlink($file);
if (file_exists($file = "recordings/" . $rec . ".vwr")) unlink($file);
}
?>
<div class="info">
<b>Karaoke Recordings</b> / <a href="index.php">Record New Karaoke Video</a><br />
<?php
$dir="recordings";
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
if ((substr($file,-3)=="vwr") && (!is_dir("$dir/".$file)))
{
$vid=substr($file,0,-4);
$params=explode(";;;",implode(file("$dir/".$file)));
if (count($params))
{
$ts=$params[2];
$tm=floor($ts/60);
$ts=$params[2]-$tm*60;
$info=$params[0]." ($tm:$ts)";
}
echo "<a href='streamplay.php?vid=$vid'><IMG WIDTH='240' TITLE='$info' ALT='$info' BORDER=5 SRC='".(file_exists("snapshots/$vid.jpg")?"snapshots/$vid.jpg":"snapshots/no_video.png")."'></a> ";
}
?>
</div>
<p></b><a href="recorded_videos.php">Browse Video Recordings</a></p>
<p></b><a href="videorecorder.php">Record a New Video</a></p>
Can anyone tell me how to limit this code to pull the last 30 recorded files?