light touch ups and fixed some of the issues, updated bootstrap to 5.3

This commit is contained in:
ui0ppk 2023-02-04 15:54:07 +02:00
parent dc82c51d97
commit 3f41b04154
9 changed files with 209 additions and 257 deletions

View File

@ -1,59 +1,60 @@
<?php <?php
ini_set('session.cookie_secure', '1'); require ('core/config.php');
ini_set('session.cookie_lifetime', '2592000');
ob_start(); //Turns on output buffering
session_start();
require('core/config.php');
class PartyStarter { class PartyStarter {
function bootstrap() { function bootstrap() {
echo '<link rel="stylesheet" href="css/bootstrap.min.css"> echo '<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">'; <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">';
} }
function header() { function header() {
// to not confuse you i renamed it from loggedoutheader to header since qzip made it both lol // to not confuse you i renamed it from loggedoutheader to header since qzip made it both lol
require('core/config.php'); require ('core/config.php');
$grubloxlogotohome = '<a class="navbar-brand" href="/"><img src="/assets/icons/Grublox.png" width="131" height="30" class="d-inline-block align-top" alt=""></a>'; $grubloxlogotohome = '<a class="navbar-brand text-dark" href="/"><img src="/assets/icons/Grublox.png" width="131" height="30" class="d-inline-block align-top" alt=""></a>';
$showhome = ''; $showhome = '';
if(isset($_SESSION['user'])) { if (isset($_SESSION['user'])) {
$showhome = ' <li class="nav-item" style="color: #FFFFFF;"> $showhome = ' <li class="nav-item text-dark" style="color: #FFFFFF;">
<a class="nav-link active" href="/home"><i class="bi bi-house"></i> Home <a class="nav-link text-dark" href="/home"><i class="bi bi-house"></i> Home
<span class="visually-hidden">(current)</span> <span class="visually-hidden">(current)</span>
</a> </a>
</li>'; </li>';
$grubloxlogotohome = '<a class="navbar-brand" href="/home"><img src="/assets/icons/Grublox.png" width="131" height="30" class="d-inline-block align-top" alt=""></a>'; $grubloxlogotohome = '<a class="navbar-brand text-dark" href="/home"><img src="/assets/icons/Grublox.png" width="131" height="30" class="d-inline-block align-top" alt=""></a>';
$query = $con->prepare('SELECT money FROM users WHERE id=:id'); $query = $con->prepare('SELECT money FROM users WHERE id=:id');
$query->bindParam(':id', $id); $query->bindParam(':id', $id);
$query->execute(); $query->execute();
$money = $query->fetch(PDO::FETCH_ASSOC)["money"] ?? "-0"; $money = $query->fetch(PDO::FETCH_ASSOC) ["money"] ?? "-0";
if ($money < 1000000) { if ($money < 1000000) {
// Anything less than a million // Anything less than a million
$money = number_format($money); $money = number_format($money);
} else if ($money < 1000000000) { }
// Anything less than a billion else if ($money < 1000000000) {
$money = number_format($money / 1000000, 1) . 'M'; // Anything less than a billion
} else { $money = number_format($money / 1000000, 1) . 'M';
// At least a billion }
$money = number_format($money / 1000000000, 1) . 'B'; else {
// At least a billion
} $money = number_format($money / 1000000000, 1) . 'B';
// messy shit sorry mario1 fix it urself :trol:
}
$rightside = '<li class="nav-item"><a class="nav-link">'.$money.'</a></li> <li class="nav-item"> // messy shit sorry mario1 fix it urself :trol:
<a class="nav-link" href="/logout"><i class="bi bi-box-arrow-right"></i> Logout</a> $rightside = '<li class="nav-item"><a class="nav-link text-dark">' . $money . '</a></li> <li class="nav-item">
<a class="nav-link text-dark" href="/logout"><i class="bi bi-box-arrow-right"></i> Logout</a>
</li>'; </li>';
} else { }
$rightside = ' else {
$rightside = '
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/register">Register</a> <a class="nav-link text-dark" href="/register">Register</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/login">Login</a> <a class="nav-link text-dark" href="/login">Login</a>
</li>'; </li>';
} }
echo '<style> body, html, .jumbotron, .jumbotron-fluid, .container, main { background-color: #2b3036; } </style>'; echo '<link rel="stylesheet" href="css/bootstrap.min.css">
echo '<link rel="stylesheet" href="css/bootstrap.min.css"> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
<nav class="navbar navbar-expand-lg navbar-light sticky-top" style="background-color: #ff7700; height: 45px; "> <nav class="navbar navbar-expand-lg navbar-light sticky-top" style="background-color: #ff7700; height: 45px; ">
<div class="container-fluid"> <div class="container-fluid">
@ -65,25 +66,24 @@ class PartyStarter {
<ul class="navbar-nav me-auto ml-auto" style="color: #FFFFFF;"> <ul class="navbar-nav me-auto ml-auto" style="color: #FFFFFF;">
' . $showhome . ' ' . $showhome . '
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/games"><i class="bi bi-controller"></i> Games</a> <a class="nav-link text-dark" href="/games"><i class="bi bi-controller"></i> Games</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/catalog"><i class="bi bi-shop"></i> Catalog</a> <a class="nav-link text-dark" href="/catalog"><i class="bi bi-shop"></i> Catalog</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/about"><i class="bi bi-question-circle"></i> About</a> <a class="nav-link text-dark" href="/about"><i class="bi bi-question-circle"></i> About</a>
</li> </li>
</ul> </ul>
<ul class="navbar-nav"> <ul class="navbar-nav">
<li class="nav-item"> <li class="nav-item">
</li> </li>
'.$rightside.' ' . $rightside . '
</ul> </ul>
</div> </div>
</div> </div>
</nav>'; </nav>';
} }
} }
?> ?>

