From f2731d911919ca0371c39caaa19e02c750ba3754 Mon Sep 17 00:00:00 2001 From: get52 Date: Mon, 27 Jul 2020 17:58:31 -0400 Subject: [PATCH] Add files via upload --- createListing.php | 57 +++++++++++++++++++++++++++++++++++++++++ index.php | 64 +++++++++++++++++++++++++++++++++++++++++++++++ post.php | 34 +++++++++++++++++++++++++ template.html | 11 ++++++++ 4 files changed, 166 insertions(+) create mode 100644 createListing.php create mode 100644 index.php create mode 100644 post.php create mode 100644 template.html diff --git a/createListing.php b/createListing.php new file mode 100644 index 0000000..913b649 --- /dev/null +++ b/createListing.php @@ -0,0 +1,57 @@ +"; + $post_allowed = false; +} +if($_POST["post"] == ""){ + echo "You forgot to enter a post
"; + $post_allowed = false; +} +if($_POST["contact"] == ""){ + echo "You forgot to enter contact info (website, phone number, email etc)
"; + $post_allowed = false; +} +if($_POST["category"] == ""){ + echo "You forgot to enter a category"; + $post_allowed = false; +} + +function prettyCategory($category){ + if($category == "is"){ + return "Internet Services"; + } + if($category == "msm"){ + return "Man Seeking Man"; + } + if($category == "msw"){ + return "Man Seeking woman"; + } + if($category == "pr"){ + return "Platonic Relationship"; + } + if($category == "wsw"){ + return "Woman Seeking Woman"; + } +} + +function createListing($title, $post, $contact, $category){ + $listingID = uniqid(); + $listingDIR = $category . "/" . $listingID; + $postHTML = file_get_contents("template.html"); + mkdir($listingDIR); + file_put_contents($listingDIR . "/title.txt", $title); + + $postHTML = str_replace("_TITLE_", htmlspecialchars($title), $postHTML); + $postHTML = str_replace("_POST_", htmlspecialchars($post), $postHTML); + $postHTML = str_replace("_CONTACT_", htmlspecialchars($contact), $postHTML); + $postHTML = str_replace("_CATEGORY_", prettyCategory($category), $postHTML); + + file_put_contents($listingDIR . "/index.html", $postHTML); + Header('Location: http://personals.getgle.org'); +} + +if($post_allowed == true){ + createListing($_POST["title"], $_POST["post"], $_POST["contact"], $_POST["category"]); +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..b1dae4c --- /dev/null +++ b/index.php @@ -0,0 +1,64 @@ + + + + + +Getgle Personals make a listing +
+Internet Services
+" . htmlspecialchars(file_get_contents("is/" . $list[$i] . "/title.txt")) . "
"; +} +?> +Platonic Relationship
+" . htmlspecialchars(file_get_contents("pr/" . $list[$i] . "/title.txt")) . "
"; +} +?> +Man Seeking Man
+" . htmlspecialchars(file_get_contents("msm/" . $list[$i] . "/title.txt")) . "
"; +} +?> +Man Seeking Woman
+" . htmlspecialchars(file_get_contents("msw/" . $list[$i] . "/title.txt")) . "
"; +} +?> +Woman Seeking Woman +" . htmlspecialchars(file_get_contents("wsw/" . $list[$i] . "/title.txt")) . "
"; +} +?> +
+ +Getgle Personals is intended for 18+ users, user discretion is advised. Getgle does not endorse and is not responsible for any user postings made on this page.
+report law-breaking posts to admin@getgle.org +
+ \ No newline at end of file diff --git a/post.php b/post.php new file mode 100644 index 0000000..0d98fd1 --- /dev/null +++ b/post.php @@ -0,0 +1,34 @@ +Getgle Personals make a listing +
+ + +
+
+ + + + + + + +
Title:
Post:
+Email/Phone/Website:
+Category:
+ + +

+ +
+
+
+ +Getgle Personals is intended for 18+ users, user discretion is advised. Getgle does not endorse and is not responsible for any user postings made on this page.
+report law-breaking posts to admin@getgle.org
+
\ No newline at end of file diff --git a/template.html b/template.html new file mode 100644 index 0000000..f9b14a6 --- /dev/null +++ b/template.html @@ -0,0 +1,11 @@ +Getgle Personals make a listing +
+

_TITLE_

+

_POST_

+

contact: _CONTACT_

+

_CATEGORY_

+
+ +Getgle Personals is intended for 18+ users, user discretion is advised. Getgle does not endorse and is not responsible for any user postings made on this page.
+report law-breaking posts to admin@getgle.org
+
\ No newline at end of file