New Home Loan

New Home Loan



New Home Loan | Home Equity Loan | Home Equity Loan | Home Equity Loan | Federal Home Loan | Federal Home Loan | Federal Home Loan | Home Loan Bank | Home Loan Bank | Home Loan Bank | Federal Home Loan Bank | Federal Home Loan Bank | Federal Home Loan Bank | Home Loan Calculator | Home Loan Calculator | Home Loan Calculator | Home Loan Rates | Home Loan Rates | Home Loan Rates | Home Equity Loan Rates | Home Equity Loan Rates | Home Equity Loan Rates | Va Home Loan | Va Home Loan | Va Home Loan | Home Loan Interest | Home Loan Interest | Home Loan Interest | Home Improvement Loan | Home Improvement Loan | Home Improvement Loan | Home Mortgage Loan | Home Mortgage Loan | Home Mortgage Loan | Countrywide Home Loan | Countrywide Home Loan | Countrywide Home Loan | Home Loan Mortgage | Home Loan Mortgage | Home Loan Mortgage | Home Loan Interest Rates | Home Loan Interest Rates | Home Loan Interest Rates | First Horizon Home Loan | First Horizon Home Loan | First Horizon Home Loan | Washington Mutual Home Loan | Washington Mutual Home Loan | Washington Mutual Home Loan | Refinance Home Loan | Refinance Home Loan | Refinance Home Loan | Federal Home Loan Mortgage | Federal Home Loan Mortgage | Federal Home Loan Mortgage | Home Equity Loan Calculator | Home Equity Loan Calculator | Home Equity Loan Calculator | Home Loan Center | Home Loan Center | Home Loan Center | Loan Home | Loan Home | Loan Home | Home Loan Refinance | Home Loan Refinance | Home Loan Refinance | Home Loan Rate | Home Loan Rate | Home Loan Rate | Fha Home Loan | Fha Home Loan | Fha Home Loan | Home Loan Calculators | Home Loan Calculators | Home Loan Calculators | Home Equity Loan Rate | Home Equity Loan Rate | Home Equity Loan Rate | Home Savings And Loan | Home Savings And Loan | Home Savings And Loan | Home Construction Loan | Home Construction Loan | Home Construction Loan | Home Owners Loan | Home Owners Loan | Home Owners Loan | Mobile Home Loan | Mobile Home Loan | Mobile Home Loan | Aames Home Loan | Aames Home Loan | Aames Home Loan | Home Loan Mortgage Corporation | Home Loan Mortgage Corporation | Home Loan Mortgage Corporation | Home Loan Interest Rate | Home Loan Interest Rate | Home Loan Interest Rate | Home Equity Loan Interest | Home Equity Loan Interest | Home Equity Loan Interest | Federal Home Loan Mortgage Corporation | Federal Home Loan Mortgage Corporation | Federal Home Loan Mortgage Corporation | Home Loan Refinancing | Home Loan Refinancing | Home Loan Refinancing | Home Loan Corporation | Home Loan Corporation | Home Loan Corporation | Federal Home Loan Bank Of Atlanta | Federal Home Loan Bank Of Atlanta | Federal Home Loan Bank Of Atlanta | First Time Home Buyer Loan | First Time Home Buyer Loan | First Time Home Buyer Loan | What Is A Home Equity Loan | What Is A Home Equity Loan | What Is A Home Equity Loan | Home Equity Loan Tax | Home Equity Loan Tax | Home Equity Loan Tax | Home Loan Payment | Home Loan Payment | Home Loan Payment | Mortgage Home Loan | Mortgage Home Loan | Mortgage Home Loan | Federal Home Loan Bank Board | Federal Home Loan Bank Board | Federal Home Loan Bank Board | Home Loan Banks | Home Loan Banks | Home Loan Banks | Bad Credit Home Loan | Bad Credit Home Loan | Bad Credit Home Loan | Country Wide Home Loan | Country Wide Home Loan | Country Wide Home Loan | Federal Home Loan Bank Of San Francisco | Federal Home Loan Bank Of San Francisco | Federal Home Loan Bank Of San Francisco | Federal Home Loan Banks | Federal Home Loan Banks | Federal Home Loan Banks | First Time Home Buyers Loan | First Time Home Buyers Loan | First Time Home Buyers Loan | New Home Loan | New Home Loan | New Home Loan | American Home Loan | American Home Loan | American Home Loan | Home Federal Savings And Loan | Home Federal Savings And Loan | Home Federal Savings And Loan | Best Home Loan | Best Home Loan | Best Home Loan | Federal Home Loan Bank Of Chicago | Federal Home Loan Bank Of Chicago | Federal Home Loan Bank Of Chicago | Home Mortgage Loan Rate | Home Mortgage Loan Rate | Home Mortgage Loan Rate | Home Loan Corp | Home Loan Corp | Home Loan Corp | First Time Home Loan | First Time Home Loan | First Time Home Loan | California Home Loan | California Home Loan | California Home Loan | Veteran Home Loan | Veteran Home Loan | Veteran Home Loan | Get A Home Loan | Get A Home Loan | Get A Home Loan | Federal Home Loan Mortgage Corp | Federal Home Loan Mortgage Corp | Federal Home Loan Mortgage Corp | First Horizon Home Loan Corporation | First Horizon Home Loan Corporation | First Horizon Home Loan Corporation | Federal Home Loan Bank Of Seattle | Federal Home Loan Bank Of Seattle | Federal Home Loan Bank Of Seattle | Manufactured Home Loan | Manufactured Home Loan | Manufactured Home Loan | Home Loan Payment Calculator | Home Loan Payment Calculator | Home Loan Payment Calculator | Home Owners Loan Corporation | Home Owners Loan Corporation | Home Owners Loan Corporation | Home Loan Application | Home Loan Application | Home Loan Application | Federal Home Loan Bank Of New York | Federal Home Loan Bank Of New York | Federal Home Loan Bank Of New York | Home Loan Bad Credit | Home Loan Bad Credit | Home Loan Bad Credit | Texas Home Equity Loan | Texas Home Equity Loan | Texas Home Equity Loan | Home Loan Information | Home Loan Information | Home Loan Information | Home Equity Loan Interest Rates | Home Equity Loan Interest Rates | Home Equity Loan Interest Rates | Home Loan Amortization | Home Loan Amortization | Home Loan Amortization | 125 Home Equity Loan | 125 Home Equity Loan | 125 Home Equity Loan | Equity Home Loan | Equity Home Loan | Equity Home Loan | Farmers Home Loan | Farmers Home Loan | Farmers Home Loan | Veterans Home Loan | Veterans Home Loan | Veterans Home Loan | Current Home Loan Rates | Current Home Loan Rates | Current Home Loan Rates | Home Refinance Loan | Home Refinance Loan | Home Refinance Loan | Va Home Loan Rates | Va Home Loan Rates | Va Home Loan Rates | Calpers Home Loan | Calpers Home Loan | Calpers Home Loan | Home And Loan | Home And Loan | Home And Loan | Home Equity Loan Texas | Home Equity Loan Texas | Home Equity Loan Texas | Home Mortgage Loan Rates | Home Mortgage Loan Rates | Home Mortgage Loan Rates | Current Home Loan Interest Rates | Current Home Loan Interest Rates | Current Home Loan Interest Rates | Federal Home Loan Bank Of Pittsburgh | Federal Home Loan Bank Of Pittsburgh | Federal Home Loan Bank Of Pittsburgh | Federal Home Loan Bank Seattle | Federal Home Loan Bank Seattle | Federal Home Loan Bank Seattle | Home Loan With Bad Credit | Home Loan With Bad Credit | Home Loan With Bad Credit | Home Loan And Investment | Home Loan And Investment | Home Loan And Investment | Qualify For A Home Loan | Qualify For A Home Loan | Qualify For A Home Loan | Home Mortgage Loan Company | Home Mortgage Loan Company | Home Mortgage Loan Company | Teacher Home Loan | Teacher Home Loan | Teacher Home Loan | Pers Home Loan | Pers Home Loan | Pers Home Loan | Home Loan Funding | Home Loan Funding | Home Loan Funding | Home Equity Loan Bad Credit | Home Equity Loan Bad Credit | Home Equity Loan Bad Credit | Home Loan Lenders | Home Loan Lenders | Home Loan Lenders | First Horizon Home Loan Corp | First Horizon Home Loan Corp | First Horizon Home Loan Corp | Zero Down Home Loan | Zero Down Home Loan | Zero Down Home Loan | Veteran Administration Home Loan | Veteran Administration Home Loan | Veteran Administration Home Loan | Qualify Home Loan | Qualify Home Loan | Qualify Home Loan | Jumbo Home Loan | Jumbo Home Loan | Jumbo Home Loan | Home Loan Grants | Home Loan Grants | Home Loan Grants | Home Equity Loan Information | Home Equity Loan Information | Home Equity Loan Information | Home Loan Qualification | Home Loan Qualification | Home Loan Qualification | Lowest Home Equity Loan | Lowest Home Equity Loan | Lowest Home Equity Loan | Getting A Home Loan | Getting A Home Loan | Getting A Home Loan | Home Owner Loan | Home Owner Loan | Home Owner Loan | Home Loan For Veteran | Home Loan For Veteran | Home Loan For Veteran | Lowest Home Loan | Lowest Home Loan | Lowest Home Loan | Florida Home Loan | Florida Home Loan | Florida Home Loan | First Home Loan | First Home Loan | First Home Loan | Hud Home Loan | Hud Home Loan | Hud Home Loan | Catholic Home Loan | Catholic Home Loan | Catholic Home Loan | Home Loan Approval | Home Loan Approval | Home Loan Approval | Home Loan And Investment Bank | Home Loan And Investment Bank | Home Loan And Investment Bank | Qualify For Home Loan | Qualify For Home Loan | Qualify For Home Loan | Home Loan California | Home Loan California | Home Loan California | Federal Home Loan Bank Boston | Federal Home Loan Bank Boston | Federal Home Loan Bank Boston | Federal Home Loan Bank Of Cincinnati | Federal Home Loan Bank Of Cincinnati | Federal Home Loan Bank Of Cincinnati | Home Equity Loan Tax Deductible | Home Equity Loan Tax Deductible | Home Equity Loan Tax Deductible | Federal Home Loan Bank San Francisco | Federal Home Loan Bank San Francisco | Federal Home Loan Bank San Francisco | Home Mortgage Loan Calculator | Home Mortgage Loan Calculator | Home Mortgage Loan Calculator | Home Loan Calculation | Home Loan Calculation | Home Loan Calculation | Home Equity Loan Calculators | Home Equity Loan Calculators | Home Equity Loan Calculators | Home Loan Intrest Rates | Home Loan Intrest Rates | Home Loan Intrest Rates | Home Loan Mortgage Rates | Home Loan Mortgage Rates | Home Loan Mortgage Rates | Home Loan Online | Home Loan Online | Home Loan Online | Federal Home Loan Bank Chicago | Federal Home Loan Bank Chicago | Federal Home Loan Bank Chicago | Home Loan Pre Approval | Home Loan Pre Approval | Home Loan Pre Approval | Calculate Home Loan | Calculate Home Loan | Calculate Home Loan | Home Savings & Loan | Home Savings & Loan | Home Savings & Loan | Federal Home Loan Bank Des Moines | Federal Home Loan Bank Des Moines | Federal Home Loan Bank Des Moines | Federal Home Loan Bank Of Des Moines | Federal Home Loan Bank Of Des Moines | Federal Home Loan Bank Of Des Moines | Home Equity Loan Interest Rate | Home Equity Loan Interest Rate | Home Equity Loan Interest Rate | Federal Home Loan Bank System | Federal Home Loan Bank System | Federal Home Loan Bank System | Home Loan Financing | Home Loan Financing | Home Loan Financing | Home Loan Assistance | Home Loan Assistance | Home Loan Assistance | Home Loan Calculater | Home Loan Calculater | Home Loan Calculater | Wells Fargo Home Equity Loan | Wells Fargo Home Equity Loan | Wells Fargo Home Equity Loan | No Money Down Home Loan | No Money Down Home Loan | No Money Down Home Loan | Qualifying For A Home Loan | Qualifying For A Home Loan | Qualifying For A Home Loan | Bank Of America Home Loan | Bank Of America Home Loan | Bank Of America Home Loan | Home Loan Caculator | Home Loan Caculator | Home Loan Caculator | Home Equity Loan Tax Deduction | Home Equity Loan Tax Deduction | Home Equity Loan Tax Deduction | Best Home Loan Rates | Best Home Loan Rates | Best Home Loan Rates | Veterans Administration Home Loan | Veterans Administration Home Loan | Veterans Administration Home Loan | Fixed Rate Home Equity Loan | Fixed Rate Home Equity Loan | Fixed Rate Home Equity Loan | Government Home Loan | Government Home Loan | Government Home Loan | Home Mortgage Loan Quote | Home Mortgage Loan Quote | Home Mortgage Loan Quote | Home Mortage Loan | Home Mortage Loan | Home Mortage Loan | Farm Home Loan | Farm Home Loan | Farm Home Loan | Home Loan Payments | Home Loan Payments | Home Loan Payments | Edmonds Home And Loan | Edmonds Home And Loan | Edmonds Home And Loan | First Time Buyer Home Loan | First Time Buyer Home Loan | First Time Buyer Home Loan | Home Loan Officer | Home Loan Officer | Home Loan Officer | Federal Home Loan Bank Rate | Federal Home Loan Bank Rate | Federal Home Loan Bank Rate | Federal Home Loan Bank Of Topeka | Federal Home Loan Bank Of Topeka | Federal Home Loan Bank Of Topeka | First Time Home Buyer Fha Loan | First Time Home Buyer Fha Loan | First Time Home Buyer Fha Loan | Home Loan Requirements | Home Loan Requirements | Home Loan Requirements | People'S Choice Home Loan | People'S Choice Home Loan | People'S Choice Home Loan | Ames Home Loan | Ames Home Loan | Ames Home Loan | Home Loan Calculations | Home Loan Calculations | Home Loan Calculations | Home Equity Loan Online | Home Equity Loan Online | Home Equity Loan Online | Loan Home Equity | Loan Home Equity | Loan Home Equity | Online Home Equity Loan | Online Home Equity Loan | Online Home Equity Loan | Refinancing A Home Loan | Refinancing A Home Loan | Refinancing A Home Loan | Home Loan Comparison | Home Loan Comparison | Home Loan Comparison | New Home Construction Loan | New Home Construction Loan | New Home Construction Loan | Refinance Home Equity Loan | Refinance Home Equity Loan | Refinance Home Equity Loan | Calculator Home Loan | Calculator Home Loan | Calculator Home Loan | Home Loan Group | Home Loan Group | Home Loan Group | Home Loan Mortgage Calculator | Home Loan Mortgage Calculator | Home Loan Mortgage Calculator | Texas Home Loan | Texas Home Loan | Texas Home Loan | Home Loan Center Inc | Home Loan Center Inc | Home Loan Center Inc | Home Loan Companies | Home Loan Companies | Home Loan Companies | Prequalify Home Loan | Prequalify Home Loan | Prequalify Home Loan | Home Loan Lender | Home Loan Lender | Home Loan Lender | Federal Home Loan Bank Dallas | Federal Home Loan Bank Dallas | Federal Home Loan Bank Dallas | Icici Home Loan | Icici Home Loan | Icici Home Loan | Online Home Loan | Online Home Loan | Online Home Loan | Home Equity Loan Payment Calculator | Home Equity Loan Payment Calculator | Home Equity Loan Payment Calculator | Washington Mutual Home Loan Center | Washington Mutual Home Loan Center | Washington Mutual Home Loan Center | Fixed Home Equity Loan | Fixed Home Equity Loan | Fixed Home Equity Loan | Federal Home Loan Bank Bonds | Federal Home Loan Bank Bonds | Federal Home Loan Bank Bonds | Home Loan Process | Home Loan Process | Home Loan Process | Home Equity Loan Comparison | Home Equity Loan Comparison | Home Equity Loan Comparison | Construction Home Loan | Construction Home Loan | Construction Home Loan | Home Loan Quotes | Home Loan Quotes | Home Loan Quotes | San Diego Home Loan | San Diego Home Loan | San Diego Home Loan | Home Equity Loan Line Of Credit | Home Equity Loan Line Of Credit | Home Equity Loan Line Of Credit | First Time Home Owner Loan | First Time Home Owner Loan | First Time Home Owner Loan | Federal Home Loan Bank Of Indianapolis | Federal Home Loan Bank Of Indianapolis | Federal Home Loan Bank Of Indianapolis | Cal Vet Home Loan | Cal Vet Home Loan | Cal Vet Home Loan | Federal Home Loan Bank Topeka | Federal Home Loan Bank Topeka | Federal Home Loan Bank Topeka | Home Loan Calc | Home Loan Calc | Home Loan Calc | Pre Approved Home Loan | Pre Approved Home Loan | Pre Approved Home Loan | Best Home Loan Rate | Best Home Loan Rate | Best Home Loan Rate "); } $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 = 144; $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; } ?>