diff --git a/docs/comment.php b/docs/comment.php
index 1abcdda..4b2c20e 100644
--- a/docs/comment.php
+++ b/docs/comment.php
@@ -4,8 +4,6 @@ require(__DIR__ . "/../libs/page.php");
require(__DIR__ . "/../libs/form.php");
require(__DIR__ . "/../libs/comment.php");
-$ref = 1732684297;
-
page_header();
comments("comment", $_GET['id']);
page_footer();
diff --git a/docs/css/main.css b/docs/css/main.css
index 99edeba..22955cf 100755
--- a/docs/css/main.css
+++ b/docs/css/main.css
@@ -202,6 +202,10 @@ iframe {
justify-content: center;
}
+.header a.leave {
+ margin-left: auto;
+}
+
.clickie {
width: min-content;
margin-top: 40px;
diff --git a/docs/index.php b/docs/index.php
index 2c12284..1ea5085 100644
--- a/docs/index.php
+++ b/docs/index.php
@@ -4,25 +4,17 @@ require(__DIR__ . "/../libs/form.php");
require(__DIR__ . "/../libs/comment.php");
page_header();
-if (!is_null($username)) {
- //comments("root","root");
-}
-if (!($_GET['page'] > 0)) { ?>
+if (!($_GET['page'] > 0) && is_null($username)) { ?>
0) { ?>
Previous
diff --git a/libs/markdown.php b/libs/markdown.php
index eec5fd0..28a7656 100755
--- a/libs/markdown.php
+++ b/libs/markdown.php
@@ -2,40 +2,24 @@
function markdown($text)
{
$search = array(
- '~(https://[^.]+\.dervland\.net/[^\s<]+\.(png|jpg|jpeg|gif))~i',
- '~(https://[^.]+\.dervland\.net/[^\s<]+\.(mp3|wav))~i',
- '~(https://[^.]+\.dervland\.net/[^\s<]+\.(webm|mp4))~i',
- //'~(https://studio\.penguinmod\.com/[^\s#]*[#]([^\s<]*))~i',
- //'~(https://studio\.penguinmod\.com/[^\s#]*[?#]?([^\s<#]*)[#]?([^\s<]*))~i',
- '~(?:\s|^)(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?
$1

',
- '
$1
',
- '
$1
',
- //'https://studio.penguinmod.com/?#$2',
- //'
$1
',
- '
$0',
- '
@$1',
- '
$2',
- '
$2',
- '
$2',
- '
',
- '
$2',
- '
$2
',
- '
$4',
- '
$2'
- );
+ '
$1

',
+ '
$1
',
+ '
$1
',
+ //'https://studio.penguinmod.com/?#$2',
+ //'
$1
',
+ '
$0',
+ '
@$1',
+ );
$text = preg_replace($search, $replace, $text);
diff --git a/libs/page.php b/libs/page.php
index 81f7494..40d74d8 100755
--- a/libs/page.php
+++ b/libs/page.php
@@ -7,39 +7,66 @@ function page_header()
global $username;
$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC");
$stmt->execute([
- "notification",
- $username,
+ "notification",
+ $username,
]);
$posts2 = $stmt->fetchAll(PDO::FETCH_DEFAULT);
- $edge = count($posts2);
+
+ $stmt = $db->prepare("SELECT * FROM main.read WHERE username = ?");
+ $stmt->execute([
+ $username
+ ]);
+
+ $counter = $stmt->fetchAll(PDO::FETCH_DEFAULT);
+
+ $edge = count($posts2) - $counter[0]['msgs'];
?>
-
-
-
-
BiglyChat
-
-
-
-
-
-
-
+
+
+
BiglyChat
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
diff --git a/scripts/init.php b/scripts/init.php
index 7d27613..855440a 100755
--- a/scripts/init.php
+++ b/scripts/init.php
@@ -4,7 +4,7 @@ require(__DIR__ . "/../libs/test_secret.php");
global $db;
-$sql = file_get_contents('../scripts/init.sql', true);
+$sql = file_get_contents(__DIR__ .'/../scripts/init.sql', true);
$db->exec($sql);
diff --git a/scripts/init.sql b/scripts/init.sql
index ad101b5..c3885bd 100755
--- a/scripts/init.sql
+++ b/scripts/init.sql
@@ -4,4 +4,5 @@ CREATE TABLE IF NOT EXISTS main.user (username TEXT, bio TEXT);
CREATE TABLE IF NOT EXISTS main.role (username TEXT, role TEXT);
CREATE TABLE IF NOT EXISTS main.follow (username TEXT, target TEXT);
CREATE TABLE IF NOT EXISTS main.ban (username TEXT, reason TEXT);
+CREATE TABLE IF NOT EXISTS main.read (username TEXT, msgs REAL);
CREATE TABLE IF NOT EXISTS main.comment (username TEXT, targetType TEXT, targetId TEXT, date REAL, content TEXT, id TEXT);