improve pings menu
This commit is contained in:
parent
a8921d484c
commit
9685751976
4 changed files with 17 additions and 6 deletions
|
@ -2,8 +2,19 @@
|
|||
require(__DIR__ . "/auth.php");
|
||||
global $username;
|
||||
function page_header() {
|
||||
global $username; ?>
|
||||
<!DOCTYPE html>
|
||||
global $db;
|
||||
global $username;
|
||||
$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC");
|
||||
$stmt->execute([
|
||||
"notification",
|
||||
$username,
|
||||
]);
|
||||
|
||||
$posts2 = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||
|
||||
$edge = count($posts2);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>NewBiglyChat</title>
|
||||
|
@ -17,7 +28,7 @@
|
|||
<?php
|
||||
if (isset($username)) { ?>
|
||||
<a class="header-link" href="/user.php?id=<?php echo $username ?>"><?php echo $username ?></a>
|
||||
<a class="header-link" href="/notif.php">Pings</a>
|
||||
<a class="header-link" href="/notif.php">Pings [<?php echo $edge ?>]</a>
|
||||
<a class="header-link" href="/logout.php">Logout</a>
|
||||
<?php } else { ?>
|
||||
<a class="header-link" href="/login.php">Login</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue