From c01bcea28cca4908308a94b0e3c9aaed616e7ace Mon Sep 17 00:00:00 2001
From: Blista Kanjo
Date: Sun, 9 Jul 2023 03:54:14 -0400
Subject: refactor: cleaner PHP code, avoding redudancy
---
download.php | 378 ++++++-----------------------------------------------------
1 file changed, 33 insertions(+), 345 deletions(-)
(limited to 'download.php')
diff --git a/download.php b/download.php
index af207d5..666bfb6 100644
--- a/download.php
+++ b/download.php
@@ -33,98 +33,10 @@
- output/'$push'");
- shell_exec(
- "cat output/90sMakeUpCommercial.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/chicagoOlives.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/cleanMetropolis.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/ohioCustard.md output/'$push' > output/'$convert'"
- );
+ shell_exec("cat $templateFile output/'$push' > output/'$convert'");
shell_exec($conversion);
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/raleighAroundMe.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
+ echo "
";
+ }
+
+ if (isset($_POST["90sMakeUpCommercial"])) {
+ generatePresentation("output/90sMakeUpCommercial.md");
+ } elseif (isset($_POST["chicagoOlives"])) {
+ generatePresentation("output/chicagoOlives.md");
+ } elseif (isset($_POST["cleanMetropolis"])) {
+ generatePresentation("output/cleanMetropolis.md");
+ } elseif (isset($_POST["ohioCustard"])) {
+ generatePresentation("output/ohioCustard.md");
+ } elseif (isset($_POST["raleighAroundMe"])) {
+ generatePresentation("output/raleighAroundMe.md");
+ } elseif (isset($_POST["earlyCupertino"])) {
+ generatePresentation("output/earlyCupertino.md");
+ } elseif (isset($_POST["defaultIsKing"])) {
+ generatePresentation("output/defaultIsKing.md");
+ } elseif (isset($_POST["strengthInNumbers"])) {
+ generatePresentation("output/strengthInNumbers.md");
+ } elseif (isset($_POST["thatMagazine"])) {
+ generatePresentation("output/thatMagazine.md");
+ } elseif (isset($_POST["cuppertinoIsh"])) {
+ generatePresentation("output/cuppertinoIsh.md");
+ } elseif (isset($_POST["lazyProfessor"])) {
+ generatePresentation("output/lazyProfessor.md");
+ } elseif (isset($_POST["redmond2003"])) {
+ generatePresentation("output/redmond2003.md");
+ }
- // sleep(1);
?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/earlyCupertino.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/defaultIsKing.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/strengthInNumbers.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/thatMagazine.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/cuppertinoIsh.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/lazyProfessor.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-
-
- output/'$push'");
- shell_exec(
- "cat output/redmond2003.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
-
-
-