From 79c0b0839715054639c073341704e508d5b895aa Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 16 Oct 2024 10:27:01 +0200 Subject: [PATCH] add # before title, add webpage title (wip) --- .gitignore | 1 + common.php | 4 +++- note.php | 20 ++++++++++++++++++-- style.css | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..edd8de6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +settings.php diff --git a/common.php b/common.php index 6fd248c..b86a2c6 100644 --- a/common.php +++ b/common.php @@ -38,8 +38,10 @@ { foreach($links as $link) { + $url = $link[1]; + $title = webpagetitle($url); $divcontent .= '
- ' . $link[1] . ' + ' . $title . '
'; } } diff --git a/note.php b/note.php index 50662e5..6ca90b0 100644 --- a/note.php +++ b/note.php @@ -1,6 +1,21 @@ (.*?)<\/title>/i', $html, $matches); + return isset($matches[1]) ? $matches[1] : $url;*/ + + return $url; + } + function savenote($title, $content) { global $dir; @@ -28,6 +43,8 @@ array_unshift($_SESSION['index'], $path); } + // main + // handle save actions if (count($_POST) > 0) { @@ -75,7 +92,6 @@ } } - // main $title = ''; $content = false; if (isset($_GET['new'])) @@ -126,7 +142,7 @@ -
+
#
diff --git a/style.css b/style.css index dedc8f4..b027f52 100644 --- a/style.css +++ b/style.css @@ -34,7 +34,7 @@ a { outline: none; margin-top: 10px; color: inherit; - width: 100%; + width: 80%; } input[type="submit"] {