diff --git a/beam.php b/beam.php
index 828fb9a..095a8ab 100755
--- a/beam.php
+++ b/beam.php
@@ -1,82 +1,133 @@
-";
+echo("\n\n");
-if (empty($_POST["desired_filename"]))
+function celebrate($dest_file)
+{
+
+?>
+ Thank you for feeding me
+ Your coin is in safe hands
+ It will not be de-atomized for at least a year
+
+ COIN INSERTED <3
+
+
+
+ Your coin's over here
+
+ https://coinsh.red/
+ It's meta-stuff (or lack thereof) is
+ here
+
+ COIN ON FIRE
+
+ ...
+ That was weird, something went wrong.
+ Give it another go-- if it happens again, tell me.
+
Also tell this: "File: ,
+ Method: ."
+
+We're getting some interference
";
- echo "Please use a different coin-name
";
+ echo("\tWe're getting some interference
\n");
+ echo("\tPlease use a different coin-name
\n\n");
$beaming_permitted = 0;
}
-elseif ($_FILES["fileToUpload"]["size"] > 50000000)
-{
- echo "This coin will be up for at least three months
";
- echo "7 moons in the ordinary sabbatical cycle
";
- echo "After that, it *may* be de-atomized
";
-}
-elseif ($_FILES["fileToUpload"]["size"] < 25000000)
-{
- echo "Thank you for feeding me
";
- echo "Your coin is in safe hands
";
- echo "It will not be de-atomized for at least a year
";
-}
-
-if ($beaming_permitted == 0) {
- echo "COIN ON FIRE";
- echo "";
- echo "sorry <\\3
";
+if ($beaming_permitted == 0)
+{
+ echo("\tCOIN ON FIRE\n\n");
+ echo("\t\n");
+ echo("\tsorry <\\3
\n");
}
-else {
- if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$dest_file)) {
- echo "COIN INSERTED <3";
- echo "";
- echo "It is here
";
+else
+{
+ if ($upload_method == 1)
+ {
+ if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$dest_file))
+ {
+ write_metadata($dest_file, $_POST["file_desc"], $_POST["file_source"]);
+ celebrate($dest_file);
+ }
+ else
+ {
+ celebrate_death($dest_file, $upload_method);
+ }
+ }
+ else if ($upload_method == 2)
+ {
+ $download = file_get_contents($upload_url);
+ if (file_put_contents($dest_file, $download))
+ {
+ write_metadata($dest_file, $_POST["file_desc"], $upload_url . "\n\t" . $_POST["file_source"]);
+ celebrate($dest_file);
+ }
+ else
+ {
+ celebrate_death($dest_file, $upload_method);
+ }
+ }
+ else if ($upload_method == 0)
+ {
+ echo("\t(upload something next time, my dumb, sweet honey-pie <3)
");
+ celebrate_death("n/a", "smartassery");
}
else
{
- echo "
COIN ON FIRE";
- echo "";
- echo "...
";
- echo "That was weird, something went wrong. Try again.
";
+ celebrate_death($dest_file, $upload_method);
}
}
+
+
?>
diff --git a/footer.html b/footer.html
index e385796..41789b7 100644
--- a/footer.html
+++ b/footer.html
@@ -1,4 +1,4 @@
-
+
@@ -6,7 +6,7 @@
source juice
-
+