diff --git a/docs/index.php b/docs/index.php index 5c7caff..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) && is_null($username)) { ?>
diff --git a/docs/notif.php b/docs/notif.php index e96fee3..0e8a2cc 100644 --- a/docs/notif.php +++ b/docs/notif.php @@ -6,6 +6,16 @@ require(__DIR__ . "/../libs/comment.php"); $ref = 1732684297; +$stmt = $db->prepare("DELETE FROM main.read WHERE username = ?"); +$stmt->execute([$username]); + +$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date"); +$stmt->execute(["notification",$username]); +$counter = $stmt->fetchAll(PDO::FETCH_DEFAULT); + +$stmt = $db->prepare("INSERT INTO main.read (username, msgs) VALUES (?, ?)"); +$stmt->execute([$username, count($counter)]); + page_header(); comments("notification", $username, true); page_footer(); diff --git a/libs/comment.php b/libs/comment.php index f3fb034..63ddbd4 100644 --- a/libs/comment.php +++ b/libs/comment.php @@ -32,18 +32,7 @@ function comments($typer, $idr, $disable = false) $qss['page'] = $page - 1; $qs_prev = http_build_query($qss); $qss['page'] = $page; - - $qss['mode'] = 'all'; - $qs_1 = http_build_query($qss); - - $qss['mode'] = 'followers'; - $qs_2 = http_build_query($qss); ?> - -