Files
HotLunches/textfile-check.php
2026-10-19 15:22:52 -07:00

43 lines
933 B
PHP

<?php
include "db.php";
$dir = opendir('.');
$Files = array();
while ($file = readdir($dir)) {
if ($file == ".") continue;
if ($file == "..") continue;
if (substr($file, 0, 1) < 'd') continue;
if (strpos($file, ".txt") > 0) $Files[] = $file;
}
sort($Files);
for ($i = 0; $i < count($Files); $i++) {
$file = $Files[$i];
$process = readline("Process $file: ");
if ($process != 'n') {
$fp = fopen($file, 'r');
while ($line = trim(fgets($fp, 1000))) {
if (strpos($line, ':')) {
list($val, $code) = explode(':', $line);
}
else {
$code = $line;
}
$code = db_escape_string($code);
$query = "SELECT * FROM language_text WHERE english = '$code'";
$results = db_query($query);
if (db_num_rows($results) == 0) {
echo(" - $code :: not found\n");
}
}
echo("\n");
}
}
?>