// web sites loop
for ($i = 0; $i < count($smap); $i++) {
Echo "Working on Web Site ID #".$smap[$i]['id']."
";
$xmlfile1 = "/www/sitemap-" . $smap[$i]['id'] . "-page1.php";
$xmlfile2 = "/www/sitemap-" . $smap[$i]['id'] . "-page2.php";
$xmlfile3 = "/www/sitemap-" . $smap[$i]['id'] . "-page3.php";
$xmlfile4 = "/www/sitemap-" . $smap[$i]['id'] . "-page4.php";
$xmlfile5 = "/www/sitemap-" . $smap[$i]['id'] . "-page5.php";
$xmlfile6 = "/www/sitemap-" . $smap[$i]['id'] . "-page6.php";
$xmlfile7 = "/www/sitemap-" . $smap[$i]['id'] . "-page7.php";
$xmlfile8 = "/www/sitemap-" . $smap[$i]['id'] . "-page8.php";
$xmlfile9 = "/www/sitemap-" . $smap[$i]['id'] . "-page9.php";
$xmlfile10 = "/www/sitemap-" . $smap[$i]['id'] . "-page10.php";
$fh1 = fopen($xmlfile1, 'w') or die("can't open");
for ($f = 0; $f < count($smap[$i]['general']); $f++) {
if ($f == 0) { $stringData .= "General Pages
"; }
// general links
Echo "Text:".$smap[$i]['general'][$f][0]." Link:".$smap[$i]['general'][$f][1]."
";
$stringData .= "• " . $smap[$i]['general'][$f][0] ."
";
$count2++;
echo '...' . $count2 . '...';
if ($count2 < 100) {
fwrite($fh1, $stringData);
$stringData = '';
}
if ($count2 == 100) {
echo "
Hit 100
";
if ($count2 > 100) {
fwrite($fh1, $stringData);
$stringData = '';
fclose($fh1);
}
}
if ($count2 == 200) {
echo "
Hit 200
";
fwrite($fh2, $stringData);
$stringData = '';
fclose($fh2);
}
if ($count2 == 300) {
echo "
Hit 300
";
fwrite($fh3, $stringData);
$stringData = '';
fclose($fh3);
}
}
// echo count($smap[$i]['general']);
for ($g = 0; $g < count($smap[$i]['locations']); $g++) {
$vacationrental = '';
$hotel = '';
$studio = '';
$onebedroom = '';
$twobedroom = '';
$threebedroom = '';
$fourbedroom = '';
$privatehome = '';
$sitelinks = '';
// location
Echo "Location:".$smap[$i]['locations'][$g]."
";
for ($s = 0; $s < count($smap[$i]['location_links'][$smap[$i]['locations'][$g]]); $s++) {
// location links
Echo "Text:".$smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0]." Link:".$smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][1]."
";
$site = strtolower($smap[$i]['locations'][$g]);
if (!$place) { $place = substr($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 0, 4); }
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Vacation Rentals');
if (($bed) && (!$vacationrental)) { $stringData .= "
Vacation Rentals
";
$vacationrental = 1;
$place = '';
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Hotels');
if (($bed) && (!$hotel)) { $stringData .= "
Hotels
";
$hotel = 1;
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Studio');
if (($bed) && (!$studio)) { $stringData .= "
Studios
";
$studio = 1;
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'One-Bedroom');
if (($bed) && (!$onebedroom)) { $stringData .= "
One-Bedroom
";
$onebedroom = 1;
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Two-Bedroom');
if (($bed) && (!$twobedroom)) { $stringData .= "
Two-Bedroom
";
$twobedroom = 1;
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Three-Bedroom');
if (($bed) && (!$threebedroom)) { $stringData .= "
Three-Bedroom
";
$threebedroom = 1;
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Four-Bedroom');
if (($bed) && (!$fourbedroom)) { $stringData .= "
Four-Bedroom
";
$fourbedroom = 1;
}
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0], 'Private Homes');
if (($bed) && (!$privatehome)) { $stringData .= "
Private Homes
";
$privatehome = 1;
}
/*
$bed = strpos($smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][1], $site.'-');
if (($bed) && (!$sitelinks)) { $stringData .= "
Content Pages
";
$sitelinks = 1;
}
*/
$stringData .= "• " . $smap[$i]['location_links'][$smap[$i]['locations'][$g]][$s][0] ."
";
$count2++;
echo '...' . $count2 . '...';
if ($count2 == 100) {
echo "
Hit 100
";
fopen($xmlfile1, 'a') or die("can't open");
fwrite($fh1, $stringData);
$stringData = '';
fclose($fh1);
}
if ($count2 == 200) {
$fh2 = fopen($xmlfile2, 'w') or die("can't open");
echo "
Hit 200
";
fwrite($fh2, $stringData);
$stringData = '';
fclose($fh2);
}
if ($count2 == 300) {
$fh3 = fopen($xmlfile3, 'w') or die("can't open");
echo "
Hit 300
";
fwrite($fh3, $stringData);
$stringData = '';
fclose($fh3);
}
if ($count2 == 400) {
$fh4 = fopen($xmlfile4, 'w') or die("can't open");
echo "
Hit 400
";
fwrite($fh4, $stringData);
$stringData = '';
fclose($fh4);
}
if ($count2 == 500) {
$fh5 = fopen($xmlfile5, 'w') or die("can't open");
echo "
Hit 500
";
fwrite($fh5, $stringData);
$stringData = '';
fclose($fh5);
}
if ($count2 == 600) {
$fh6 = fopen($xmlfile6, 'w') or die("can't open");
echo "
Hit 600
";
fwrite($fh6, $stringData);
$stringData = '';
fclose($fh6);
}
if ($count2 == 700) {
$fh7 = fopen($xmlfile7, 'w') or die("can't open");
echo "
Hit 700
";
fwrite($fh7, $stringData);
$stringData = '';
fclose($fh7);
}
if ($count2 == 800) {
$fh8 = fopen($xmlfile8, 'w') or die("can't open");
echo "
Hit 800
";
fwrite($fh8, $stringData);
$stringData = '';
fclose($fh8);
}
if ($count2 == 900) {
$fh9 = fopen($xmlfile9, 'w') or die("can't open");
echo "
Hit 900
";
fwrite($fh9, $stringData);
$stringData = '';
fclose($fh9);
}
if ($count2 == 1000) {
$fh10 = fopen($xmlfile10, 'w') or die("can't open");
echo "
Hit 1000
";
fwrite($fh10, $stringData);
$stringData = '';
fclose($fh10);
}
}
}
//Write Last Page
if (($count2 > 0) && ($count2 <= 100)) {
$fh1 = fopen($xmlfile1, 'a') or die("can't open");
fwrite($fh1, $stringData);
}
if (($count2 > 100) && ($count2 <= 200)) {
$fh2 = fopen($xmlfile2, 'w') or die("can't open");
fwrite($fh2, $stringData);
fclose($fh2);
}
if (($count2 > 200) && ($count2 <= 300)) {
$fh3 = fopen($xmlfile3, 'w') or die("can't open");
fwrite($fh3, $stringData);
fclose($fh3);
}
if (($count2 > 300) && ($count2 <= 400)) {
$fh4 = fopen($xmlfile4, 'w') or die("can't open");
fwrite($fh4, $stringData);
fclose($fh4);
}
if (($count2 > 400) && ($count2 <= 500)) {
$fh5 = fopen($xmlfile5, 'w') or die("can't open");
fwrite($fh5, $stringData);
fclose($fh5);
}
if (($count2 > 500) && ($count2 <= 600)) {
$fh6 = fopen($xmlfile6, 'w') or die("can't open");
fwrite($fh6, $stringData);
fclose($fh6);
}
if (($count2 > 600) && ($count2 <= 700)) {
$fh7 = fopen($xmlfile7, 'w') or die("can't open");
fwrite($fh7, $stringData);
fclose($fh7);
}
if (($count2 > 700) && ($count2 <= 800)) {
$fh8 = fopen($xmlfile8, 'w') or die("can't open");
fwrite($fh8, $stringData);
fclose($fh8);
}
if (($count2 > 800) && ($count2 <= 900)) {
$fh9 = fopen($xmlfile9, 'w') or die("can't open");
fwrite($fh9, $stringData);
fclose($fh9);
}
if (($count2 > 900) && ($count2 <= 1000)) {
$fh9 = fopen($xmlfile10, 'w') or die("can't open");
fwrite($fh10, $stringData);
fclose($fh10);
}
}
echo $count;
if (fh1) { fclose($fh1); }
?>