Jump to content

sitemap exclude directory if no html file exist


damerit

Recommended Posts

This is part of a common free GPL sitemp.php file and I am trying to modify it so that I can only list the folder if it has a .html extension. I have hundreds of folders and I don't want to display all of them nor exclude each one.

 

Can I get some pointers or ideas? 

 

$display['html'] = "html.gif";
$excludedir[] = "";
$excludefile[] = "";

while ($file = readdir($handle))
{
if(is_dir($file) && $file != "." && $file != ".." && !in_array($file, $excludedir))
{ $sdirs[] = $file; }
elseif(is_file($file) && $file != "$self" && array_key_exists(get_extension($file), $display)
&& !in_array($file, $excludefile))
{ $sfiles[] = $file; }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.