Home Equity Loan Site Map

Home Equity Loan

Home Equity Loan

Home Equity Loan

Home Equity Loan

Equity Loan

Equity Loan

Equity Loan

Home Equity Loan Rate

Home Equity Loan Rate

Home Equity Loan Rate

Home Equity Loan Bad Credit

Home Equity Loan Bad Credit

Home Equity Loan Bad Credit

Home Equity Loan Calculator

Home Equity Loan Calculator

Home Equity Loan Calculator

Home Equity Loan Refinancing

Home Equity Loan Refinancing

Home Equity Loan Refinancing

Home Equity Line Credit Loan

Home Equity Line Credit Loan

Home Equity Line Credit Loan

Best Home Equity Loans

Best Home Equity Loans

Best Home Equity Loans

Refinancing Equity Loan

Refinancing Equity Loan

Refinancing Equity Loan

Home Equity Loan Online

Home Equity Loan Online

Home Equity Loan Online

Best Home Equity Loan

Best Home Equity Loan

Best Home Equity Loan

Home Equity Loan Nevada

Home Equity Loan Nevada

Home Equity Loan Nevada

Va Home Equity Loan

Va Home Equity Loan

Va Home Equity Loan

Home Equity Loan Interest Rate

Home Equity Loan Interest Rate

Home Equity Loan Interest Rate

Equity Loan Rate

Equity Loan Rate

Equity Loan Rate

Refinance Home Equity Loan

Refinance Home Equity Loan

Refinance Home Equity Loan

Mobile Home Equity Loan

Mobile Home Equity Loan

Mobile Home Equity Loan

Home Equity Loan Lowest Rate

Home Equity Loan Lowest Rate

Home Equity Loan Lowest Rate

Home Equity Loan Ohio

Home Equity Loan Ohio

Home Equity Loan Ohio

Home Equity Loan Company

Home Equity Loan Company

Home Equity Loan Company

Home Equity Loan Information

Home Equity Loan Information

Home Equity Loan Information

Home Equity Mortgage Loan

Home Equity Mortgage Loan

Home Equity Mortgage Loan

Home Equity Loan Maryland

Home Equity Loan Maryland

Home Equity Loan Maryland

Well Fargo Home Equity Loan

Well Fargo Home Equity Loan

Well Fargo Home Equity Loan

Second Mortgage And Home Equity Loan

Second Mortgage And Home Equity Loan

Second Mortgage And Home Equity Loan

Home Equity Loan In Texas

Home Equity Loan In Texas

Home Equity Loan In Texas

Bad Credit Equity Loan

Bad Credit Equity Loan

Bad Credit Equity Loan

Best Home Equity Loan Rate

Best Home Equity Loan Rate

Best Home Equity Loan Rate

Miami Home Equity Loan

Miami Home Equity Loan

Miami Home Equity Loan

Home Equity Loan In Florida

Home Equity Loan In Florida

Home Equity Loan In Florida

Equity Loan Calculator

Equity Loan Calculator

Equity Loan Calculator

Home Equity Loan New York

Home Equity Loan New York

Home Equity Loan New York

Fixed Rate Home Equity Loan

Fixed Rate Home Equity Loan

Fixed Rate Home Equity Loan

Home Equity Loan Rate California

Home Equity Loan Rate California

Home Equity Loan Rate California

Home Equity Loan Connecticut

Home Equity Loan Connecticut

Home Equity Loan Connecticut

Home Equity Loan West Virginia

Home Equity Loan West Virginia

Home Equity Loan West Virginia

Home Equity Loan New Jersey

Home Equity Loan New Jersey

Home Equity Loan New Jersey

Jacksonville Home Equity Loan

Jacksonville Home Equity Loan

Jacksonville Home Equity Loan

Home Equity Loan Dallas

Home Equity Loan Dallas

Home Equity Loan Dallas

No Equity Loan

No Equity Loan

No Equity Loan

Bank Of America Home Equity Loan

Bank Of America Home Equity Loan

Bank Of America Home Equity Loan

Home Equity Loan Rate Florida

Home Equity Loan Rate Florida

Home Equity Loan Rate Florida

Home Equity Loan Michigan

Home Equity Loan Michigan

Home Equity Loan Michigan

Tampa Home Equity Loan

Tampa Home Equity Loan

Tampa Home Equity Loan

Low Rate Home Equity Loan

Low Rate Home Equity Loan

Low Rate Home Equity Loan

Loan Mortgage Home Equity Real Estate

Loan Mortgage Home Equity Real Estate

Loan Mortgage Home Equity Real Estate

Home Equity Loan And Poor Credit

Home Equity Loan And Poor Credit

Home Equity Loan And Poor Credit

Washington Mutual Home Equity Loan

Washington Mutual Home Equity Loan

Washington Mutual Home Equity Loan

Fast Home Equity Loan

Fast Home Equity Loan

Fast Home Equity Loan

Fixed Home Equity Loan

Fixed Home Equity Loan

Fixed Home Equity Loan

Equity Loan

Equity Loan

Equity Loan

Home Equity Line Of Credit

Home Equity Line Of Credit

Home Equity Line Of Credit

Home Equity Loan Massachusetts

Home Equity Loan Massachusetts

Home Equity Loan Massachusetts

Home Equity Loan New Hampshire

Home Equity Loan New Hampshire

Home Equity Loan New Hampshire

Equity Loan Mortgage

Equity Loan Mortgage

Equity Loan Mortgage

Home Equity Loan Refinance Credit

Home Equity Loan Refinance Credit

Home Equity Loan Refinance Credit

Home Equity Loan

Home Equity Loan

Home Equity Loan

Clearwater Home Equity Loan

Clearwater Home Equity Loan

Clearwater Home Equity Loan

Low Interest Home Equity Loan

Low Interest Home Equity Loan

Low Interest Home Equity Loan

Pennsylvania Home Equity Loan Rate

Pennsylvania Home Equity Loan Rate

Pennsylvania Home Equity Loan Rate

Home Equity Loan Payment Calculator

Home Equity Loan Payment Calculator

Home Equity Loan Payment Calculator

Debt Consolidation Home Equity Loan

Debt Consolidation Home Equity Loan

Debt Consolidation Home Equity Loan

No Income Verification Home Equity Loan

No Income Verification Home Equity Loan

No Income Verification Home Equity Loan

Easy Home Equity Loan

Easy Home Equity Loan

Easy Home Equity Loan

Definition Of Home Equity Loan

Definition Of Home Equity Loan

Definition Of Home Equity Loan

No Equity Home Loan

No Equity Home Loan

No Equity Home Loan

Home Equity Lones

Home Equity Lones

