> 3) % 51))."%, ";
$css .= (50 + (($number >> 5) % 51))."%);";
return $css;
}
if (!is_dir("data")) {
// initialize everything
mkdir("data", 0755);
file_put_contents("data/sentences.txt", "\n");
file_put_contents("data/archive-links.txt", "\n");
file_put_contents("data/config.json", "{\n\n}\n");
print("
Data directory automatically initialized
");
}
if (array_key_exists("submitted", $_REQUEST)) {
$word = urldecode($_REQUEST["submitted"]);
//print("Jemand schreibt ".$word."
");
$botrequest = false;
if (isset($_REQUEST["bot"])) {
$botrequest = true;
$content .= "";
}
$sentences = fopen("./data/sentences.txt", "a") or die("unable to open sentences file");
$content = "";
} else {
$content .= get_color_from_ip($_SERVER['REMOTE_ADDR'])."'>";
}
$ends_of_sentence = ['.', '!', '?'];
$word = rtrim($word);
if (preg_match("/[\p{L}0-9]/", $word[0])) { // check if first character is letter (including ä, ê, ß stuff)
$content .= " ";
}
$content .= htmlentities($word);
if ($botrequest) {
$content .= "";
}
$content .= "";
if (in_array($word[-1], $ends_of_sentence)) {
$content .= "
\n";
}
if (!empty($word)) {
fwrite($sentences, $content);
}
fclose($sentences);
header("location: ".htmlentities($_SERVER['PHP_SELF']));
}
$raw_json_config = file_get_contents("data/config.json");
$config_data = json_decode($raw_json_config, false);
?>
title ?? "One Word Each"); ?>
send_logo)) {
print("");
//}
?>
" type="image/x-icon">
style)) {
print("");
}
?>