";
@ob_flush();
@flush();
//Loop through the matches and create a page for each one
echo "Creating pages in: $dir
";
@ob_flush();
@flush();
if($dir)
{
for($i = 0; $i < count($matches); $i++)
{
createPage($i, $matches, $dir);
}
}
//Create the sitemap using the directory made, the array of matches and specified page priority
echo "Creating sitemap for: $dir
";
@ob_flush();
@flush();
$sitemap = createSiteMap($dir, $matches, 0.9);
//Update main sitemap of all sitemaps each with specified page priority
echo "Updating main sitemap.xml. Adding: $sitemap
Script completed successfully.
"; } while(is_dir($prefix."_".$i)) { $i++; } if(mkdir($prefix."_".$i)) { return $prefix."_".$i; } else { return false; } } //This function fixes the array keys, since array_unique preserves the keys and unsets the duplicates, //leaving gaps in the keys. This shifts them back in order. function cleanArrayKeys($arr) { foreach($arr as $a) { if(isset($a)) { $result[] = $a; } } return $result; } "; for($i = 1; $i < 5; $i++) { $next = (($index) * 4 + $i) % count($matches); $page .= "$matches[$next]\n"; } $page .="