From 1ab9730db9167d8fe31ccbd83a10a6e316320ed7 Mon Sep 17 00:00:00 2001 From: Jenga Phoenix Date: Thu, 14 Feb 2019 19:20:06 -0600 Subject: [PATCH] Smooth out remnants of public_html --- private/beam.php | 2 +- private/create.php | 2 +- public_html/private/.create.php.swp | Bin 12288 -> 0 bytes res/config.example.php | 20 ++++++++++++-------- res/library/insert-coin.php | 2 +- res/library/main.php | 7 +++++++ res/library/test.php | 6 ++++++ res/library/urls.php | 3 +-- res/templates/coin/beam.php | 3 ++- res/templates/footer.php | 2 +- res/templates/header.php | 4 ++-- res/templates/mask/create.php | 3 ++- res/templates/menu.php | 14 +++++++++----- 13 files changed, 45 insertions(+), 23 deletions(-) delete mode 100644 public_html/private/.create.php.swp create mode 100644 res/library/test.php diff --git a/private/beam.php b/private/beam.php index ca0e6ec..60e14bf 100644 --- a/private/beam.php +++ b/private/beam.php @@ -13,7 +13,7 @@ if (!empty($_POST["desired_filename"])) { $file_name = sanitize_filename($file_name); $dest_name = $GLOBALS["file_beam_dir"] . $file_name; -$dest_file = root("public_html/" . $dest_name); +$dest_file = root("/" . $dest_name); diff --git a/private/create.php b/private/create.php index bbbb0a9..cd5ec06 100644 --- a/private/create.php +++ b/private/create.php @@ -11,7 +11,7 @@ $visible_name = $url_alias . $GLOBALS["url_aliasize_visible_suffix"]; $visible_dest = $GLOBALS["url_aliasize_dir"] . $visible_name; $dest_name = $GLOBALS["url_aliasize_dir"] . $url_alias . $GLOBALS["url_aliasize_suffix"]; -$dest_file = root("public_html/" . $dest_name); +$dest_file = root("/" . $dest_name); switch (true) { diff --git a/public_html/private/.create.php.swp b/public_html/private/.create.php.swp deleted file mode 100644 index 0e6ec46c3a38ae94c3a1533af1f40894a38ee227..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2Pj1sd6o)6Qh@gPr0txmg*V*-d&FhXiOhq+$BIl=xe6-HxFrU)?Dhh>z6e9E+_=$@zHnuf2&KpT zSVnF;t%uV0nz|LbZ6(*Z7Ot-ZPL+1EJt#IkBLie$fPqvu#-@kZ)Z|3=s*l*i)`j!; z26UiDWPl8i0Wv@a$N(8217v^<{BH(yyTGfDDj=|f+X>b`_0;Ax|5M%GaTksqR@DR*`li&w(eg_}G3$O#WKo@8*53YhaPz9#O5kLnS zAOmE843GgbKnBPF86X3H&p_?)V~(+>tXQmLf9~omz9BHj{N(_=-gC8_U=B&pi0=<`Ha&bpFXcs!Im zaY}(mwAYZKxM-D7mZ!N|5xQLdHUDwSuL-4MRh{Y$qnB!U4QYaGya%HHrkj57$$W5A zwI?=YqVwZ0rTC8x&DhNRnejL!@Al%--Q39S zWxNSF_a<|$O>d1FDU8X;57R(6cBSItgO@5!71p~O%DUpJer%m#TIA&+eA$5BJB M>^5UpYUp6GpI!)tu>b%7 diff --git a/res/config.example.php b/res/config.example.php index 60bb07c..6802976 100644 --- a/res/config.example.php +++ b/res/config.example.php @@ -4,18 +4,22 @@ // This file contains some global configuration you might wanna do // -$site_name = "insert-coin"; // what the site will be called -$root_name = "insert-coin"; // the directory containing this instance +$site_name = "insert-coin"; // what the site will be called + +$root = "/srv/www/htdocs/insert-coin"; // the absolute path of this instance +$webroot = "/insert-coin/" // path of instance relative to + // web-root (I.E., how it looks in + // the URL without the hostname) // vars related to URL shortening -$url_aliasize_img = "/res/img/mask-big.png"; +$url_aliasize_img = "res/img/mask-big.png"; $url_aliasize_alt = "A mask, floating in mid-air."; -$url_aliasize_win_img = "/res/img/mask_win-big.png"; +$url_aliasize_win_img = "res/img/mask_win-big.png"; $url_aliasize_win_alt = "A whimsical mask sparkling."; -$url_aliasize_die_img = "/res/img/mask_die-big.png"; +$url_aliasize_die_img = "res/img/mask_die-big.png"; $url_aliasize_die_alt = "A whimsical mask on fire."; $url_aliasize_item = "mask"; // what the alias is affectionately called @@ -29,11 +33,11 @@ $url_aliasize_suffix = ".php"; // actual suffix in redirect links // vars related to file uploading -$file_beam_img = "/res/img/coin-big.png"; +$file_beam_img = "res/img/coin-big.png"; $file_beam_alt = "A big & yellow coin lying before a coin-slot"; -$file_beam_win_img = "/res/img/coin_win-big.png"; +$file_beam_win_img = "res/img/coin_win-big.png"; $file_beam_win_alt = "A coin inserted into a coin slot."; -$file_beam_die_img = "/res/img/coin_die-big.png"; +$file_beam_die_img = "res/img/coin_die-big.png"; $file_beam_die_alt = "A coin on fire."; $file_beam_item = "coin"; // what the file is affectionately called diff --git a/res/library/insert-coin.php b/res/library/insert-coin.php index a6fd016..83bac21 100644 --- a/res/library/insert-coin.php +++ b/res/library/insert-coin.php @@ -14,7 +14,7 @@ function create_page($page_title, $template, $image_alt_text, $image_path) ?> <?php echo($image_alt_text); ?> + src=""> diff --git a/res/library/main.php b/res/library/main.php index 6931d07..12c54b9 100644 --- a/res/library/main.php +++ b/res/library/main.php @@ -18,6 +18,13 @@ function root($path) return $absolute_path; } +// PATH_RELATIVE_TO_PROJECT_ROOT --> PATH_RELATIVE_TO_WEB_ROOT +// Return the absolute path to something within the project's root. +function webroot($path) +{ + return $GLOBALS['webroot'] . $path; +} + include(root("res/library/array.php")); include(root("res/library/file.php")); include(root("res/library/insert-coin.php")); diff --git a/res/library/test.php b/res/library/test.php new file mode 100644 index 0000000..39f4c23 --- /dev/null +++ b/res/library/test.php @@ -0,0 +1,6 @@ + +
" + method="post" enctype="multipart/form-data">

diff --git a/res/templates/footer.php b/res/templates/footer.php index dd682bd..40358f6 100644 --- a/res/templates/footer.php +++ b/res/templates/footer.php @@ -10,7 +10,7 @@

  • lgn
  • fsf
  • eunichx
  • -
  • +
  • onion
  • source-code
  • diff --git a/res/templates/header.php b/res/templates/header.php index 7041f6f..8fd57d7 100644 --- a/res/templates/header.php +++ b/res/templates/header.php @@ -9,8 +9,8 @@ href="https://fontlibrary.org/face/connection" type="text/css"/> "> -"> + href=""> +"> diff --git a/res/templates/mask/create.php b/res/templates/mask/create.php index e1a35f5..135106c 100644 --- a/res/templates/mask/create.php +++ b/res/templates/mask/create.php @@ -1,4 +1,5 @@ - +" + method="post" enctype="multipart/form-data">

    diff --git a/res/templates/menu.php b/res/templates/menu.php index 8dc5d3a..960af55 100644 --- a/res/templates/menu.php +++ b/res/templates/menu.php @@ -1,11 +1,15 @@