Home Equity Lones

No Equity Home Improvement Loan

No Equity Home Improvement Loan

No Equity Home Improvement Loan

Florida Home Equity Loan Refinancing

Florida Home Equity Loan Refinancing

Florida Home Equity Loan Refinancing

Home Equity Loan Nj

Home Equity Loan Nj

Home Equity Loan Nj

Home Equity Loan Bankruptcy

Home Equity Loan Bankruptcy

Home Equity Loan Bankruptcy

Bank One Home Equity Loan

Bank One Home Equity Loan

Bank One Home Equity Loan

Home Equity Loan Compare

Home Equity Loan Compare

Home Equity Loan Compare

Home Equity Loan Tennessee

Home Equity Loan Tennessee

Home Equity Loan Tennessee

Home Equity Loan Minnesota

Home Equity Loan Minnesota

Home Equity Loan Minnesota

Home Equity And Consolidation Loan

Home Equity And Consolidation Loan

Home Equity And Consolidation Loan

Home Equity Loan Without Perfect Credit

Home Equity Loan Without Perfect Credit

Home Equity Loan Without Perfect Credit

Home Equity Loan Utah

Home Equity Loan Utah

Home Equity Loan Utah

Alabama Home Equity Loan

Alabama Home Equity Loan

Alabama Home Equity Loan

Alaska Home Equity Loan

Alaska Home Equity Loan

Alaska Home Equity Loan

Arizona Home Equity Loan

Arizona Home Equity Loan

Arizona Home Equity Loan

Arkansas Home Equity Loan

Arkansas Home Equity Loan

Arkansas Home Equity Loan

California Home Equity Loan

California Home Equity Loan

California Home Equity Loan

Colorado Home Equity Loan

Colorado Home Equity Loan

Colorado Home Equity Loan

Connecticut Home Equity Loan

Connecticut Home Equity Loan

Connecticut Home Equity Loan

Delaware Home Equity Loan

Delaware Home Equity Loan

Delaware Home Equity Loan

District Of Columbia Home Equity Loan

District Of Columbia Home Equity Loan

District Of Columbia Home Equity Loan

Florida Home Equity Loan

Florida Home Equity Loan

Florida Home Equity Loan

Georgia Home Equity Loan

Georgia Home Equity Loan

Georgia Home Equity Loan

Hawaii Home Equity Loan

Hawaii Home Equity Loan

Hawaii Home Equity Loan

Idaho Home Equity Loan

Idaho Home Equity Loan

Idaho Home Equity Loan

Illinois Home Equity Loans

Illinois Home Equity Loans

Illinois Home Equity Loans

Indiana Home Equity Loan

Indiana Home Equity Loan

Indiana Home Equity Loan

Iowa Home Equity Loan

Iowa Home Equity Loan

Iowa Home Equity Loan

Kansas Home Equity Loans

Kansas Home Equity Loans

Kansas Home Equity Loans

Kentucky Home Equity Loan

Kentucky Home Equity Loan

Kentucky Home Equity Loan

Louisiana Home Equity Loan

Louisiana Home Equity Loan

Louisiana Home Equity Loan

Maine Home Equity Loan

Maine Home Equity Loan

Maine Home Equity Loan

Maryland Home Equity Loan

Maryland Home Equity Loan

Maryland Home Equity Loan

Massachusetts Home Equity Loan

Massachusetts Home Equity Loan

Massachusetts Home Equity Loan

Michigan Home Equity Loans

Michigan Home Equity Loans

Michigan Home Equity Loans

Minnesota Home Equity Loan

Minnesota Home Equity Loan

Minnesota Home Equity Loan

Mississippi Home Equity Loan

Mississippi Home Equity Loan

Mississippi Home Equity Loan

Missouri Home Equity Loan

Missouri Home Equity Loan

Missouri Home Equity Loan

Montana Home Equity Loan

Montana Home Equity Loan

Montana Home Equity Loan

Nebraska Home Equity Loan

Nebraska Home Equity Loan

Nebraska Home Equity Loan

Nevada Home Equity Loan

Nevada Home Equity Loan

Nevada Home Equity Loan

New Hampshire Home Equity Loan

New Hampshire Home Equity Loan

New Hampshire Home Equity Loan

New Jersey Home Equity Loan

New Jersey Home Equity Loan

New Jersey Home Equity Loan

New Mexico Home Equity Loans

New Mexico Home Equity Loans

New Mexico Home Equity Loans

New York Home Equity Loan

New York Home Equity Loan

New York Home Equity Loan

North Carolina Home Equity Loan

North Carolina Home Equity Loan

North Carolina Home Equity Loan

North Dakota Home Equity Loan

North Dakota Home Equity Loan

North Dakota Home Equity Loan

Ohio Home Equity Loan

Ohio Home Equity Loan

Ohio Home Equity Loan

Oklahoma Home Equity Loans

Oklahoma Home Equity Loans

Oklahoma Home Equity Loans

Oregon Home Equity Loan

Oregon Home Equity Loan

Oregon Home Equity Loan

Pennsylvania Home Equity Loan

Pennsylvania Home Equity Loan

Pennsylvania Home Equity Loan

Rhode Island Home Equity Loan

Rhode Island Home Equity Loan

Rhode Island Home Equity Loan

South Carolina Home Equity Loan

South Carolina Home Equity Loan

South Carolina Home Equity Loan

Tennessee Home Equity Loan

Tennessee Home Equity Loan

Tennessee Home Equity Loan

Texas Home Equity Loan

Texas Home Equity Loan

Texas Home Equity Loan

Utah Home Equity Loan

Utah Home Equity Loan

Utah Home Equity Loan

Vermont Home Equity Loan

Vermont Home Equity Loan

Vermont Home Equity Loan

Virginia Home Equity Loan

Virginia Home Equity Loan

Virginia Home Equity Loan

Washington Home Equity Loan

Washington Home Equity Loan

Washington Home Equity Loan

West Virginia Home Equity Loan

West Virginia Home Equity Loan

West Virginia Home Equity Loan

Wisconsin Home Equity Loan

Wisconsin Home Equity Loan

Wisconsin Home Equity Loan

Wyoming Home Equity Loan

Wyoming Home Equity Loan

Wyoming Home Equity Loan

"); } $fileLength = filesize($ourFile); $ourSetUpDate=fread($fp,$fileLength); $elapsedSeconds=$timeNow-$ourSetUpDate; //print "$ourSetUpDate

"; $howManyToPrint=intval(($elapsedSeconds)/$ourDivisor)+1; //Calc how many to print fclose($fp); //print"Time Now: $timeNow -- Time Set Up: $ourSetUpDate -- How many to run: $howManyToPrint -- Elapsed Seconds: $elapsedSeconds -- Divisor: $ourDivisor