View File

@ -1,13 +1,13 @@
<?php <?php
// settingz // settingz
$sitename = "Grublox"; $sitename = "Grublox";
$version = 1.0; $version = 1.2;
$maintainers = array("Mario1", "qzip"); $maintainers = array("Mario1", "qzip");
$arraybackground = array('win7.png', 'win8.png', 'epic.png', 'yosemite.png', 'aurora.png', 'tiger.png', 'fish.png'); $arraybackground = array('win7.png', 'win8.png', 'epic.png', 'yosemite.png', 'aurora.png', 'tiger.png', 'fish.png');
$youtubefunnies = array('bitqf13QU7Q', 'Z_V6yKKIk5U', '2tHl6O5Sp8w', '-5WcDfKndxU', 'cwyTleTL06Y','Rr8XkF5TBLU'); $youtubefunnies = array('bitqf13QU7Q', 'Z_V6yKKIk5U', '2tHl6O5Sp8w', '-5WcDfKndxU', 'cwyTleTL06Y','Rr8XkF5TBLU');
try { try {
$con = new PDO("mysql:dbname=grublox;host=localhost", "root", ""); $con = new PDO("mysql:dbname=GruBlox;host=localhost", "root", "");
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
} }
catch (PDOException $e) { catch (PDOException $e) {

File diff suppressed because one or more lines are too long

166
games.php
View File

@ -1,5 +1,8 @@
<?php
session_start();
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html data-bs-theme="dark">
<head> <head>
<?php <?php
@ -16,116 +19,59 @@ $getitstarted->header();
</head> </head>
<title><?php echo $sitename; ?> | games</title> <title><?php echo $sitename; ?> | games</title>
<body> <body>
<div class="jumbotron jumbotron-fluid"> <main class="container" style="width: 100%; float: left; margin-left: 20px">
<main class="container" style="width: 100%; float: left; margin-left: 20px"> <br>
<br><br> <br>
<h4 class="text-white card-title">Popular</h4> <h4 class="text-white card-title">Popular</h4>
<div id="games-popular" class="carousel carousel-dark slide">
<div class="carousel-inner">
<div class="card-group" style=" margin-top: 15px; width: 100%;"> <div class="carousel-item active">
<div class="card-group" style=" margin-top: 15px; width: 100%;">
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;"> <?php $x = 8; for ($i = 1; $i <= $x; $i++) { ?>
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;"> <div class="card bg-dark border-start rounded shadow-sm-lg" style="max-width: 170px; margin-right: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="..."> <a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<div class="card-body"> <img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br> <div class="card-body">
<small class="card-text text-white">69 playing</small> <small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;"> <br>
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div> <small class="card-text text-muted">69 playing</small>
</div> <div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i> <div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<?php if ($i == $x) { break; } }?>
</div>
</div>
<div class="carousel-item"><div class="card-group" style=" margin-top: 15px; width: 100%;">
<?php $x = 8; for ($i = 1; $i <= $x; $i++) { ?>
<div class="card bg-dark border-start rounded shadow-sm-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small>
<br>
<small class="card-text text-muted">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<?php if ($i == $x) { break; } }?>
</div></div>
<div class="carousel-item"></div>
</div> </div>
</a> <button class="carousel-control-prev" type="button" data-bs-target="#games-popular" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true" data-bs-theme="dark"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#games-popular" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true" data-bs-theme="dark"></span>
</button>
</div> </div>
</main>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
</div>
</main>
</div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,8 @@
<?php
session_start();
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en" data-bs-theme="dark">
<head> <head>
<?php <?php
@ -12,17 +15,17 @@ $getitstarted->header();
</head> </head>
<title><?php echo $sitename; ?></title> <title><?php echo $sitename; ?></title>
<body> <body>
<div class="jumbotron jumbotron-fluid"> <div class="jumbotron jumbotron-fluid text-white">
<main class="container" style="width: 100%;"> <main class="container" style="width: 100%;">
<br><br> <br><br>
<img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=190 height=190></img> <img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=190 height=190></img>
<span class="text-white text-center" style="font-size: 2rem; margin-right: 6px;">Welcome back, <?php echo $user->getUsername(); ?></span> <span class=" text-center" style="font-size: 2rem; margin-left: 6px;">Welcome back, <?php echo $user->getUsername(); ?></span>
<div style="margin-bottom: 50px;"></div> <div style="margin-bottom: 50px;"></div>
<h4 class="text-white card-title" style="margin-bottom: 15px;">Friends (2)</h4> <h4 class=" card-title" style="margin-bottom: 15px;">Friends (2)</h4>
<div class="card bg-dark shadow-lg" style="height: 11.75rem;"> <div class="card shadow-sm-lg" style="height: 11.75rem;">
<div class="card-group" style=" margin-left: 10px; margin-top: 10px;"> <div class="card-group" style=" margin-left: 10px; margin-top: 10px;">
<div class="card bg-dark border border-0" style="max-width: 130px;"> <div class="card text-white border border-0" style="max-width: 130px;">
<a href="user?id=1" style="text-decoration: none; text-align: center; margin-bottom: 9px;"> <a href="user?id=1" style="text-decoration: none; text-align: center; margin-bottom: 9px;">
<div class="card-body"> <div class="card-body">
<img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=100 height=100></img> <img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=100 height=100></img>
@ -31,7 +34,7 @@ $getitstarted->header();
</a> </a>
</div> </div>
<div class="card bg-dark border border-0" style="max-width: 130px;"> <div class="card text-white border border-0" style="max-width: 130px;">
<a href="user?id=2" style="text-decoration: none; text-align: center; margin-bottom: 9px;"> <a href="user?id=2" style="text-decoration: none; text-align: center; margin-bottom: 9px;">
<div class="card-body"> <div class="card-body">
<img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=100 height=100></img> <img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=100 height=100></img>
@ -46,15 +49,15 @@ $getitstarted->header();
<br> <br>
<h4 class="text-white card-title">Recently played</h4> <h4 class=" card-title">Recently played</h4>
<div class="card-group" style=" margin-top: 15px;"> <div class="card-group" style=" margin-top: 15px;">
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;"> <div class="card border-start rounded shadow-sm-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;"> <a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="..."> <img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body"> <div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br> <small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small> <small class="card-text text-muted">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;"> <div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div> <div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div> </div>
@ -63,12 +66,12 @@ $getitstarted->header();
</div> </div>
</a> </a>
</div> </div>
<div class="card bg-dark rounded shadow-lg" style="max-width: 170px; margin-right: 9px;"> <div class="card border-start rounded shadow-sm-lg" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;"> <a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="..."> <img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body"> <div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br> <small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-white">69 playing</small> <small class="card-text text-muted">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;"> <div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div> <div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div> </div>

View File

@ -1,8 +1,8 @@
<?php <?php
session_start();
if(isset($_SESSION['user'])) { if(isset($_SESSION['user'])) {
header("Location: /home"); header("Location: /home");
} }
require_once 'core/classes.php'; require_once 'core/classes.php';
$getitstarted = new PartyStarter; $getitstarted = new PartyStarter;
@ -26,10 +26,19 @@ body {
} }
</style> </style>
<title><?php echo $sitename; ?></title> <title><?php echo $sitename; ?></title>
<div class="text-and-stuff"><h1><?php echo $sitename; ?></h1> <body data-bs-theme="dark">
<div class="position-absolute top-50 start-50 translate-middle col d-flex justify-content-center align-middle">
<div class="card bg-dark text-white text-center">
<div class="card-body">
<h1><?php echo $sitename; ?></h1>
<h3>the funny website with</h3> <h3>the funny website with</h3>
<a type="button" class="btn btn-dark" href="/register">Register</a> <a type="button" class="btn btn-secondary" href="/register">Register</a>
<a type="button" class="btn btn-dark" href="/login">Login</a></div> <a type="button" class="btn btn-secondary" href="/login">Login</a>
<div class="youtube-embed"><iframe width="470" height="295" <div class="youtube-embed"><iframe width="470" height="295"
src="https://www.youtube.com/embed/<?php echo $youtubevideo; ?>"> src="https://www.youtube.com/embed/<?php echo $youtubevideo; ?>">
</iframe></div> </iframe></div>
</div>
</div>
</div>
</body>

