$country[0]";
}
}
fclose($fh);
}
function lastupdate($showdetails = 'yes') {
$updatesArray = file(UPDATES);
foreach($updatesArray as $updateValue) {
list($date,$update) = preg_split("/,(?! )/",$updateValue);
echo str_replace('|', ',', $date);
if ($showdetails == "yes" && (!empty($update) || $update != "")) {
echo "
Update Details: " . stripslashes(str_replace('|', ',', $update));
}
}
}
function blanklinefix($inputfile) {
ignore_user_abort(true);
$content = file($inputfile);
if (count($content) > 0) {
$content = array_diff(array_diff($content, array("")), array("\n"));
$newContent = array();
foreach ($content as $line) {
$newContent[] = trim($line);
}
$newContent = implode("\n", $newContent);
$fl = fopen($inputfile, "w+");
if (flock($fl, LOCK_EX)) {
fwrite($fl, $newContent);
flock($fl, LOCK_UN);
} else {
echo 'The file: '.$inputfile.' could not be locked for writing; the blanklinefix function could not be applied at this time.';
}
fclose($fl);
}
ignore_user_abort(false);
}
function countfile($fileloc) {
$file = file($fileloc);
$count = count($file);
echo $count;
}
function checkTXTfile($file, $input, $inputtype) {
$Array = array();
$fh = @fopen($file, "r") or die ("Couldn't open $file.");
while(!feof($fh)) {
$item = fgetcsv($fh, 4096);
if ($inputtype == "country" || $inputtype == "ip") {
for ($i=0; $i<1; $i++) {
$Array[] = $item[0];
}
} elseif ($inputtype == "email") {
for ($i=0; $i<1; $i++) {
$Array[] = $item[1];
}
}
}
fclose($fh);
if (in_array($input, $Array)) {
return true;
} else {
return false;
}
}
function addmember($member) {
$data = file_get_contents(NEWBIES);
$fp = fopen(NEWBIES, "w") or die ("Couldn't open NEWBIES - you weren't added to the fanlisting.");
if (flock($fp, LOCK_EX)) {
fwrite($fp, $member);
flock($fp, LOCK_UN);
} else {
echo 'The file: newbies.txt could not be locked for writing; you could not be added at this time.';
}
fclose($fp);
$fp2 = fopen(NEWBIES, "a") or die ("Couldn't open NEWBIES.");
if (flock($fp2, LOCK_EX)) {
fwrite($fp2, $data);
flock($fp2, LOCK_UN);
} else {
echo 'The file: newbies.txt could not be locked for writing; other new members could not be re-added to newbies.txt';
}
fclose($fp2);
return true;
}
function breakEmail($email) {
$email = str_replace('.', 'DOTTY', $email);
$email = str_replace('@', 'ATTIE', $email);
$email = str_replace('-', 'DASHY', $email);
$email = str_replace('_', 'SCORE', $email);
return $email;
}
function fixEmail($email) {
$email = str_replace('DOTTY', '.', $email);
$email = str_replace('ATTIE', '@', $email);
$email = str_replace('DASHY', '-', $email);
$email = str_replace('SCORE', '_', $email);
return $email;
}
function getButtons($width, $height) {
echo "
\n"; $array = file(BUTTONS); foreach ($array as $value) { if (preg_match("/$width,$height/i", $value)) { list($file,$width2,$height2,$donated,$donator,$donatorUrl) = preg_split("/,(?! )/",$value); $donatorUrl = trim($donatorUrl); if ($donated == "yes") { if ($donatorUrl != "") { echo " \n"; } else { echo " \n"; } } else { echo " \n"; } } } echo "
\n"; } function getButtonSizes() { $array = file(BUTTONS); $buttons_found = array(); foreach ($array as $value) { list($file,$width,$height,$donated,$donator,$donatorUrl) = preg_split("/,(?! )/",$value); $buttons_found[] = $width . "x" . $height; } $buttons_found = array_unique($buttons_found); natcasesort($buttons_found); echo ""; } function get_data($var) { if (isset($_POST[$var])) echo htmlspecialchars($_POST[$var]); } blanklinefix(COUNTRIES); blanklinefix(IPBLOCKLST); blanklinefix(MEMBERS); blanklinefix(NEWBIES); blanklinefix(SPAMWDS); blanklinefix(BUTTONS); blanklinefix(AFFILIATES); blanklinefix(UPDATES); error_reporting(E_ALL); ?>