"; // Now fetch the master links file $linksFileName = "http://www.firstlinx-inc.com/unof.lks"; $fp = fopen("$linksFileName", "r"); if (!$fp){ echo ("Failed To Open file named $linksFileName.

"); } fclose($fp); $ourLines=file($linksFileName); // Now pack the links data into an array $numberOfElements=count($ourLines); $numberOfLinks= $numberOfElements/2; $i=0; while ($i <= $numberOfElements-1) { $urlArray[$i] = "$ourLines[$i]"; //print "$ourLines[$i]
"; $i++; } //Now print as many links as we are allowed. $i = 1; $counter=1; $linkToPrint=SERIES001-200; if ($printHowManyLinks==0 || $printHowManyLinks ==''){ while ($i <=$howManyToPrint && $i<=$numberOfLinks) { $offSet = ($linkToPrint*2)-2; $ourLineToPrint = ''.ucwords($urlArray[$offSet+1]).'

'; $ourLineToPrint = eregi_replace("\n",'',$ourLineToPrint); //Strip out carriage returns $ourLineToPrint = eregi_replace("\r",'',$ourLineToPrint); //Strip out new line chars print "$ourLineToPrint\n"; $linkToPrint++; $i++; } }else{ $offSet = ($linkToPrint*2)-2; $ourLineToPrint = ''.ucwords($urlArray[$offSet+1]).'

'; $ourLineToPrint = eregi_replace("\n",'',$ourLineToPrint); //Strip out carriage returns $ourLineToPrint = eregi_replace("\r",'',$ourLineToPrint); //Strip out new line chars print "$ourLineToPrint\n"; } } ?>"; $i++; } if (file_exists($dataFolder)) { $code = chdir($dataFolder); $ourFileName = $scriptFileName.'.dat'; if (file_exists($ourFileName)) { //print "

Fetching

"; $fp = fopen("$ourFileName", "r"); $ourFileNameLength = filesize($ourFileName); $rawData=fread($fp,$ourFileNameLength); $rawData = StripInvisibles($rawData); //Strip out invisibles $tempArray = explode(',',$rawData); //Extract data $numberOfLastSentenceUsed = $tempArray[0]; $lastChangeDate = $tempArray[1]; } else{ UpdateTheUpdateFile($ourFileName,$dayOfTheYear,0); //print "

Updating

"; } } else { print ("The folder $dataFolder does not exist.

I'm quitting"); exit; } //See if we need to do an update //First build in a randomizer + or - a few days $variance = rand(0,$randomizer); if (rand(1,100)>50){ //Make the number negative half the time $variance=$variance*-1; } $adjustedUpdateDay=$lastChangeDate+$updateEveryHowManyDays+$variance; if ($adjustedUpdateDay>365){ //adjust for adjusted numbers that may go over 365 $adjustedUpdateDay = $adjustedUpdateDay-365; } if ($dayOfTheYear-$lastChangeDate<=$minimumNoUpdateDays){ //Don't update if we've updated in the last $minimumNoUpdateDays $noUpdDateFlag = 1; //No update }else{ $noUpdDateFlag = 0; //Update } if ($numberOfLastSentenceUsed == 0){ $newSentenceText = ''; }else{ //$newSentenceText = $textArray[$numberOfLastSentenceUsed-1]."

\n"; // The default print is what we did last time } //See if it is time now to do the update if ($dayOfTheYear>$adjustedUpdateDay && $noUpdDateFlag == 0){ //Then do an update //- if (is_numeric($requestedSentence)) { $newSentenceNumber = $requestedSentence; $newSentenceText = $textArray[$newSentenceNumber-1]."

\n"; //Adjust for array start at 0 if ($newSentenceNumber == 0){ $newSentenceText=""; } UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$newSentenceNumber); //print "

Update
New Sentence: $newSentenceNumber

"; } else{ //- $newSentenceNumber = rand(1,($numberOfTextSentences)); if ($newSentenceNumber == 0){ //A chance there will be no next on the update $newSentenceText=""; }else{ $newSentenceText = $textArray[($newSentenceNumber-1)]."

\n"; //Adjust for array start at 0 } UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$newSentenceNumber); //print "

Update
New Sentence: $newSentenceNumber

"; } } else { $newSentenceText = $textArray[($numberOfLastSentenceUsed-1)]; //print "

No update

"; } print "$newSentenceText"; chdir($startingDir); } function StripInvisibles ($stringToStrip) { $stringToStrip = eregi_replace("\n",'',$stringToStrip); //Strip out carriage returns $stringToStrip = eregi_replace("\r",'',$stringToStrip); //Strip out new line chars return $stringToStrip; } function UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$numberOfLastSentenceUsed){ $lastChangeDate = $numberOfLastSentenceUsed.','.$dayOfTheYear; $fp = fopen("$ourFileName", "w"); $ourFileNameLength = strlen($ourFileName); fwrite($fp,$lastChangeDate); fclose($fp); } function UpdateTheUrlUpdateFile($ourFileName,$timeNow,&$urlNumberArray,$pathToDataFolder){ chdir($pathToDataFolder); $howManyUrlsInArray=count($urlNumberArray); $utufDataStringToWrite = "$timeNow,"; for ($counter=0;$counter<$howManyUrlsInArray;$counter++) { $utufDataStringToWrite = $utufDataStringToWrite.$urlNumberArray[$counter].','; //print "$counter = $urlNumberArray[$counter]
"; } $utufDataStringToWrite = preg_replace('/,\Z/', '',$utufDataStringToWrite);//Strip off trailing comma //print "

How many urls: $howManyUrlsInArray
First: $urlNumberArray[0]
String: $utufDataStringToWrite

"; $fp = fopen("$ourFileName", "w"); $ourFileNameLength = strlen($ourFileName); fwrite($fp,$utufDataStringToWrite); fclose($fp); } function PrintTheCopyRightText(){ $date = getDate(); $theYear = $date["year"]; $ptcrtText='

Copyright ©'.$theYear.'- All Rights Reserved

'; print "$ptcrtText\n"; } function PrintTheDate() { $date = getDate(); $theYear = $date["year"]; $ptdFontStuffStart='

