From cfd6efc6ec32bdc81d5a1f4c59f41e896378d2fc Mon Sep 17 00:00:00 2001
From: Howard Yeend
Date: Fri, 21 Jan 2022 11:15:12 +0000
Subject: [PATCH 1/4] prompt to create a new page once an image is uploaded
---
index.php | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/index.php b/index.php
index 2bb2258..3365d90 100644
--- a/index.php
+++ b/index.php
@@ -259,10 +259,10 @@ function file_put_contents($n, $d)
if ( $action == "edit" )
$html .= " \n";
else
- $html .= "Title:
\n";
+ $html .= "Title:
\n";
if ( $action == "new" )
- $text = "";
+ $text = $_REQUEST['newText'];
$html .= "
\n";
$html .= " ";
@@ -309,7 +309,10 @@ function file_put_contents($n, $d)
if ( move_uploaded_file($_FILES['userfile']['tmp_name'],
BASE_PATH . "/images/$dstName") === true )
{
- $html = "
File '$dstName' uploaded
\n";
+ $html = "File '$dstName' uploaded ";
+ $uploadedName = pathinfo($dstName);
+ $filename = $uploadedName['filename'];
+ $html .= "Create a new page with this image in it
";
}
else
{
From 47af03c55dd8f0aee5569219e2519e7210d0ea82 Mon Sep 17 00:00:00 2001
From: Howard Yeend
Date: Fri, 21 Jan 2022 11:20:30 +0000
Subject: [PATCH 2/4] rm un-needed quotes
---
index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.php b/index.php
index 3365d90..dfb23eb 100644
--- a/index.php
+++ b/index.php
@@ -312,7 +312,7 @@ function file_put_contents($n, $d)
$html = "File '$dstName' uploaded ";
$uploadedName = pathinfo($dstName);
$filename = $uploadedName['filename'];
- $html .= "Create a new page with this image in it
";
+ $html .= "Create a new page with this image in it
";
}
else
{
From f8507633da86af7d12161fbde54c13eb00497b54 Mon Sep 17 00:00:00 2001
From: Howard Yeend
Date: Fri, 21 Jan 2022 11:29:20 +0000
Subject: [PATCH 3/4] added empty images directory as it is required for
uploads
---
images/README.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 images/README.txt
diff --git a/images/README.txt b/images/README.txt
new file mode 100644
index 0000000..9742b74
--- /dev/null
+++ b/images/README.txt
@@ -0,0 +1 @@
+This directory is where any uploads will be stored.
\ No newline at end of file
From 759ec193cbc36f709b0989dcbb6d57504dad1efa Mon Sep 17 00:00:00 2001
From: Howard Yeend
Date: Fri, 21 Jan 2022 13:48:11 +0000
Subject: [PATCH 4/4] Can now rename files, preserving links to those pages
---
index.php | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/index.php b/index.php
index dfb23eb..25fd16b 100644
--- a/index.php
+++ b/index.php
@@ -245,7 +245,7 @@ function file_put_contents($n, $d)
}
else
{
- if ( $action != "save" && $action != "all_name" && $action != "all_date" && $action != "upload" && $action != "new" && $action != "logout" && $action != "uploaded" && $action != "search" && $action != "view" )
+ if ( $action != "save" && $action != "all_name" && $action != "all_date" && $action != "upload" && $action != "new" && $action != "logout" && $action != "uploaded" && $action != "search" && $action != "view" && $action != "rename" && $action != "renamed" )
{
$action = "edit";
}
@@ -342,7 +342,7 @@ function file_put_contents($n, $d)
$html .= toHTML($newText);
}
-/*
+
else if ( $action == "rename" )
{
$html = "