svrjs-mods-directory/includes/page_user.php

32 lines
2.4 KiB
PHP
Raw Normal View History

2024-12-27 15:05:54 +01:00
<?php
if (!defined('SVRJS_MOD_DIRECTORY')) die;
$pageTitle = $userData['username'] . "'s profile";
$pageDescription = "View the " . $userData['username'] . "'s profile on SVR.JS Mods directory.";
include 'header.php';
?>
<main class="content">
<h1><?php echo htmlspecialchars($userData['username']); ?>'s profile</h1>
<p><?php echo isset($userData['bio']) && $userData['bio']
? str_replace(["\r\n", "\n", "\r"], '<br/>', htmlspecialchars($userData['bio']))
: "<i>No biography</i>";
?></p>
<p><b>Mods:</b> <?php echo htmlspecialchars(number_format($userData['mods'], 0)); ?> | <a href="<?php
echo htmlspecialchars((URL_REWRITTEN ? APP_ROOT : APP_ROOT . APP_FILENAME . '/') . 'user-mods/' . urlencode($userData['username']));
?>">View <?php echo htmlspecialchars($userData['username']); ?>'s mods</a></p>
<p><b>Reviews:</b> <?php echo htmlspecialchars(number_format($userData['reviews'], 0)); ?> | <a href="<?php
echo htmlspecialchars((URL_REWRITTEN ? APP_ROOT : APP_ROOT . APP_FILENAME . '/') . 'user-reviews/' . urlencode($userData['username']));
?>">View <?php echo htmlspecialchars($userData['username']); ?>'s reviews</a></p>
<?php
if (isset($_SESSION['user']) && $userData['id'] == $_SESSION['user']) {
echo '<div class="button-container">
<a href="' . htmlspecialchars((URL_REWRITTEN ? APP_ROOT : APP_ROOT . APP_FILENAME . '/') . 'edit-profile') . '" class="btn">Edit your profile</a>
<a href="' . htmlspecialchars((URL_REWRITTEN ? APP_ROOT : APP_ROOT . APP_FILENAME . '/') . 'pending-mods') . '" class="btn btn-secondary">View pending mods</a>
<a href="' . htmlspecialchars((URL_REWRITTEN ? APP_ROOT : APP_ROOT . APP_FILENAME . '/') . 'change-user-data') . '" class="btn btn-secondary">Change user data</a>
<a href="' . htmlspecialchars((URL_REWRITTEN ? APP_ROOT : APP_ROOT . APP_FILENAME . '/') . 'delete-account') . '" class="btn btn-secondary">Delete account</a>
</div>';
}
?>
</main>
<?php
include 'footer.php';
?>