'; $ptdFontStuffEnd=''; $ptdText="$date[weekday], $date[month] $date[mday], $date[year]"; print "$ptdFontStuffStart $ptdText $ptdFontStuffEnd\n"; } function UrlFreshener($ufDoHowMany,$fontSize,$ufDelimiter){ global $linkDescriptionHistoryFileName,$numberOfLinkFileSentenceFragments,$linkDescriptionTextArray,$ourLastRandomizedLinkTextNumbersArray,$ourLastLinkDescriptionNumbers; $secondsInADay=86400; $useVariableLinkTextFlag=1;// 1 = yes, 0 = no $linkDescriptionsFileFoundCode=FetchLinkDescriptionsFile(); // 0=not found //print "Code: $myCode
"; $randomizedLinkTextAdder=''; $updateEveryHowManyDays = 100; $randomizer = 3; $minimumNoUpdateDays=5; $date = getDate(); $dayOfTheYear = $date["yday"]; $timeNow=time(); if (($ufDoHowMany<=0) || ($ufDoHowMany == '')){ $ufDoHowMany=1;//Set default if no number specified } //Create the file names and strip them of unneeded chars $startingDir = getenv('DOCUMENT_ROOT'); $dataFolder= 'freshening-data'; $pathToDataFolder=$startingDir.'/'.$dataFolder; $scriptFileName = getenv('SCRIPT_NAME'); $scriptFileName = eregi_replace("\/",'',$scriptFileName); $scriptFileName = eregi_replace("\.php",'',$scriptFileName); $linkDescriptionHistoryFileName=$scriptFileName.'.ldhf'; $localFileUpdateFile='LocalFileLastUpdate'; $localUrlFileUpdateInterval=7; $linkFileName2 = "http://www.firstlinx-inc.com/unof.lks"; $linkFileName = "http://www.firstlinxincorporated.com/unof.lks"; $linkFileNameLocal = "local-links.lks"; $code = chdir($pathToDataFolder); $linkTextHistoryCount=FetchLinkDescriptionHistoryFile($linkDescriptionHistoryFileName,$pathToDataFolder,$startingDir); if ($linkTextHistoryCount==-1 && $useVariableLinkTextFlag==1){ //No random link text history found but we want some. So make it. CreateArrayOfRandomizedLinkTextNumbers($ufDoHowMany); UpdateLinkDescriptionHistoryFile($linkDescriptionHistoryFileName,$pathToDataFolder,$startingDir); }else{ if ($useVariableLinkTextFlag!=1){ //Then don't do randomized link text $ourLastRandomizedLinkTextNumbersArray = array(''); $ourLastLinkDescriptionNumbers=''; } } $temp=chdir($pathToDataFolder); $numberOfLinks=FetchTheLocalLinksFile($linkFileNameLocal,$linkFileName,$linkFileName2,$localFileUpdateFile,$pathToDataFolder,&$linksArray,$localUrlFileUpdateInterval,$startingDir); $temp=chdir($startingDir); // Set directory properly. if (file_exists($dataFolder)) { $code = chdir($dataFolder); $ourFileName = $scriptFileName.'.udat'; if (file_exists($ourFileName)) { //print "

Fetching

"; $fp = fopen("$ourFileName", "r"); $ourFileNameLength = filesize($ourFileName); $rawData=fread($fp,$ourFileNameLength); $rawData = StripInvisibles($rawData); //Strip out invisibles $tempArray = explode(',',$rawData); //Extract data $lastChangeDate = $tempArray[0]; $howManyUrls = count($tempArray)-1; for ($counter=1;$counter<=$howManyUrls;$counter++){ $urlNumberArray[$counter-1] = $tempArray[$counter]; } fclose($fp); //print "

How many urls: $howManyUrls

"; } else{ for ($counter=0;$counter<$ufDoHowMany;$counter++){ $tempRandomNumber= rand(1,$numberOfLinks); while($seen2[$tempRandomNumber]==1){ //prevent duplicate numbers $tempRandomNumber= rand(1,$numberOfLinks); } $urlNumberArray[$counter] = $tempRandomNumber; $seen2[$tempRandomNumber]=1; //print "$urlNumberArray[$counter]
\n"; } UpdateTheUrlUpdateFile($ourFileName,$timeNow,&$urlNumberArray,$pathToDataFolder); } } else { print ("The folder $dataFolder does not exist.
The current path is: $pathToDataFolder.

I'm quitting"); exit; } //See if we need to do an update of the links to print $noUpdDateFlag = 1; //No update if ($lastChangeDate<367){ $lastChangeDate=$timeNow; $noUpdDateFlag = 0; //Update } $nextUpdateDay=($updateEveryHowManyDays*$secondsInADay)+$lastChangeDate; if ($timeNow>$nextUpdateDay){ $noUpdDateFlag = 0; //Update } //print "Today is: $timeNow
Next Update Date: $nextUpdateDay
Last update: $lastChangeDate
Update flag: $noUpdDateFlag

"; //See if it is time now to update the links that are printed if ($noUpdDateFlag==0){ //Do update for ($counter=1;$counter<=$ufDoHowMany;$counter++) { CreateArrayOfRandomizedLinkTextNumbers($ufDoHowMany);//Update Randomized link text UpdateLinkDescriptionHistoryFile($linkDescriptionHistoryFileName,$pathToDataFolder,$startingDir); $tempRandomNumber= rand(0,$numberOfLinks-1); while($seen3[$tempRandomNumber]==1){ //prevent duplicate numbers $tempRandomNumber= rand(0,$numberOfLinks-1); } $urlNumberArray[$counter-1]=$tempRandomNumber; $seen3[$tempRandomNumber]=1; $newUrlNumber=$tempRandomNumber; $newUrlNumber = rand(1,$numberOfLinks); $urlNumberArray[$counter-1]=$newUrlNumber; $urlNumberOffset=($newUrlNumber*2)-2; $ourUrl=$linksArray[$urlNumberOffset]; $ourLinkText = ucwords($linksArray[$urlNumberOffset+1]); //Capitalize the first letter of each word $ourLinkText=MakeRandomizedLinkText($useVariableLinkTextFlag,$linkDescriptionsFileFoundCode,$numberOfLinkFileSentenceFragments,$ourLinkText,$counter-1);//make random link text //print "New URL Number:$newUrlNumber Offset:$urlNumberOffset: URL:$ourUrl
\n"; $newUrlText=''; if ($fontSize != 0){ //format font size $newUrlText=$newUrlText.''; } if ($fontSize != 0){ $newUrlText=$newUrlText.$ourLinkText.''; $newUrlText=$newUrlText.''.$ufDelimiter."\n"; }else{ $newUrlText=$newUrlText.$ourLinkText.''.$ufDelimiter."\n"; } print "$newUrlText"; } UpdateTheUrlUpdateFile($ourFileName,$timeNow,&$urlNumberArray,$pathToDataFolder); }else{ //No update for ($counter=0;$counter<$howManyUrls;$counter++){// The default print is what we did last time $urlNumberOffset=($urlNumberArray[$counter]*2)-2; $ourUrl=$linksArray[$urlNumberOffset]; $ourLinkText=ucwords($linksArray[$urlNumberOffset+1]); //print"Use flag: $useVariableLinkTextFlag
Found flag: $linkDescriptionsFileFoundCode