View File

@ -1,10 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<?php <?php
session_start();
if(isset($_SESSION['user'])) { if(isset($_SESSION['user'])) {
header("Location: /home"); header("Location: /home");
} }
?>
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<?php
require_once 'core/classes.php'; require_once 'core/classes.php';
require_once 'core/classes/User.php'; require_once 'core/classes/User.php';
require_once 'core/config.php'; require_once 'core/config.php';
@ -16,7 +19,6 @@ $user = new User($con, 0);
if(isset($_POST['submit'])) { if(isset($_POST['submit'])) {
$username = $_POST['username']; $username = $_POST['username'];
$password = $_POST['pass']; $password = $_POST['pass'];
$password = password_hash($password, PASSWORD_DEFAULT);
$user = new User($con, $user->getID($con, $username)); $user = new User($con, $user->getID($con, $username));
$query = $con->prepare('SELECT COUNT(*) FROM users WHERE username=:username'); $query = $con->prepare('SELECT COUNT(*) FROM users WHERE username=:username');
@ -24,46 +26,47 @@ if(isset($_POST['submit'])) {
$query->execute(); $query->execute();
$result = $query->fetchColumn(); $result = $query->fetchColumn();
if ($result > 0) { if ($result > 0) {
if ($password == $user->getPassword($con, $username)) { if (password_verify($password, $user->getPassword($con, $username))) {
$_SESSION["user"] = $user->getID($con, $username); $_SESSION["user"] = $user->getID($con, $username);
//echo $_SESSION["user"];
} else { } else {
$passwordiswrong = true; $passwordiswrong = true;
echo $password." - sex - ".$user->getPassword($con, $username); //echo $password." - sex - ".$user->getPassword($con, $username);
} }
} }
} }
$result = file_get_contents("https://useless-facts.sameerkumar.website/api"); $result = file_get_contents("https://useless-facts.sameerkumar.website/api");
$thefunfact = json_decode($result); $thefunfact = json_decode($result);
?> ?>
<link rel="stylesheet" href="css/register.css">
</head> </head>
<title><?php echo $sitename; ?> | login</title> <title><?php echo $sitename; ?> | Login</title>
<body> <body>
<form action="" method="post"> <div class="container position-absolute top-50 start-50 translate-middle">
<div class="card mb-3 bg-dark" style="max-height: 19rem;"> <div class="row align-items-center">
<h3 class="card-header bg-dark text-light">Login</h3> <div class="col-lg-6 mb-4">
</svg> <div class="card mb-3 d-flex mx-auto">
<div class="card-body bg-dark text-light"> <h3 class="card-header">Random useless fact generator</h3>
<label class="col-form-label col-form-label-sm mt-4 username text-light" for="inputSmall">Username</label> <div class="card-body">
<input class="form-control form-control-sm" type="text" placeholder="Your username" id="inputSmall" for="inputValid" name="username"> <p class="card-text"> <?php echo $thefunfact->{"data"}; ?> </p>
<label class="col-form-label col-form-label-sm mt-4 password text-light" for="inputSmall">Password</label> </div>
<input class="<?php if($passwordiswrong == true) { </div>
echo "form-control is-invalid"; </div>
} else { <div class="col-lg-6 mb-4">
echo "form-control form-control-sm"; <form action="" method="post">
} ?>" type="password" placeholder="Your password (Minmum 8 characters)" id="inputSmall" name="pass"> <div class="card mb-3 d-flex mx-auto">
<?php if($passwordiswrong == true) { <h3 class="card-header">Login</h3>
echo '<div class="invalid-feedback" bis_skin_checked="1">Password is incorrect.</div>'; </svg>
} ?> <div class="card-body">
<button type="submit" class="btn btn-secondary text-light" name="submit">Login</button><br> <label class="col-form-label col-form-label-sm mt-4 username" for="inputSmall">Username</label>
</div> <input class="form-control form-control-sm" type="text" placeholder="Your username" id="inputSmall" for="inputValid" name="username">
</div> <label class="col-form-label col-form-label-sm mt-4 password" for="inputSmall">Password</label>
</form> <input class="<?php if($passwordiswrong == true) { echo "form-control is-invalid"; } else {echo "form-control form-control-sm"; } ?>"
<div class="card text-white bg-dark mb-3" style="max-width: 20rem;"> type="password" placeholder="Your password (Minmum 8 characters)" id="inputSmall" name="pass">
<div class="card-header">Random useless fact generator</div> <?php if($passwordiswrong == true) {echo '<div class="invalid-feedback" bis_skin_checked="1">Password is incorrect.</div>'; } ?>
<div class="card-body"> <button type="submit" class="btn btn-secondary" style="margin-top: 15px; float: right;" name="submit">Login</button>
<p class="card-text"><?php echo $thefunfact->{"data"}; ?></p> </div>
</div> </div>
</div> </form>
</div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,4 @@
<?php <?php
ob_start(); //Turns on output buffering
session_start(); session_start();
unset($_SESSION["user"]); unset($_SESSION["user"]);

