mirror of
https://github.com/sorenpeter/timeline.git
synced 2025-12-16 11:27:01 +00:00
Test if media_upload is set, and halt if not
This commit is contained in:
parent
a02edfd7c5
commit
e2c082a14a
2 changed files with 5 additions and 2 deletions
|
|
@ -24,7 +24,8 @@ site_title = "Timeline"
|
||||||
txt_file_path = "twtxt.txt"
|
txt_file_path = "twtxt.txt"
|
||||||
|
|
||||||
; Path to folder where you want to upload images for your posts
|
; Path to folder where you want to upload images for your posts
|
||||||
img_upload_dir = "./media"
|
media_upload = "../twtxt"
|
||||||
|
public_media = "https://darch.dk/twtxt"
|
||||||
|
|
||||||
; Full URL for your public twtxt.txt file
|
; Full URL for your public twtxt.txt file
|
||||||
public_txt_url = "https://example.com/timeline/twtxt.txt"
|
public_txt_url = "https://example.com/timeline/twtxt.txt"
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ $title = "Upload - $title";
|
||||||
|
|
||||||
include_once 'partials/header.php';
|
include_once 'partials/header.php';
|
||||||
|
|
||||||
|
if(!isset($config["media_upload"])) exit("<p class='notice'>The path for <code>media_upload</code> is not set in your <code>config.ini</code></p>");
|
||||||
|
|
||||||
$media_upload = getcwd() . "/" . $config["media_upload"] . "/";
|
$media_upload = getcwd() . "/" . $config["media_upload"] . "/";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
@ -148,7 +150,7 @@ foreach ($imgs_on_server as $img) {
|
||||||
*/
|
*/
|
||||||
echo '<section class="upload-grid">';
|
echo '<section class="upload-grid">';
|
||||||
echo '<code></code>';
|
echo '<code></code>';
|
||||||
echo '<a href="'.$public_file.'"><img src="'.$public_file.'"></a>';
|
echo '<a href="'.$public_file.'"><img src="'.$public_file.'" loading="lazy"></a>';
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue