File has been reset!

\n"; print"Return to Main Menu\n"; print"\n"; print"\n"; print"


"; exit(); } else { print "
You are about to reset the IP Tracker file.

Are you sure you want to continue? Yes/No\n"; print"


"; print"\n"; print"\n"; exit(); } } if($franchiseid=="") { $franchiseid = "guest"; $franchisename = "guest"; } $data = array(); $datacount = 0; //GET FILE CONTENTS IF IT EXISTS if (file_exists($filedirname)) { $filePointer = fopen($filedirname, "r"); while (!feof($filePointer)) { $data[$datacount]['ip'] = trim(fgets($filePointer,4096)); $data[$datacount]['fid'] = trim(fgets($filePointer,4096)); $data[$datacount]['fname'] = trim(fgets($filePointer,4096)); $data[$datacount]['time'] = trim(fgets($filePointer,4096)); $datacount = $datacount + 1; } fclose($filePointer); } $temp = array_pop($data); //removes the last value of the array $datacount = count($data); //IF PASSWORD IS LEGIT THEN SHOW THE RECENT VISITORS AND EXIT if($password==$menuPassword) { //SHOW THE RECENT VISITORS if($sortItem!="") { // Obtain a list of columns foreach ($data as $key => $row) { $_ip[$key] = $row['ip']; $_fid[$key] = $row['fid']; $_fname[$key] = $row['fname']; $_time[$key] = $row['time']; } // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key if($sortDirection=="Asc") $sortDirection = SORT_ASC; else $sortDirection = SORT_DESC; if($sortItem=="ip") array_multisort($_ip, $sortDirection, $data); if($sortItem=="fid") array_multisort($_fid, $sortDirection, $data); if($sortItem=="fname") array_multisort($_fname, $sortDirection, $data); if($sortItem=="time") array_multisort($_time, $sortDirection, $data); } print"
\n"; print"Reset List | Reload this page
\n"; print"
\n"; print"\n"; print"\n"; for($i=0;$i<$datacount;$i++){ $timeDisplay = gmdate('l F j Y h:i:s A',$data[$i]['time']-$timezoneoffset*60*60); if($i%2) { $rowcolor = "oddtablerow"; } else { $rowcolor = "eventablerow"; } $rowCount = $i + 1; print"\n"; } print"
# IP FID Name Time
".$rowCount.". ".$data[$i]['ip']."".$data[$i]['fid']."".$data[$i]['fname']."".$timeDisplay."
\n"; print"


"; print"\n"; print"\n"; exit(); } //IF WE HAVE REACHED THIS POINT THEN WE WANT TO ADD THE VISITOR TO THE LIST IF ALL CONDITIONS ARE MET //CHECK IF THIS USER HAS LOGGED ON WITHIN THE LAST "IDLETIME" SECONDSS FROM THE SAME IP. IF SO THEN NO NEED TO UPDATE FILE. $updateThisVisitor = true; for($i=0;$i<$datacount;$i++) { $timedifference = $servertime - $data[$i]['time']; if($data[$i]['ip']==$currentIP&&$data[$i]['fid']==$franchiseid&&$timedifference<$idleTime) $updateThisVisitor = false; } if( ($servertime==""||$servertime==0) || !$updateThisVisitor || ($franchiseid=="guest"&&$guestTracking==0) ) $goodToGo = false; else $goodToGo = true; if($goodToGo) { // UPDATE FILE mflCheck(); // CALL mflCheck FUNCTION TO CHECK TO SEE IF MFL IS THE REFERER if($mflCheck==1) { $filePointer = fopen($filedirname, "w"); print"writing new ".$currentIP." ".$franchiseid." ".$franchisename." ".$servertime."
"; fwrite($filePointer, "$currentIP\n"); fwrite($filePointer, "$franchiseid\n"); fwrite($filePointer, "$franchisename\n"); fwrite($filePointer, "$servertime\n"); if($datacount > $usercount-1 ) $datacount = $usercount-1; for($i=0;$i<$datacount;$i++) { if($replaceOld == 1) { // NEED TO CHECK IF NEW ENTRY IS THE SAME AS AN OLD ENTRY if( $data[$i]['ip']==$currentIP && $data[$i]['fid']==$franchiseid && $data[$i]['fname']==$franchisename ) { // Do not write anything since duplicate entry } else { fwrite($filePointer, $data[$i]['ip']."\n"); fwrite($filePointer, $data[$i]['fid']."\n"); fwrite($filePointer, $data[$i]['fname']."\n"); fwrite($filePointer, $data[$i]['time']."\n"); } } else { fwrite($filePointer, $data[$i]['ip']."\n"); fwrite($filePointer, $data[$i]['fid']."\n"); fwrite($filePointer, $data[$i]['fname']."\n"); fwrite($filePointer, $data[$i]['time']."\n"); } } fclose($filePointer); print"
IP Tracker file has been updated.\n"; } else { print"
Referer is not from MFL so the IP Tracker file was not updated.\n"; } print"


"; print"\n"; print"\n"; } else { // ASK FOR PASSWORD print"
\n"; print"
\n"; if($password!=""&&$password!=$menuPassword) print"Password is incorrect. Try again.

"; print"Enter Password: \n"; print"\n"; print"
\n"; print"


"; print"\n"; print"\n"; } ?>