Пример #1
0
<?php

require_once "framework2/UserMgmt.php";
$um = new UserMgmt();
$uid = isset($_GET["uid"]) ? filter_var($_GET["uid"], FILTER_SANITIZE_NUMBER_INT) : null;
if ($uid == null) {
    header('Location: ./');
}
$loggedIn = $um->getLoginStatus();
function getAvatarOf($userid)
{
    if (file_exists("user_images/uid_" . $userid . ".jpg")) {
        return "/user_images/uid_" . $userid . ".jpg";
    } else {
        return "/colorful/Anonymous_User.jpg";
    }
}
$userName = $um->resolveIDToUsername($uid);
if ($userName == null) {
    header('Location: ./');
}
$avatarUrl = getAvatarOf($uid);
?>
<!DOCTYPE html>
<html>
<head>
	<title>"<?php 
echo $userName;
?>
" at Walkntrade</title>
	<link type="text/css" rel="stylesheet" href="css/style.css">