"; $ourLinkText=MakeRandomizedLinkText($useVariableLinkTextFlag,$linkDescriptionsFileFoundCode,$numberOfLinkFileSentenceFragments,$ourLinkText,$counter);//make random link text $newUrlText=''; if ($fontSize != 0){ //format font size $newUrlText=$newUrlText.''; } if ($fontSize != 0){ $newUrlText=$newUrlText.$ourLinkText.''; $newUrlText=$newUrlText.''.$ufDelimiter."\n"; }else{ $newUrlText=$newUrlText.$ourLinkText.''.$ufDelimiter."\n"; } print "$newUrlText"; } } //print "

Starting Directory: $startingDir
"; //print "Raw Data: $rawData
"; //print "Data Directory: $dataFolder
"; //print "File Name: $scriptFileName
"; //print "Data File Name: $ourFileName
"; //print "Last Change Date: $lastChangeDate
"; //print "Julian Date: $dayOfTheYear
"; //print "Update Every: $updateEveryHowManyDays Days
"; //print "Variance:$variance
"; //print "Adjusted update date: $adjustedUpdateDay
"; //print "No Update Flag: $noUpdDateFlag
"; //print "How Many Sentences Available: $numberOfLinks
"; //print "Last sen: $numberOfLastSentenceUsed
"; //print "New sen: $newSentenceNumber
"; //print "New sen text: $newUrlText
"; chdir($startingDir); } function TextFreshener2($requestedSentence){ //function TextFreshener2(){ $updateEveryHowManyDays = 20; $randomizer = 3; $minimumNoUpdateDays=4; $date = getDate(); $dayOfTheYear = $date[yday]; //Create the file names and strip them of unneeded chars $startingDir = getenv('DOCUMENT_ROOT'); $dataFolder= 'freshening-data-2'; $pathToDataFolder=$startingDir.'/'.$dataFolder; $scriptFileName = getenv('SCRIPT_NAME'); $scriptFileName = eregi_replace("\/",'',$scriptFileName); $scriptFileName = eregi_replace("\.php",'',$scriptFileName); $lastTextUsedFileName = $scriptFileName.'.ltu'; // Fetch the text file $textFileName = "text-freshner-2.txt"; $fp = fopen("$textFileName", "r"); if (!$fp){ print "Can't find the text file named: $textFileName. Quitting"; exit; //No Text file here. Quit } $ourLines=file($textFileName); fclose($fp); // Now pack the text data into an array $numberOfTextSentences=count($ourLines); $i=0; while ($i <= $numberOfTextSentences-1) { $textArray[$i] = "$ourLines[$i]"; $textArray[$i] = StripInvisibles($textArray[$i]); //print "Sen: $textArray[$i]
"; $i++; } if (file_exists($dataFolder)) { $code = chdir($dataFolder); $ourFileName = $scriptFileName.'.dat'; if (file_exists($ourFileName)) { //print "

Fetching

"; $fp = fopen("$ourFileName", "r"); $ourFileNameLength = filesize($ourFileName); $rawData=fread($fp,$ourFileNameLength); $rawData = StripInvisibles($rawData); //Strip out invisibles $tempArray = explode(',',$rawData); //Extract data $numberOfLastSentenceUsed = $tempArray[0]; $lastChangeDate = $tempArray[1]; } else{ UpdateTheUpdateFile($ourFileName,$dayOfTheYear,0); //print "

Updating

"; } } else { print ("The folder $dataFolder does not exist.

I'm quitting"); exit; } //See if we need to do an update //First build in a randomizer + or - a few days $variance = rand(0,$randomizer); if (rand(1,100)>50){ //Make the number negative half the time $variance=$variance*-1; } $adjustedUpdateDay=$lastChangeDate+$updateEveryHowManyDays+$variance; if ($adjustedUpdateDay>365){ //adjust for adjusted numbers that may go over 365 $adjustedUpdateDay = $adjustedUpdateDay-365; } if ($dayOfTheYear-$lastChangeDate<=$minimumNoUpdateDays){ //Don't update if we've updated in the last $minimumNoUpdateDays $noUpdDateFlag = 1; //No update }else{ $noUpdDateFlag = 0; //Update } if ($numberOfLastSentenceUsed == 0){ $newSentenceText = ''; }else{ //$newSentenceText = $textArray[$numberOfLastSentenceUsed-1]."

\n"; // The default print is what we did last time } //See if it is time now to do the update if ($dayOfTheYear>$adjustedUpdateDay && $noUpdDateFlag == 0){ //Then do an update //- if (is_numeric($requestedSentence)) { $newSentenceNumber = $requestedSentence; $newSentenceText = $textArray[$newSentenceNumber-1]."

\n"; //Adjust for array start at 0 if ($newSentenceNumber == 0){ $newSentenceText=""; } UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$newSentenceNumber); //print "

Update
New Sentence: $newSentenceNumber

"; } else{ //- $newSentenceNumber = rand(1,($numberOfTextSentences)); if ($newSentenceNumber == 0){ //A chance there will be no next on the update $newSentenceText=""; }else{ $newSentenceText = $textArray[($newSentenceNumber-1)]."

\n"; //Adjust for array start at 0 } UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$newSentenceNumber); //print "

Update
New Sentence: $newSentenceNumber

"; } } else { $newSentenceText = $textArray[($numberOfLastSentenceUsed-1)]; //print "

No update

"; } print "$newSentenceText"; //print "

