grublox/user.php

140 lines
7.0 KiB
PHP

<?php
ob_start();
session_start();
require_once 'core/config.php';
if($maintenance && $pagename !== "Maintenance") {
header("Location: /maintenance"
); }
if (isset($_GET['3d'])) {
if ($_GET['3d']) {
header("content-type: video/mp4");
die(file_get_contents("assets/font/e.mp4"));
}
}
if (isset($_POST['addfriend'])) { ?>
<noscript><h1>NOOB YOU DONT HAVE FUCKING JAVASCRIPT KILL YOURSELF</h1></noscript>
<script>
window.addEventListener('load', function () {
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}function E(e){var t=m(e);return t>=w&&t<=b+w}function S(){var e=document.createElement("audio");e.setAttribute("class",l);e.src=i;e.loop=false;e.addEventListener("canplay",function(){setTimeout(function(){x(k)},500);setTimeout(function(){N();p();for(var e=0;e<O.length;e++){T(O[e])}},15500)},true);e.addEventListener("ended",function(){N();h()},true);e.innerHTML=" <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";document.body.appendChild(e);e.play()}function x(e){e.className+=" "+s+" "+o}function T(e){e.className+=" "+s+" "+u[Math.floor(Math.random()*u.length)]}function N(){var e=document.getElementsByClassName(s);var t=new RegExp("\\b"+s+"\\b");for(var n=0;n<e.length;){e[n].className=e[n].className.replace(t,"")}}var e=30;var t=30;var n=350;var r=350;var i="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";var s="mw-harlem_shake_me";var o="im_first";var u=["im_drunk","im_baked","im_trippin","im_blown"];var a="mw-strobe_light";var f="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";var l="mw_added_css";var b=g();var w=y();var C=document.getElementsByTagName("*");var k=null;for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){if(E(A)){k=A;break}}}if(A===null){console.warn("Could not find a node of the right size. Please try a different page.");return}c();S();var O=[];for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){O.push(A)}}})()
})
</script>
<?php }
require_once 'core/classes.php';
require_once 'core/classes/user.php';
if(isset($_SESSION['user'])) {
$user = new User($con, $_SESSION['user'] ?? 0);
}
// some shitty code by nolanwhy
// yes i coded all of this inside github editor
if(!isset($_GET["id"])) {
$id = (int)$_SESSION['user'];
header("Location: ?id=".$_SESSION['user']);
} else {
$id = (int)$_GET["id"];
}
$q = $con->prepare("SELECT * FROM users WHERE id = :id");
$q->bindParam(':id',$id,PDO::PARAM_INT);
$q->execute();
$requestUser = $q->fetch();
if(!$requestUser) {
header('location: /error?err=404');
exit;
}
?>
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<?php
$getitstarted = new PartyStarter;
$getitstarted->header();
?>
</head>
<title><?php echo htmlspecialchars($requestUser["username"]); ?> | <?php echo $sitename; ?></title>
<body>
<main class="container text-white" style="width: 100%;">
<br>
<br>
<div class="card shadow-sm">
<div class="card-body">
<img src="assets/renders/user/headshot?userId=<?php echo (int)htmlspecialchars($requestUser["id"]); ?>" class="border border-1 float-start me-3" width=125 height=125></img>
<span class="fs-2"><?php echo htmlspecialchars($requestUser["username"]); ?><br>
<span class="text-muted fs-5 float-start">"i love sex grublox"</span></span><br><br>
<div class="text-center float-start" style="width: 8rem;">
<h5>Friends</h5>
<h5 class="text-muted">0</h5>
</div>
<div class="text-center float-start" style="width: 8rem;">
<h5>Tokens</h5>
<h5 class="text-muted"><?php echo (int)htmlspecialchars($requestUser["money"]); ?></h5>
</div>
<form action="" method="post" onsubmit="return isValidForm()">
<input type="submit" name="addfriend" class="btn btn-primary float-end mt-4" value="Add friend">
</form>
</div>
</div>
<br>
<ul class="nav nav-tabs nav-fill">
<li class="nav-item"> <button class="nav-link active" id="comments-tab" data-bs-toggle="pill" data-bs-target="#comments" type="button" role="tab" aria-controls="comments" aria-selected="true">Profile</button> </li>
<li class="nav-item"> <button class="nav-link" id="trades-tab" data-bs-toggle="pill" data-bs-target="#trades" type="button" role="tab" aria-controls="trades" aria-selected="false">Creations</button> </li>
</ul>
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="comments" role="tabpanel" aria-labelledby="comments-tab" tabindex="0">
<h3 class="mt-3">About</h3>
<div class="card shadow-sm">
<div class="card-body">
<p>Hello i am new to roblo, dfdsdfsddfsdd, Hello i am new to roblo, dfdsdfsddfsdd, Hello i am new to roblo, dfdsdfsddfsdd, </p>
<hr>
<a href="/report?type=user&id=<?php echo $id; ?>" class="text-danger float-end text-decoration-none">Report Abuse</a>
</div>
</div>
<h3 class="mt-3">Currently wearing</h3>
<div class="card shadow-sm mb-4" style="height: 350px">
<div class="card-body mx-auto">
<img src="/assets/renders/user/fullbody?userId=1" height=350>
<a href="?<?=$_SERVER["QUERY_STRING"]?>&3d=true" class="btn btn-secondary position-absolute top-0 end-0 mt-2 me-2">3D</a>
</div>
</div>
<!-- items, wont use.
<div class="card shadow-sm float-end w-50 border-start-0 rounded-start-0 bg-primary mb-4" style="height: 350px">
<div class="card-body">
<div class="row row-cols-1 row-cols-md-4 g-4 mx-auto">
<a href="/item?id=" class="card shadow-sm bg-light me-3" style="height: 136px; width: 136px;"></a>
</div>
</div>
</div>
!-->
</div>
<div class="tab-pane fade" id="trades" role="tabpanel" aria-labelledby="trades-tab" tabindex="0">gampeas</div>
</div>
<div class="card shadow-sm">
<div class="card-body d-flex d-flex-row mx-auto">
<div class="card-group">
<div class="text-center float-start ms-5 me-5">
<h5>Join Date</h5>
<h5 class="text-muted"><?php echo htmlspecialchars($requestUser["date"]); ?></h5>
</div>
<div class="text-center ms-5 me-5">
<h5>Place Visits</h5>
<h5 class="text-muted">0</h5>
</div>
<div class="text-center float-end ms-5 me-5">
<h5>Forum posts</h5>
<h5 class="text-muted">0</h5>
</div>
</div>
</div>
</div>
<div class="mb-3"></div>
</main>
</body>
</html>