aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--download.php378
-rw-r--r--info.php4
2 files changed, 35 insertions, 347 deletions
diff --git a/download.php b/download.php
index af207d5..666bfb6 100644
--- a/download.php
+++ b/download.php
@@ -33,98 +33,10 @@
<h3 class="centered">📂 your download link is below: 🗃
</h3>
<div class="centered">
- <?php if (isset($_POST["90sMakeUpCommercial"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/90sMakeUpCommercial.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["chicagoOlives"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/chicagoOlives.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["cleanMetropolis"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/cleanMetropolis.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
<?php
- } ?>
-
- <?php if (isset($_POST["ohioCustard"])) {
+ function generatePresentation($templateFile)
+ {
$_SESSION["pres"] = uniqid("pres", true) . ".md";
$_SESSION["push"] = uniqid("push", true) . ".md";
$_SESSION["convert"] = uniqid("convert", true) . ".md";
@@ -132,270 +44,46 @@
$pres = $_SESSION["pres"]; // filename of the template file with metadata
$push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
+ $convert = $_SESSION["convert"]; // concatenated file to be converted to .pdf
$filename = $_SESSION["filename"]; // output file name
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
+ $userMarkdown = $_SESSION["user-input"];
$conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
shell_exec("echo '$userMarkdown' > 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);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["raleighAroundMe"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/raleighAroundMe.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
+ echo "<h2><a href=\"output/$filename\">download presentation</a></h2>";
+ }
+
+ 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);
?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["earlyCupertino"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/earlyCupertino.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
-
- <?php if (isset($_POST["defaultIsKing"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/defaultIsKing.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["strengthInNumbers"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/strengthInNumbers.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["thatMagazine"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/thatMagazine.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["cuppertinoIsh"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] =
- uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/cuppertinoIsh.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["lazyProfessor"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] =
- uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/lazyProfessor.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
-
- <?php if (isset($_POST["redmond2003"])) {
-
- $_SESSION["pres"] = uniqid("pres", true) . ".md";
- $_SESSION["push"] = uniqid("push", true) . ".md";
- $_SESSION["convert"] = uniqid("convert", true) . ".md";
- $_SESSION["filename"] =
- uniqid("procrastiSlides_", true) . ".pdf";
-
- $pres = $_SESSION["pres"]; // filename of the template file with metadata
- $push = $_SESSION["push"]; // filename of where the user data is stored
- $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf
- $filename = $_SESSION["filename"]; // output file name
-
- $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input']
- // $_SESSION['user-input'] = $_POST['user-input'];
- $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex";
-
- shell_exec("echo '$userMarkdown' > output/'$push'");
- shell_exec(
- "cat output/redmond2003.md output/'$push' > output/'$convert'"
- );
- shell_exec($conversion);
-
- // sleep(1);
- ?>
-
- <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2>
-
- <?php
- } ?>
</div>
<br><br>
<footer>
diff --git a/info.php b/info.php
index f03513d..5604a5c 100644
--- a/info.php
+++ b/info.php
@@ -36,7 +36,7 @@
<h3>planned features</h3>
<ul>
<li>unicode color emoji support (via <a target="_blank" href="https://fonts.google.com/noto/specimen/Noto+Sans">noto sans</a> )</li>
- <li><s>different font options </s>&nbsp;decided that fonts will be a non-option and just have them embedded in final .pdf</li>
+ <li><s>different font options </s>&nbsp;font selection will be a non-option</li>
<li><s>more presentation style templates</s>&nbsp;new 16:9 themes have been added</li>
</ul>
@@ -51,7 +51,7 @@
<h3>active developers</h3>
<ul>
- <li>blistakanjo604 (<a href="https://github.com/blistakanjo604">github</a>) </li>
+ <li>kj_sh604 (<a href="https://github.com/kj-sh604">github</a>) </li>
</ul>
<h3>related links</h3>