109 lines
No EOL
4.3 KiB
PHP
109 lines
No EOL
4.3 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>furpsocial</title>
|
|
<meta charset="UTF-8">
|
|
<style>
|
|
:root {
|
|
--accent: #32a852;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
|
|
background: var(--accent);
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
#body-input {
|
|
width: 99%;
|
|
height: 150px;
|
|
resize: none;
|
|
}
|
|
|
|
.post {
|
|
width: 100%;
|
|
max-width: 600px;
|
|
margin: auto;
|
|
background: white;
|
|
padding: 10px;
|
|
box-sizing: border-box;
|
|
-moz-box-sizing: border-box;
|
|
-webkit-box-sizing: border-box;
|
|
box-shadow: 0px 0px 10px gray;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.post h1 {
|
|
margin: 0;
|
|
font-size: 20px;
|
|
}
|
|
|
|
.post h2 {
|
|
margin: 0;
|
|
font-size: 14px;
|
|
padding: 10px;
|
|
margin: -10px;
|
|
display: inline-block;
|
|
}
|
|
|
|
.post i {
|
|
float: right;
|
|
color: grey;
|
|
}
|
|
</style>
|
|
|
|
<?php
|
|
// write to file
|
|
if (!is_null($_POST["body"]) && strlen($_POST["body"]) != 0) {
|
|
// read into a string and concatenate new post to the beginning of the string
|
|
$myfile = fopen("posts.txt", "r") or die("Unable to open file!");
|
|
$construct = fread($myfile,filesize("posts.txt"));
|
|
fclose($myfile);
|
|
|
|
$signature = "anonymous";
|
|
if (!is_null($_POST["signature"]) && strlen($_POST["signature"]) != 0) {
|
|
$signature = htmlspecialchars($_POST["signature"]);
|
|
}
|
|
$construct = $signature . " [UTC " . date("m/d/Y H:i") . "] " . htmlspecialchars($_POST["body"]) . "<br>" . $construct;
|
|
|
|
// write back into the file
|
|
$myfile = fopen("posts.txt", "w") or die("Unable to open file!");
|
|
fwrite($myfile, $construct);
|
|
fclose($myfile);
|
|
}
|
|
?>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="post">
|
|
<h1><span style="color: var(--accent);">furp</span>social</h1>
|
|
|
|
<form method="post">
|
|
<textarea id="body-input" name="body"></textarea>
|
|
Signature (optional): <input type="text" name="signature"><br>
|
|
<input type="submit">
|
|
</form>
|
|
|
|
<span style="font-size: 12px; color: grey;">Privacy Policy: The only data collected by furpsocial is the contents of your posts (signature and body text). This information is stored in our secure databases which are wiped of all post data every week. This data is only used to accomodate furp as a social media platform.</span>
|
|
|
|
</div>
|
|
|
|
<div class="post">
|
|
<h2>anon</h2>
|
|
<i>mm/dd/yyyy</i>
|
|
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dignissim sapien ut ornare elementum. Nullam vel accumsan quam. Nam vitae nibh nibh. Sed ultrices vulputate odio in volutpat. Nullam elementum tellus vel purus aliquam egestas. Cras congue diam sit amet sapien faucibus ultricies. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus sit amet arcu vitae nulla tempus blandit ac quis nibh. Mauris vel metus vel lorem venenatis facilisis mattis vel dui. Ut est purus, ultricies blandit justo tempor, porttitor porttitor erat. Praesent non felis ultricies, scelerisque dui nec, egestas lectus. Suspendisse euismod ultricies pharetra. Aenean aliquam mauris sit amet arcu scelerisque, a sollicitudin ipsum laoreet. Praesent a venenatis velit, nec fringilla mi. Nunc dignissim tortor vel odio pulvinar, vitae euismod diam tincidunt. In ullamcorper urna nec ex dapibus luctus.</div>
|
|
</div>
|
|
|
|
<?php
|
|
// read from file
|
|
sleep(3);
|
|
$myfile = fopen("posts.txt", "r") or die("Unable to open file!");
|
|
echo fread($myfile,filesize("posts.txt"));
|
|
fclose($myfile);
|
|
?>
|
|
|
|
</body>
|
|
</html>
|