From 22756c834eda82545e396ee09b37ee49c74d898c Mon Sep 17 00:00:00 2001 From: biglyderv Date: Wed, 11 Dec 2024 23:51:42 -0500 Subject: [PATCH] crappy ui for threads --- docs/comment.php | 11 +++++++++++ docs/index.php | 4 ++-- libs/comment.php | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 docs/comment.php diff --git a/docs/comment.php b/docs/comment.php new file mode 100644 index 0000000..418aa96 --- /dev/null +++ b/docs/comment.php @@ -0,0 +1,11 @@ + diff --git a/docs/index.php b/docs/index.php index 713987a..5df21fc 100755 --- a/docs/index.php +++ b/docs/index.php @@ -6,8 +6,8 @@ $ref = 1732684297; function getOut($typer, $idr) { - if ($typer == 'user') { - header("Location: " . '/user.php?id=' . htmlspecialchars($idr)); + if ($typer == 'user' || $typer == 'comment') { + header("Location: " . '/' . $typer . '.php?id=' . htmlspecialchars($idr)); die(); } diff --git a/libs/comment.php b/libs/comment.php index 9ba3140..2d5a70e 100644 --- a/libs/comment.php +++ b/libs/comment.php @@ -37,6 +37,12 @@ prepare("SELECT * FROM comment WHERE id = ? ORDER BY date DESC"); + $stmt->execute([ + $idr + ]); + $posts1 = $stmt->fetchAll(PDO::FETCH_DEFAULT); + $stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC LIMIT ? OFFSET ?"); $stmt->execute([ $typer, @@ -45,7 +51,9 @@ $page * 10 ]); - $posts = $stmt->fetchAll(PDO::FETCH_DEFAULT); + $posts2 = $stmt->fetchAll(PDO::FETCH_DEFAULT); + + $posts = array_merge($posts1,$posts2); foreach ($posts as $post) { ?>
@@ -58,7 +66,9 @@
- + '> + +