diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/alert.php | 6 | ||||
| -rw-r--r-- | lib/emote.php | 10 | ||||
| -rw-r--r-- | lib/partials.php | 26 |
3 files changed, 20 insertions, 22 deletions
diff --git a/lib/alert.php b/lib/alert.php index 823a97a..2983378 100644 --- a/lib/alert.php +++ b/lib/alert.php @@ -26,9 +26,9 @@ function display_alert() $ok = substr($status, 0, 1) == '2'; echo '' ?> - <div class="box row alert <?php echo $ok ? '' : 'red' ?>" style="gap:8px;" id="alert-box"> - <img src="/static/img/icons/<?php echo $ok ? 'yes' : 'no' ?>.png" alt=""> - <p><b><?php echo $reason ?></b></p> + <div class="box row alert <?= $ok ? '' : 'red' ?>" style="gap:8px;" id="alert-box"> + <img src="/static/img/icons/<?= $ok ? 'yes' : 'no' ?>.png" alt=""> + <p><b><?= $reason ?></b></p> </div> <script> setTimeout(() => { diff --git a/lib/emote.php b/lib/emote.php index ce39c09..a724914 100644 --- a/lib/emote.php +++ b/lib/emote.php @@ -209,9 +209,8 @@ function html_random_emote(PDO &$db) <p>Random emote</p> </div> <div class="box content center"> - <a href="/emotes?id=<?php echo $row["id"] ?>"> - <img src="/static/userdata/emotes/<?php echo $row["id"] ?>/3x.webp" alt="<?php echo $row["code"] ?>" - width="192"> + <a href="/emotes?id=<?= $row["id"] ?>"> + <img src="/static/userdata/emotes/<?= $row["id"] ?>/3x.webp" alt="<?= $row["code"] ?>" width="192"> </a> </div> </section> @@ -236,9 +235,8 @@ function html_featured_emote(PDO &$db) <p>Featured emote</p> </div> <div class="box content center"> - <a href="/emotes?id=<?php echo $row["id"] ?>"> - <img src="/static/userdata/emotes/<?php echo $row["id"] ?>/3x.webp" alt="<?php echo $row["code"] ?>" - width="192"> + <a href="/emotes?id=<?= $row["id"] ?>"> + <img src="/static/userdata/emotes/<?= $row["id"] ?>/3x.webp" alt="<?= $row["code"] ?>" width="192"> </a> </div> </section> diff --git a/lib/partials.php b/lib/partials.php index 979621d..60d1325 100644 --- a/lib/partials.php +++ b/lib/partials.php @@ -34,7 +34,7 @@ function html_navigation_bar() $unread_count = intval($stmt->fetch()[0]); echo '' ?> <a href="/inbox.php" class="button"> - Inbox <?php echo $unread_count > 0 ? "($unread_count)" : "" ?> + Inbox <?= $unread_count > 0 ? "($unread_count)" : "" ?> </a> <?php ; $stmt = null; @@ -48,7 +48,7 @@ function html_navigation_bar() echo '' ?> <a href="/report/list.php" class="button"> - Reports <?php echo $unread_count > 0 ? "($unread_count)" : "" ?> + Reports <?= $unread_count > 0 ? "($unread_count)" : "" ?> </a> <?php ; } @@ -81,7 +81,7 @@ function html_navigation_bar() <div class="flex items-bottom small-gap" style="margin-left: auto;"> <?php if (isset($_SESSION["user_emote_sets"])): ?> <form action="/account/change_emoteset.php" method="POST" id="form-change-emoteset"> - <input type="text" name="redirect" value="<?php echo $_SERVER["REQUEST_URI"] ?>" style="display: none;"> + <input type="text" name="redirect" value="<?= $_SERVER["REQUEST_URI"] ?>" style="display: none;"> <div class="row small-gap"> <label for="id">Current emote set: </label> <select name="id" onchange="send_change_emoteset(event)"> @@ -100,8 +100,8 @@ function html_navigation_bar() </script> <?php endif; ?> - <a href="/users.php?id=<?php echo $_SESSION["user_id"] ?>" class="flex items-bottom small-gap"> - Signed in as <?php echo $_SESSION["user_name"] ?> + <a href="/users.php?id=<?= $_SESSION["user_id"] ?>" class="flex items-bottom small-gap"> + Signed in as <?= $_SESSION["user_name"] ?> <?php echo '<img src="/static/'; if (is_dir($_SERVER['DOCUMENT_ROOT'] . "/static/userdata/avatars/" . $_SESSION["user_id"])) { @@ -129,20 +129,20 @@ function html_navigation_search() Search... </div> <div class="box content"> - <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="GET"> - <input type="text" name="q" style="padding:4px;" value="<?php echo $_GET["q"] ?? "" ?>"><br> + <form action="<?= $_SERVER["REQUEST_URI"] ?>" method="GET"> + <input type="text" name="q" style="padding:4px;" value="<?= $_GET["q"] ?? "" ?>"><br> <?php if (str_starts_with($_SERVER["REQUEST_URI"], "/emotes")) { ?> <label for="sort_by">Sort by</label> <select name="sort_by"> - <option value="high_ratings" <?php echo ($_GET["sort_by"] ?? "") == "high_ratings" ? "selected" : "" ?>> + <option value="high_ratings" <?= ($_GET["sort_by"] ?? "") == "high_ratings" ? "selected" : "" ?>> High ratings</option> - <option value="low_ratings" <?php echo ($_GET["sort_by"] ?? "") == "low_ratings" ? "selected" : "" ?>>Low + <option value="low_ratings" <?= ($_GET["sort_by"] ?? "") == "low_ratings" ? "selected" : "" ?>>Low ratings</option> - <option value="recent" <?php echo ($_GET["sort_by"] ?? "") == "recent" ? "selected" : "" ?>>Recent + <option value="recent" <?= ($_GET["sort_by"] ?? "") == "recent" ? "selected" : "" ?>>Recent </option> - <option value="oldest" <?php echo ($_GET["sort_by"] ?? "") == "oldest" ? "selected" : "" ?>>Oldest + <option value="oldest" <?= ($_GET["sort_by"] ?? "") == "oldest" ? "selected" : "" ?>>Oldest </option> </select> <?php @@ -167,10 +167,10 @@ function html_pagination(int $total_pages, int $current_page, string $redirect) echo '' ?> <div class="pagination"> <?php if ($current_page > 1): ?> - <a href="<?php echo $redirect . ($current_page - 1) ?>">[ prev ]</a> + <a href="<?= $redirect . ($current_page - 1) ?>">[ prev ]</a> <?php endif; ?> <?php if ($current_page < $total_pages): ?> - <a href="<?php echo $redirect . ($current_page + 1) ?>">[ next ]</a> + <a href="<?= $redirect . ($current_page + 1) ?>">[ next ]</a> <?php endif; ?> </div> |
