bugfixes, refactoring

This commit is contained in:
biglyderv 2025-02-07 11:37:04 -05:00
parent 0ef97c4889
commit f542656bc9
Signed by: biglyderv
GPG key ID: 1398543B9746192C
5 changed files with 50 additions and 94 deletions

View file

@ -7,8 +7,8 @@ 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);
@ -25,21 +25,39 @@ function page_header()
<body>
<div class="header">
<a href="/"><img class="header-img header-link" src="/img/bgc.svg">BiglyChat</a>
<?php if (isset($username)) { ?>
<?php if (isset($username)) { ?>
<a href="/user.php?id=<?php echo $username ?>"><img class="header-img header-link" src="/pfp/<?php echo $username ?>.png">Wall</a>
<a href="/notif.php"> <img class="header-img header-link" src="/img/mail.svg"><span>Mail<sub> <?php echo $edge?></sub></span></a>
<a href="/stats.php?username=<?php echo $username ?>"><img class="header-img header-link" src="/img/home.svg">Users</a>
<a href="/logout.php"><img class="header-img header-link" src="/img/logout.svg">Leave</a>
<a href="/logout.php"><img class="header-img header-link" src="/img/logout.svg">Leave</a>
<?php } else { ?>
<a href="/login.php"><img class="header-img header-link" src="/img/home.svg">Join</a>
<a href="/stats.php"><img class="header-img header-link" src="/img/home.svg">Users</a>
<?php }
<a href="/stats.php"><img class="header-img header-link" src="/img/home.svg">Users</a>
<?php }
?>
</div>
<?php }
<?php }
function page_footer()
{ ?>
</body>
</html>
<?php }
?>
</body>
</html>
<?php }
function user_block($usern, $meta, $tag)
{
?>
<div class='comment'>
<div class="avatar">
<img src="/pfp/<?php echo $usern ?>.png" class="avatar-img">
<div>
<div><b>
<a class="link" href="/user.php?id=<?php echo $usern ?>">
<?php echo $usern ?>
</a>
</b>
</div>
</div>
</div>
<?php echo (is_null($meta) || !$meta) ? '' : "<b>$tag</b>: $meta"; ?>
</div>
<?php }
?>