how could i get soemthing like this to work
//sets the file types that can be displayed
if ($show == "newfiles") {
if ($file != "." && $file != ".." && (date("Ymd", filemtime($file)) == $today) && preg_match(getMediaRegex(),$file))
}else {
if ($file != "." && $file != ".." && preg_match(getMediaRegex(),$file))
}
i know the if ($file .....dont have a ; at then end but on a if else you need one. so i add one and it shows all the files. but i need it to sow all of the files and when the show is called only show the new ones.
here is the complet code
<?
//this sets which directory to open.
$today = date("Ymd");
if ($handle = @opendir($contentdir)) {
//while their is content in the dir.
while ($file = readdir($handle))
{
//sets the file types that can be displayed
if ($file != "." && $file != ".." && preg_match(getMediaRegex(),$file))
$retVal[count($retVal)] = $file;
}
//Clean up and sort
closedir($handle);
//if no files are available tell the user
if (count ($retVal)==0){
echo $fileMissingError;
}else {
//sorts the files in soem order ;)
sort($retVal);
......blah blah
[/ph]