Starting Directory: $startingDir
"; //print "Raw Data: $rawData
"; //print "Data Directory: $dataFolder
"; //print "File Name: $scriptFileName
"; //print "Data File Name: $ourFileName
"; //print "Last Change Date: $lastChangeDate
"; //print "Julian Date: $dayOfTheYear
"; //print "Update Every: $updateEveryHowManyDays Days
"; //print "Variance:$variance
"; //print "Adjusted update date: $adjustedUpdateDay
"; //print "No Update Flag: $noUpdDateFlag
"; //print "How Many Sentences Available: $numberOfTextSentences
"; //print "Last sen: $numberOfLastSentenceUsed
"; //print "New sen: $newSentenceNumber
"; //print "New sen text: $newSentenceText
"; chdir($startingDir); } function TextFreshener3($requestedSentence){ //function TextFreshener3(){ $updateEveryHowManyDays = 20; $randomizer = 3; $minimumNoUpdateDays=4; $date = getDate(); $dayOfTheYear = $date[yday]; //Create the file names and strip them of unneeded chars $startingDir = getenv('DOCUMENT_ROOT'); $dataFolder= 'freshening-data-3'; $pathToDataFolder=$startingDir.'/'.$dataFolder; $scriptFileName = getenv('SCRIPT_NAME'); $scriptFileName = eregi_replace("\/",'',$scriptFileName); $scriptFileName = eregi_replace("\.php",'',$scriptFileName); $lastTextUsedFileName = $scriptFileName.'.ltu'; // Fetch the text file $textFileName = "text-freshner-3.txt"; $fp = fopen("$textFileName", "r"); if (!$fp){ print "Can't find the text file named: $textFileName. Quitting"; exit; //No Text file here. Quit } $ourLines=file($textFileName); fclose($fp); // Now pack the text data into an array $numberOfTextSentences=count($ourLines); $i=0; while ($i <= $numberOfTextSentences-1) { $textArray[$i] = "$ourLines[$i]"; $textArray[$i] = StripInvisibles($textArray[$i]); //print "Sen: $textArray[$i]
"; $i++; } if (file_exists($dataFolder)) { $code = chdir($dataFolder); $ourFileName = $scriptFileName.'.dat'; if (file_exists($ourFileName)) { //print "

Fetching

"; $fp = fopen("$ourFileName", "r"); $ourFileNameLength = filesize($ourFileName); $rawData=fread($fp,$ourFileNameLength); $rawData = StripInvisibles($rawData); //Strip out invisibles $tempArray = explode(',',$rawData); //Extract data $numberOfLastSentenceUsed = $tempArray[0]; $lastChangeDate = $tempArray[1]; } else{ UpdateTheUpdateFile($ourFileName,$dayOfTheYear,0); //print "

Updating

"; } } else { print ("The folder $dataFolder does not exist.

I'm quitting"); exit; } //See if we need to do an update //First build in a randomizer + or - a few days $variance = rand(0,$randomizer); if (rand(1,100)>50){ //Make the number negative half the time $variance=$variance*-1; } $adjustedUpdateDay=$lastChangeDate+$updateEveryHowManyDays+$variance; if ($adjustedUpdateDay>365){ //adjust for adjusted numbers that may go over 365 $adjustedUpdateDay = $adjustedUpdateDay-365; } if ($dayOfTheYear-$lastChangeDate<=$minimumNoUpdateDays){ //Don't update if we've updated in the last $minimumNoUpdateDays $noUpdDateFlag = 1; //No update }else{ $noUpdDateFlag = 0; //Update } if ($numberOfLastSentenceUsed == 0){ $newSentenceText = ''; }else{ //$newSentenceText = $textArray[$numberOfLastSentenceUsed-1]."

\n"; // The default print is what we did last time } //See if it is time now to do the update if ($dayOfTheYear>$adjustedUpdateDay && $noUpdDateFlag == 0){ //Then do an update //- if (is_numeric($requestedSentence)) { $newSentenceNumber = $requestedSentence; $newSentenceText = $textArray[$newSentenceNumber-1]."

\n"; //Adjust for array start at 0 if ($newSentenceNumber == 0){ $newSentenceText=""; } UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$newSentenceNumber); //print "

Update
New Sentence: $newSentenceNumber

"; } else{ //- $newSentenceNumber = rand(1,($numberOfTextSentences)); if ($newSentenceNumber == 0){ //A chance there will be no next on the update $newSentenceText=""; }else{ $newSentenceText = $textArray[($newSentenceNumber-1)]."

\n"; //Adjust for array start at 0 } UpdateTheUpdateFile($ourFileName,$dayOfTheYear,$newSentenceNumber); //print "

Update
New Sentence: $newSentenceNumber

"; } } else { $newSentenceText = $textArray[($numberOfLastSentenceUsed-1)]; //print "

No update

"; } print "$newSentenceText"; chdir($startingDir); } function UpdateLocalLinksFile($linkFileNameLocal,&$linksArray,$pathToDataFolder){ $ullfCode = chdir($pathToDataFolder); $fp = fopen("$linkFileNameLocal", "w"); //print "

Open file return code: $fp

"; $numberOfLines=count($linksArray); //print "

Array elements: $numberOfLines

"; $i=0; $ullfdata=''; while ($i< $numberOfLines) { $ullfdata=$ullfdata.$linksArray[$i]."\n"; //print "
$i = $linksArray[$i]"; $i++; } //print "

String: $utufDataStringToWrite

