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 0e6ec46..0000000 Binary files a/public_html/private/.create.php.swp and /dev/null differ 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 @@