View File

@ -1,10 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<?php <?php
session_start();
if(isset($_SESSION['user'])) { if(isset($_SESSION['user'])) {
header("Location: /home"); header("Location: /home");
} }
?>
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<?php
require_once 'core/classes.php'; require_once 'core/classes.php';
require_once 'core/classes/User.php'; require_once 'core/classes/User.php';
require_once 'core/config.php'; require_once 'core/config.php';
@ -37,7 +40,7 @@ if(isset($_POST['submit'])) {
$passwordistooshort = false; $passwordistooshort = false;
} }
if ($passwordistooshort == false && $passwordconfirmiswrong == false) { if ($passwordistooshort == false && $passwordconfirmiswrong == false) {
$password = password_hash($password, PASSWORD_DEFAULT); $password = password_hash($password, PASSWORD_BCRYPT);
$query = $con->prepare('SELECT COUNT(*) FROM users WHERE username=:username'); $query = $con->prepare('SELECT COUNT(*) FROM users WHERE username=:username');
$query->bindParam(':username', $username); $query->bindParam(':username', $username);
$query->execute(); $query->execute();
@ -59,44 +62,34 @@ if(isset($_POST['submit'])) {
$result = file_get_contents("https://useless-facts.sameerkumar.website/api"); $result = file_get_contents("https://useless-facts.sameerkumar.website/api");
$thefunfact = json_decode($result); $thefunfact = json_decode($result);
?> ?>
<link rel="stylesheet" href="css/register.css">
</head> </head>
<title><?php echo $sitename; ?> | register</title> <title><?php echo $sitename; ?> | Register</title>
<body> <body>
<form action="" method="post"> <div class="container position-absolute top-50 start-50 translate-middle">
<div class="card mb-3 bg-dark"> <div class="row align-items-center">
<h3 class="card-header bg-dark text-light">Registration</h3> <div class="col-lg-6 mb-4">
</svg> <div class="card mb-3 d-flex mx-auto">
<div class="card-body bg-dark text-light"> <h3 class="card-header">Random useless fact generator</h3>
<label class="col-form-label col-form-label-sm mt-4 username text-light" for="inputSmall">Username</label> <div class="card-body">
<input class="<?php if($userexists == true) { <p class="card-text"> <?php echo $thefunfact->{"data"}; ?> </p>
echo "form-control is-invalid"; </div>
} else { </div>
echo "form-control form-control-sm"; </div>
} ?>" type="text" placeholder="Your username" id="inputSmall" for="inputValid" name="username"> <div class="col-lg-6 mb-4">
<?php if($userexists == true) { echo '<div class="invalid-feedback" bis_skin_checked="1">Username is already taken.</div>'; } ?> <form action="" method="post">
<label class="col-form-label col-form-label-sm mt-4 password text-light" for="inputSmall">Password</label> <div class="card mb-3 d-flex mx-auto">
<input class="<?php if($passwordconfirmiswrong == true) { <h3 class="card-header">Registration</h3>
echo "form-control is-invalid"; <div class="card-body">
} else { <label class="col-form-label col-form-label-sm mt-4 username " for="inputSmall">Username</label>
echo "form-control form-control-sm"; <input class="<?php if($userexists == true) { echo "form-control is-invalid"; } else { echo "form-control form-control-sm"; } ?>" type="text" placeholder="Your username" id="inputSmall" for="inputValid" name="username"> <?php if($userexists == true) { echo '<div class="invalid-feedback" bis_skin_checked="1">Username is already taken.</div>'; } ?>
} ?>" type="password" placeholder="Your password (Minmum 8 characters)" id="inputSmall" name="pass"> <label class="col-form-label col-form-label-sm mt-4 password " for="inputSmall">Password</label>
<?php if($passwordconfirmiswrong == true) { <input class="<?php if($passwordconfirmiswrong == true) { echo "form-control is-invalid"; } else { echo "form-control form-control-sm"; } ?>" type="password" placeholder="Your password (Minmum 8 characters)" id="inputSmall" name="pass"> <?php if($passwordconfirmiswrong == true) { echo '<div class="invalid-feedback" bis_skin_checked="1">Password Confirmation field is invalid.</div>'; } else if ($passwordistooshort == true) { echo '<div class="invalid-feedback" bis_skin_checked="1">Password is too short. (8 Characters minmum)</div>'; } ?> <label class="col-form-label col-form-label-sm mt-4 passwordconfirm" for="inputSmall">Password Confirmation</label>
echo '<div class="invalid-feedback" bis_skin_checked="1">Password Confirmation field is invalid.</div>'; <input class="form-control form-control-sm" type="password" placeholder="Enter your password again" id="inputSmall" name="passconfirm">
} else if ($passwordistooshort == true) { <button type="submit" class="btn btn-secondary " style="margin-top: 15px; float: right;" name="submit">Register</button>
echo '<div class="invalid-feedback" bis_skin_checked="1">Password is too short. (8 Characters minmum)</div>'; <br>
}?> <br>
<label class="col-form-label col-form-label-sm mt-4 passwordconfirm" for="inputSmall">Password Confirmation</label> </div>
<input class="form-control form-control-sm" type="password" placeholder="Enter your password again" id="inputSmall" name="passconfirm"> </div>
<button type="submit" class="btn btn-secondary text-light" style="margin-top: 15px; float: right;" name="submit">Register</button><br><br> </form>
</div>
</div>
</form>
<div class="card text-white bg-dark mb-3" style="max-width: 20rem;">
<div class="card-header">Random useless fact generator</div>
<div class="card-body">
<p class="card-text"><?php echo $thefunfact->{"data"}; ?></p>
</div>
</div>
</body> </body>
</html> </html>