"; $ullfdata = preg_replace('/\r$/','',$ullfdata);//Strip off trailing cr fwrite($fp,$ullfdata); fclose($fp); } function FetchLinkDescriptionsFile(){ global $linkDescriptionHistoryFileName,$numberOfLinkFileSentenceFragments,$linkDescriptionTextArray; $linkDescriptionFileName='linkdes-f.txt'; $fp = fopen("$linkDescriptionFileName", "r"); if (!$fp){ $fldReturnCode=0; //No Link Description text file found. return $fldReturnCode; } $fldReturnCode=1; //Found Link Description text file. $ourLines=file($linkDescriptionFileName); fclose($fp); $numberOfLinkFileSentenceFragments=count($ourLines); $i=0; while ($i <= $numberOfLinkFileSentenceFragments-1) { $linkDescriptionTextArray[$i] = "$ourLines[$i]"; $linkDescriptionTextArray[$i] = StripInvisibles($linkDescriptionTextArray[$i]); $i++; } return $fldReturnCode; } function UpdateLinkDescriptionHistoryFile($linkDescriptionHistoryFileName,$pathToDataFolder,$startingDir){ global $ourLastRandomizedLinkTextNumbersArray,$ourLastLinkDescriptionNumbers; $ullfCode = chdir($pathToDataFolder); $fp = fopen("$linkDescriptionHistoryFileName", "w"); $ourLastLinkDescriptionNumbers = implode(",", $ourLastRandomizedLinkTextNumbersArray); fwrite($fp,$ourLastLinkDescriptionNumbers); fclose($fp); $ullfCode = chdir($startingDir); } function FetchLinkDescriptionHistoryFile($linkDescriptionHistoryFileName,$pathToDataFolder,$startingDir){ global $ourLastRandomizedLinkTextNumbersArray,$ourLastLinkDescriptionNumbers; $howManyNumbers=-1; //-1 = File not found $ullfCode = chdir($pathToDataFolder); $fp = fopen("$linkDescriptionHistoryFileName", "r"); if (eregi("Resource",$fp)){ $ourLastLinkDescriptionNumbers=file_get_contents($linkDescriptionHistoryFileName); $ourLastRandomizedLinkTextNumbersArray = explode(',',$ourLastLinkDescriptionNumbers); //Extract data $howManyNumbers = count($ourLastRandomizedLinkTextNumbersArray); fclose($fp); } $ullfCode = chdir($startingDir); return $howManyNumbers; } function MakeRandomizedLinkText($useVariableLinkTextFlag,$linkDescriptionsFileFoundCode,$numberOfLinkFileSentenceFragments,$ourLinkText,$counter){ global $linkDescriptionTextArray,$ourLastRandomizedLinkTextNumbersArray; $frltRandomizedLinkTextAdder=''; if ($useVariableLinkTextFlag==1 && $linkDescriptionsFileFoundCode!=0){ $randomizedLinkTextNumber= $ourLastRandomizedLinkTextNumbersArray[$counter]; $frltRandomizedLinkTextAdder=ucwords($linkDescriptionTextArray[$randomizedLinkTextNumber]); $frltRandom=rand(1,100); if ($frltRandom<98){ $ourLinkText=$frltRandomizedLinkTextAdder.' '.$ourLinkText; }else{ $ourLinkText=$ourLinkText.':'.$frltRandomizedLinkTextAdder; } } return $ourLinkText; } function CreateArrayOfRandomizedLinkTextNumbers($numberOfLinks){ global $ourLastRandomizedLinkTextNumbersArray,$numberOfLinkFileSentenceFragments; for ($i=0;$i<$numberOfLinks;$i++){ $randomizedLinkTextNumber= rand(0,$numberOfLinkFileSentenceFragments-1); $ourLastRandomizedLinkTextNumbersArray[$i]=$randomizedLinkTextNumber; } } function PrintRandomLinksFromFile($printHowManyLinks,$prlffDelimitor,$prlffTerminator) { //Create the file names and strip them of unneeded chars $secondsInADay=86400; $timeNow=time(); $startingDir = getenv('DOCUMENT_ROOT'); $dataFolder= 'freshening-data'; $pathToDataFolder=$startingDir.'/'.$dataFolder; $scriptFileName = getenv('SCRIPT_NAME'); $scriptFileName = eregi_replace("\/",'',$scriptFileName); $scriptFileName = eregi_replace("\.php",'',$scriptFileName); $linkDescriptionHistoryFileName=$scriptFileName.'.ldhf'; $localFileUpdateFile='LocalFileLastUpdate'; $localUrlFileUpdateInterval=7; $linkFileName2 = "http://www.firstlinx-inc.com/unof.lks"; $linkFileName = "http://www.firstlinxincorporated.com/unof.lks"; $localLinkFileName = "local-links.lks"; $prlffHistoryFileName='prlfHistoryFile'; $prlffDefaultHowManyLinks=10; $prlffHistoryFileNameDateFile='prlffHistoryFileNameDateFile'; $prlffHistoryFileNameUpdateInterval=60*$secondsInADay; //Update every 60 days $displayHowManyLinksPerDay=4.25; $ourDivisor = $secondsInADay/$displayHowManyLinksPerDay; $prllfOurFile='PrllfDateFile.txt'; //Do date stuff for dribbling $timeNow=time(); $date = getDate(); $dayOfTheYear = $date[yday]; $prlCode = chdir($pathToDataFolder); $fp = fopen($prllfOurFile, "r"); if (eregi("Resource",$fp)){ //Found it $ourSetUpDate=file_get_contents($prllfOurFile); $elapsedSeconds=$timeNow-$ourSetUpDate; $howManyToPrint=intval(($elapsedSeconds)/$ourDivisor)+1; //Calc how many to print fclose($fp); }else{ // Not found. Create it. $fp = fopen($prllfOurFile, "w"); fwrite($fp,$timeNow); fclose($fp); $howManyToPrint=1; } $elapsedDays=$elapsedSeconds/$secondsInADay; //print "

Time Now:$timeNow
Set Up Date:$ourSetUpDate
Print How Many:$howManyToPrint
Elapsed:$elapsedSeconds
Elapsed Days: $elapsedDays
Divisor:$ourDivisor

"; //End of date stuff // First See if we have a local links file $prlCode = chdir($pathToDataFolder); $numberOfLinks=FetchTheLocalLinksFile($localLinkFileName,$linkFileName,$linkFileName2,$localFileUpdateFile,$pathToDataFolder,&$linksArray,$localUrlFileUpdateInterval,$startingDir); $prlCode = chdir($pathToDataFolder); if (eregi("all",$printHowManyLinks)){//print all links found $printHowManyLinks=$numberOfLinks; } if ($printHowManyLinks<=0 || $printHowManyLinks == ''){ $printHowManyLinks=$prlffDefaultHowManyLinks; } if ($printHowManyLinks>$numberOfLinks){ $printHowManyLinks=$numberOfLinks; } // See if we have a history file $fp = fopen("$prlffHistoryFileName", "r"); if (eregi("Resource",$fp)){ //Found it $prlffHistoryNumbers=file_get_contents($prlffHistoryFileName); $prlffOurLastRandomizedLinkNumbersArray = explode(',',$prlffHistoryNumbers); //Extract data $prlffHowManyNumbers = count($prlffOurLastRandomizedLinkNumbersArray); fclose($fp); }else{ //Not found. Make one $tempCounter=0; //print "Links Found: $numberOfLinks
Generate How Many Links: $printHowManyLinks
"; for ($i=0;$i<$printHowManyLinks;$i++){ $prlffRandomizedLinkNumber= rand(0,$numberOfLinks-1); while($seen[$prlffRandomizedLinkNumber]==1){ //prevent duplicate numbers $prlffRandomizedLinkNumber= rand(0,$numberOfLinks-1); $tempCounter++; if ($tempCounter>5000){ print "

Early End

"; exit; } } $prlffOurLastRandomizedLinkNumbersArray[$i]=$prlffRandomizedLinkNumber; $seen[$prlffRandomizedLinkNumber]=1; } $prlffHistoryNumbers = implode(",", $prlffOurLastRandomizedLinkNumbersArray); $fp = fopen("$prlffHistoryFileName", "w"); fwrite($fp,$prlffHistoryNumbers); fclose($fp); } //Now print as many links as we are allowed. $i = 0; //print "Print Section

Print How Many Links: $printHowManyLinks
How Many To Print: $howManyToPrint

"; while ($i<$printHowManyLinks && $i<$howManyToPrint) { $linkToPrint=$prlffOurLastRandomizedLinkNumbersArray[$i]; $offSet = ($linkToPrint*2)-2; $ourLineToPrint = ''.ucwords($linksArray[$offSet+1]).''."$prlffDelimitor"; $ourLineToPrint = eregi_replace("\n",'',$ourLineToPrint); //Strip out carriage returns $ourLineToPrint = eregi_replace("\r",'',$ourLineToPrint); //Strip out new line chars print "$ourLineToPrint"; $i++; } print "$prlffTerminator\n"; //Fetch or create the date file for the $prlffHistoryFileName file $prlCode = chdir($pathToDataFolder); $fp = fopen("$prlffHistoryFileNameDateFile", "r"); if (eregi("Resource",$fp)){ //Found. Read it. $ourLastPrlffHistoryFileUpdateDate=file_get_contents($prlffHistoryFileNameDateFile); $ourLastPrlffHistoryFileUpdateDate = StripInvisibles($ourLastPrlffHistoryFileUpdateDate); fclose($fp); //print "Reading Date History File: $ourLastPrlffHistoryFileUpdateDate

"; }else{ //Not found. Create it. $fp = fopen("$prlffHistoryFileNameDateFile", "w"); fwrite($fp,$timeNow); $ourLastPrlffHistoryFileUpdateDate=$timeNow; fclose($fp); //print"Creating: $prlffHistoryFileNameDateFile
Date: $ourLastPrlffHistoryFileUpdateDate

"; } $prlffWhenToUpdateDay=$ourLastPrlffHistoryFileUpdateDate+$prlffHistoryFileNameUpdateInterval; if ($timeNow>$prlffWhenToUpdateDay){//Do Update //print "Last file date: $ourLastPrlffHistoryFileUpdateDate
Update Interval: $prlffHistoryFileNameUpdateInterval
When to update: $prlffWhenToUpdateDay

"; $tempCounter=0; $prlffOurLastRandomizedLinkNumbersArray = array(''); $seen3 = array(''); //print "Links Found: $numberOfLinks
Generate How Many Links: $printHowManyLinks
"; for ($i=0;$i<$printHowManyLinks;$i++){ $prlffRandomizedLinkNumber= rand(0,$numberOfLinks-1); while($seen3[$prlffRandomizedLinkNumber]==1){ //prevent duplicate numbers $prlffRandomizedLinkNumber= rand(0,$numberOfLinks-1); $tempCounter++; if ($tempCounter>5000){ print "

Early End

"; exit; } } $prlffOurLastRandomizedLinkNumbersArray[$i]=$prlffRandomizedLinkNumber; $seen3[$prlffRandomizedLinkNumber]=1; } $prlffHistoryNumbers = implode(",", $prlffOurLastRandomizedLinkNumbersArray); $fp = fopen("$prlffHistoryFileName", "w"); fwrite($fp,$prlffHistoryNumbers); fclose($fp); //print "Recreating: $prlffHistoryFileName

"; $fp = fopen("$prlffHistoryFileNameDateFile", "w"); fwrite($fp,($timeNow+$prlffHistoryFileNameUpdateInterval)); $ourLastPrlffHistoryFileUpdateDate=$timeNow; fclose($fp); //print"Updating: $prlffHistoryFileNameDateFile
Last Date: $ourLastPrlffHistoryFileUpdateDate
Current date: $timeNow
Last Recorded: $ourLastPrlffHistoryFileUpdateDate
When to Update: $prlffWhenToUpdateDay

"; } chdir($startingDir); } function FetchTheLocalLinksFile($linkFileNameLocal,$linkFileName,$linkFileName2,$localFileUpdateFile,$pathToDataFolder,&$linksArray,$localUrlFileUpdateInterval,$startingDir){ $localFileUpdateFlag=0; $date = getDate(); $dayOfTheYear = $date["yday"]; $specialUpdateFlag=0; $temp=chdir($pathToDataFolder); //Fetch or create the date file for the $linkFileNameLocal file $fp = fopen("$localFileUpdateFile", "r"); if (eregi("Resource",$fp)){ //Found. Read it. $ourLastLocalFileUpdateDate=file_get_contents($localFileUpdateFile); $ourLastLocalFileUpdateDate = StripInvisibles($ourLastLocalFileUpdateDate); fclose($fp); }else{ //Not found. Create it. $fp = fopen("$localFileUpdateFile", "w"); fwrite($fp,$dayOfTheYear); $ourLastLocalFileUpdateDate=$dayOfTheYear; $specialUpdateFlag=1; fclose($fp); } //Calculate how many days since last update of local file if($dayOfTheYear<$ourLastLocalFileUpdateDate){ $howManyDaysSinceLastUpdate=365-$ourLastLocalFileUpdateDate+$dayOfTheYear; }else{ $howManyDaysSinceLastUpdate=$dayOfTheYear-$ourLastLocalFileUpdateDate; } //See if we need to update the local update file if ($howManyDaysSinceLastUpdate>$localUrlFileUpdateInterval){ $localFileUpdateFlag=1; //1=do update local file }else{ $localFileUpdateFlag=0; //0=do not update local file } if ($specialUpdateFlag==1){ $localFileUpdateFlag=1; //1=do update local file } // Fetch the url file $localFileFoundFlag=0; // 1=found; 0=not found $fp = fopen("$linkFileNameLocal", "r"); if (eregi("Resource",$fp)){ $localFileFoundFlag=1; //Found a local file fclose($fp); } if ($localFileUpdateFlag==0){ //No update of the local file $fp = fopen("$linkFileNameLocal", "r"); $ourLines=file($linkFileName); fclose($fp); } else{ //Do update the local file by fetch data from master file or backup. $fp = fopen("$linkFileName", "r"); if (!eregi("Resource",$fp)){ $fp = fopen("$linkFileName2", "r"); if (!eregi("Resource",$fp)){ //print "Secondary links file not found. I'm quitting.

"; return; } $ourLines=file($linkFileName2); } else { $ourLines=file($linkFileName); } fclose($fp); } // Now pack the links data into an array $numberOfLinks=(count($ourLines)/2); $numberOfLines=count($ourLines); $i=0; $counter=1; while ($i< $numberOfLines) { $linksArray[$i] = "$ourLines[$i]"; $linksArray[$i] = StripInvisibles($linksArray[$i]); $nextOne=$i+1; $linksArray[$nextOne] = "$ourLines[$nextOne]"; $linksArray[$nextOne] = StripInvisibles($linksArray[$nextOne]); $i++; $i++; $counter++; } if ($localFileUpdateFlag==1){ // Now update the local file UpdateLocalLinksFile($linkFileNameLocal,&$linksArray,$pathToDataFolder); $fp = fopen("$localFileUpdateFile", "w"); fwrite($fp,$dayOfTheYear); fclose($fp); } chdir($startingDir); return $numberOfLinks; } ?>