my changes
This commit is contained in:
commit
eb0313b703
|
|
@ -7,7 +7,7 @@ A Bootstrap based ROBLOX revival website.
|
||||||
- [ ] User page<br>
|
- [ ] User page<br>
|
||||||
- [ ] Search (maybe)<br>
|
- [ ] Search (maybe)<br>
|
||||||
- [ ] Messaging system<br>
|
- [ ] Messaging system<br>
|
||||||
- [x] Make games page grab games from the database<br>
|
- [ ] Make games page grab games from the database<br>
|
||||||
- [ ] Make Create assets/game page<br>
|
- [ ] Make Create assets/game page<br>
|
||||||
- [x] Make Catalog page (functional)<br>
|
- [x] Make Catalog page (functional)<br>
|
||||||
- [ ] Make Credits page<br>
|
- [ ] Make Credits page<br>
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
|
|
@ -0,0 +1 @@
|
||||||
|
<?php header('location: https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png'); ?>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php header('location: https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png'); ?>
|
||||||
|
|
@ -52,7 +52,8 @@ class PartyStarter {
|
||||||
<a class="nav-link text-dark" href="/login">Login</a>
|
<a class="nav-link text-dark" href="/login">Login</a>
|
||||||
</li>';
|
</li>';
|
||||||
}
|
}
|
||||||
echo '<link rel="stylesheet" href="css/bootstrap.min.css"><link rel="stylesheet" href="/css/global.css">
|
echo '
|
||||||
|
<link rel="stylesheet" href="css/bootstrap.min.css"><link rel="stylesheet" href="/css/global.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/@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>
|
<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">
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,38 @@
|
||||||
<?php
|
<?php
|
||||||
|
error_reporting(0);
|
||||||
// settingz
|
// settingz
|
||||||
$sitename = "Grublox";
|
$sitename = "Grublox";
|
||||||
$version = 1.2;
|
|
||||||
$maintainers = array("Mario1", "qzip");
|
|
||||||
|
|
||||||
$version = 1.0;
|
$version = 1.0;
|
||||||
|
|
||||||
|
$devmode = true;
|
||||||
|
// enable this when the site should be in debug mode (like showing errors and things to fix)
|
||||||
|
|
||||||
|
if($devmode) {
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
$maintainers = array("Mario1", "qzip", "nolanwhy");
|
$maintainers = array("Mario1", "qzip", "nolanwhy");
|
||||||
|
|
||||||
$arraybackground = array('win7.png', 'win8.png', 'epic.png', 'yosemite.png', 'aurora.png', 'tiger.png', 'fish.png', 'baconbloxii.png');
|
$arraybackground = array('win7.png', 'win8.png', 'epic.png', 'yosemite.png', 'aurora.png', 'tiger.png', 'fish.png', 'baconbloxii.png');
|
||||||
|
|
||||||
$youtubefunnies = array('bitqf13QU7Q', 'Z_V6yKKIk5U', '2tHl6O5Sp8w', '-5WcDfKndxU', 'cwyTleTL06Y','Rr8XkF5TBLU');
|
$youtubefunnies = array('bitqf13QU7Q', 'Z_V6yKKIk5U', '2tHl6O5Sp8w', '-5WcDfKndxU', 'cwyTleTL06Y','Rr8XkF5TBLU');
|
||||||
|
|
||||||
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
|
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
|
||||||
$_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
|
$_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql = [
|
||||||
|
"dbname" => "GruBlox",
|
||||||
|
"host" => "localhost",
|
||||||
|
"port" => 3306,
|
||||||
|
"user" => "root",
|
||||||
|
"pass" => ""
|
||||||
|
];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$con = new PDO("mysql:dbname=GruBlox;host=localhost", "root", "");
|
$con = new PDO("mysql:dbname=".$sql["dbname"].";host=".$sql["host"].";port=".$sql["port"], $sql["user"], $sql["pass"]);
|
||||||
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
|
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
|
||||||
|
unset($sql);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
echo "Connection failed: " . $e->getMessage();
|
die("Connection failed: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
33
error.php
33
error.php
|
|
@ -7,20 +7,26 @@ if(isset($_SESSION['user'])) {
|
||||||
$user = new User($con, $_SESSION['user']);
|
$user = new User($con, $_SESSION['user']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// some shitty code by nolanwhy
|
// qzip code (from now on im putting my name fuck you all ( i made catalog and games and home now shut)
|
||||||
// yes i coded all of this inside github editor
|
|
||||||
if(!isset($_GET["id"])) {
|
if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
header("Location: ?id=".$_SESSION['user']);
|
$conType = $_POST['err'];
|
||||||
} else {
|
} else {
|
||||||
$id = (int)$_GET["id"];
|
$conType = $_GET['err'];
|
||||||
}
|
}
|
||||||
$q = $con->prepare("SELECT * FROM users WHERE id = :id");
|
if($conType == 404) {
|
||||||
$q->bindParam(':id',$id,PDO::PARAM_INT);
|
$errorImage = "";
|
||||||
$q->execute();
|
$errorTextMain = "404 Not found";
|
||||||
$requestUser = $q->fetch();
|
$errorTextExtra = "Whoops! Our minions couldn't find the page you were looking for...";
|
||||||
if(!$requestUser) {
|
$errorButton = "<a class='btn btn-primary' href='javascript:history.back()'><h5>Go back to ".$sitename." HQ</h5></a>";
|
||||||
die("go fuck yourself (can't find user)"); // todo: redirect to 404
|
|
||||||
}
|
}
|
||||||
|
if($conType == 403) {
|
||||||
|
$errorImage = "";
|
||||||
|
$errorTextMain = "403 Forbidden";
|
||||||
|
$errorTextExtra = "Get out of here! Confidential data..";
|
||||||
|
$errorButton = "<a class='btn btn-primary' href='javascript:history.back()'><h5>Go back to ".$sitename." HQ</h5></a>";
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html data-bs-theme="dark">
|
<html data-bs-theme="dark">
|
||||||
|
|
@ -33,7 +39,10 @@ $getitstarted->header();
|
||||||
<title><?php echo $sitename; ?> | <?php echo htmlspecialchars($requestUser["username"]); ?></title>
|
<title><?php echo $sitename; ?> | <?php echo htmlspecialchars($requestUser["username"]); ?></title>
|
||||||
<body>
|
<body>
|
||||||
<main class="container mx-auto position-absolute top-50 start-50 translate-middle text-center" style="width: 100%;">
|
<main class="container mx-auto position-absolute top-50 start-50 translate-middle text-center" style="width: 100%;">
|
||||||
dssda
|
<?php echo $errorImage; ?>
|
||||||
|
<h1><?php echo $errorTextMain; ?></h1>
|
||||||
|
<h5 class="text-muted"><?php echo $errorTextExtra; ?></h5>
|
||||||
|
<?php echo $errorButton; ?>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
92
games.php
92
games.php
|
|
@ -27,14 +27,25 @@ $getitstarted->header();
|
||||||
<div class="carousel-inner">
|
<div class="carousel-inner">
|
||||||
<div class="carousel-item active">
|
<div class="carousel-item active">
|
||||||
<div class="card-group" style=" margin-top: 15px; width: 100%;">
|
<div class="card-group" style=" margin-top: 15px; width: 100%;">
|
||||||
<?php $x = 8; for ($i = 1; $i <= $x; $i++) { ?>
|
<?php
|
||||||
|
$sql = "SELECT allStar FROM games";
|
||||||
|
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
|
||||||
|
$q->execute();
|
||||||
|
$numberOfGames = $q->fetchColumn();
|
||||||
|
$q = $con->prepare(str_replace('allStar', '*', $sql));
|
||||||
|
$q->execute();
|
||||||
|
if ($numberOfGames >= 1) {
|
||||||
|
while ($game = $q->fetch()) {
|
||||||
|
$playingCount = 69;
|
||||||
|
$x = 8;
|
||||||
|
for ($i = 1; $i <= $x; $i++) { ?>
|
||||||
<div class="card bg-dark border-start rounded shadow-sm" style="max-width: 170px; margin-right: 9px;">
|
<div class="card bg-dark border-start rounded shadow-sm" 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=<?php echo (int)htmlspecialchars($game["id"]); ?>" 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="<?php echo htmlspecialchars($game["thumbnail"]); ?>" class="card-img-top rounded-top<?php if(empty($game["thumbnail"])){echo " placeholder";} ?>" alt="<?php echo htmlspecialchars($game["name"]); ?>">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small>
|
<small class="card-title text-white" style="font-size: 1rem;"><?php echo htmlspecialchars($game["name"]); ?></small>
|
||||||
<br>
|
<br>
|
||||||
<small class="card-text text-muted">69 playing</small>
|
<small class="card-text text-muted"><?php echo (int)$playingCount; ?> 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>
|
||||||
|
|
@ -42,26 +53,17 @@ $getitstarted->header();
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($i == $x) { break; } }?>
|
<?php
|
||||||
|
if ($i == $x) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "no games";} ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item"><div class="card-group" style=" margin-top: 15px; width: 100%;">
|
<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" 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></div>
|
||||||
<div class="carousel-item"></div>
|
<div class="carousel-item"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -79,14 +81,25 @@ $getitstarted->header();
|
||||||
<div class="carousel-inner">
|
<div class="carousel-inner">
|
||||||
<div class="carousel-item active">
|
<div class="carousel-item active">
|
||||||
<div class="card-group" style=" margin-top: 15px; width: 100%;">
|
<div class="card-group" style=" margin-top: 15px; width: 100%;">
|
||||||
<?php $x = 8; for ($i = 1; $i <= $x; $i++) { ?>
|
<?php
|
||||||
|
$sql = "SELECT allStar FROM games";
|
||||||
|
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
|
||||||
|
$q->execute();
|
||||||
|
$numberOfGames = $q->fetchColumn();
|
||||||
|
$q = $con->prepare(str_replace('allStar', '*', $sql));
|
||||||
|
$q->execute();
|
||||||
|
if ($numberOfGames >= 1) {
|
||||||
|
while ($game = $q->fetch()) {
|
||||||
|
$playingCount = 69;
|
||||||
|
$x = 8;
|
||||||
|
for ($i = 1; $i <= $x; $i++) { ?>
|
||||||
<div class="card bg-dark border-start rounded shadow-sm" style="max-width: 170px; margin-right: 9px;">
|
<div class="card bg-dark border-start rounded shadow-sm" 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=<?php echo (int)htmlspecialchars($game["id"]); ?>" 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="<?php echo htmlspecialchars($game["thumbnail"]); ?>" class="card-img-top rounded-top<?php if(empty($game["thumbnail"])){echo " placeholder";} ?>" alt="<?php echo htmlspecialchars($game["name"]); ?>">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small>
|
<small class="card-title text-white" style="font-size: 1rem;"><?php echo htmlspecialchars($game["name"]); ?></small>
|
||||||
<br>
|
<br>
|
||||||
<small class="card-text text-muted">69 playing</small>
|
<small class="card-text text-muted"><?php echo (int)$playingCount; ?> 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>
|
||||||
|
|
@ -94,26 +107,17 @@ $getitstarted->header();
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($i == $x) { break; } }?>
|
<?php
|
||||||
|
if ($i == $x) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "no games";} ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="carousel-item"><div class="card-group" style=" margin-top: 15px; width: 100%;">
|
<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" 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></div>
|
||||||
<div class="carousel-item"></div>
|
<div class="carousel-item"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
52
grublox.sql
52
grublox.sql
|
|
@ -1,28 +1,38 @@
|
||||||
|
-- nolanwhy
|
||||||
-- phpMyAdmin SQL Dump
|
-- phpMyAdmin SQL Dump
|
||||||
-- version 5.2.0
|
-- version 5.2.0
|
||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Host: 127.0.0.1
|
-- Host: 127.0.0.1
|
||||||
-- Generation Time: Jan 24, 2023 at 08:45 PM
|
-- Generation Time: Feb 04, 2023 at 10:58 PM
|
||||||
-- Server version: 10.4.24-MariaDB
|
-- Server version: 10.4.27-MariaDB
|
||||||
-- PHP Version: 7.4.29
|
-- PHP Version: 8.0.25
|
||||||
|
|
||||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
SET time_zone = "+00:00";
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
||||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
||||||
/*!40101 SET NAMES utf8mb4 */;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Database: `grublox`
|
-- Database: `grublox`
|
||||||
--
|
--
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `games`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `games` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`name` varchar(50) NOT NULL,
|
||||||
|
`description` varchar(255) NOT NULL,
|
||||||
|
`creator` int(11) NOT NULL,
|
||||||
|
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||||
|
`updateddate` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `users`
|
-- Table structure for table `users`
|
||||||
--
|
--
|
||||||
|
|
@ -30,17 +40,23 @@ SET time_zone = "+00:00";
|
||||||
CREATE TABLE `users` (
|
CREATE TABLE `users` (
|
||||||
`id` int(11) NOT NULL,
|
`id` int(11) NOT NULL,
|
||||||
`username` varchar(20) NOT NULL,
|
`username` varchar(20) NOT NULL,
|
||||||
`password` varchar(500) NOT NULL,
|
`password` varchar(450) NOT NULL,
|
||||||
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||||
`token` varchar(25) DEFAULT NULL COMMENT 'Token for joining. Useful to secure joining to prevent unauthorized users to use other names.',
|
`token` varchar(25) DEFAULT NULL COMMENT 'Token for joining. Useful to secure joining to prevent unauthorized users to use other names.',
|
||||||
`description` varchar(250) DEFAULT NULL,
|
`description` varchar(250) DEFAULT NULL,
|
||||||
`money` int(11) NOT NULL DEFAULT 0
|
`money` int(11) NOT NULL DEFAULT 0
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Indexes for dumped tables
|
-- Indexes for dumped tables
|
||||||
--
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indexes for table `games`
|
||||||
|
--
|
||||||
|
ALTER TABLE `games`
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Indexes for table `users`
|
-- Indexes for table `users`
|
||||||
--
|
--
|
||||||
|
|
@ -51,13 +67,15 @@ ALTER TABLE `users`
|
||||||
-- AUTO_INCREMENT for dumped tables
|
-- AUTO_INCREMENT for dumped tables
|
||||||
--
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT for table `games`
|
||||||
|
--
|
||||||
|
ALTER TABLE `games`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- AUTO_INCREMENT for table `users`
|
-- AUTO_INCREMENT for table `users`
|
||||||
--
|
--
|
||||||
ALTER TABLE `users`
|
ALTER TABLE `users`
|
||||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
||||||
30
home.php
30
home.php
|
|
@ -39,30 +39,30 @@ $getitstarted->header();
|
||||||
<body>
|
<body>
|
||||||
<main class="container text-white" style="width: 100%;">
|
<main class="container text-white" 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="assets/renders/user/headshot?userId=<?php echo (int)htmlspecialchars($user->getID($con, $user->getUsername())); ?>" class="rounded-circle" width=190 height=190></img>
|
||||||
<span class=" text-center" style="font-size: 2rem; margin-left: 6px;"><?php echo $himsg; ?>, <?php echo $user->getUsername(); ?>!</span>
|
<span class="text-center" style="font-size: 2rem; margin-left: 6px;"><?php echo $himsg; ?>, <?php echo htmlspecialchars($user->getUsername()); ?>!</span>
|
||||||
<div style="margin-bottom: 50px;"></div>
|
<div style="margin-bottom: 50px;"></div>
|
||||||
<h4 class=" card-title" style="margin-bottom: 15px;">Friends (2)</h4>
|
<h4 class=" card-title" style="margin-bottom: 15px;">Friends (2)</h4>
|
||||||
<div class="card shadow-sm" style="height: 11.75rem;">
|
<div class="card shadow-sm" 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;">
|
||||||
|
<?php
|
||||||
|
$sql = "SELECT allStar FROM users";
|
||||||
|
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
|
||||||
|
$q->execute();
|
||||||
|
$numberOfGames = $q->fetchColumn();
|
||||||
|
$q = $con->prepare(str_replace('allStar', '*', $sql));
|
||||||
|
$q->execute();
|
||||||
|
if ($numberOfGames >= 1) {
|
||||||
|
while ($usr = $q->fetch()) { ?>
|
||||||
<div class="card text-white 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=<?php echo (int)htmlspecialchars($usr["id"]); ?>" 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="assets/renders/user/headshot?userId=<?php echo (int)htmlspecialchars($usr["id"]); ?>" class="rounded-circle" width=100 height=100 alt="<?php echo htmlspecialchars($usr["username"]); ?>"></img>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-center text-white">guy</small>
|
<small class="text-center text-white"><?php echo htmlspecialchars($usr["username"]); ?></small>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<?php }} ?>
|
||||||
<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;">
|
|
||||||
<div class="card-body">
|
|
||||||
<img src="https://tr.rbxcdn.com/4039b106ee8e92c8c73595ffaa35108d/150/150/AvatarHeadshot/Png" class="rounded-circle" width=100 height=100></img>
|
|
||||||
</div>
|
|
||||||
<small class="text-center text-white">Buildersdasas</small>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
11
register.php
11
register.php
|
|
@ -3,11 +3,7 @@ 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';
|
||||||
|
|
@ -59,6 +55,11 @@ if(isset($_POST['submit'])) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" data-bs-theme="dark">
|
||||||
|
<head>
|
||||||
|
<?php
|
||||||
$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);
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
16
user.php
16
user.php
|
|
@ -35,5 +35,21 @@ $getitstarted->header();
|
||||||
<main class="container" style="width: 100%;">
|
<main class="container" style="width: 100%;">
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
<main class="container text-white" style="width: 100%;">
|
||||||
|
<div class="card shadow-sm" style="height: 11.75rem;">
|
||||||
|
<div class="card-group" style=" margin-left: 10px; margin-top: 10px;">
|
||||||
|
<!-- start card -->
|
||||||
|
<div class="card text-white border border-0" style="max-width: 130px;">
|
||||||
|
<a style="text-decoration: none; text-align: center; margin-bottom: 9px;">
|
||||||
|
<div class="card-body">
|
||||||
|
<img src="assets/renders/user/headshot?userId=<?php echo (int)htmlspecialchars($requestUser["id"]); ?>" class="rounded-circle" width=100 height=100></img>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div><!-- end card -->
|
||||||
|
<h1><?php echo htmlspecialchars($requestUser["username"]); ?></h1>
|
||||||
|
<h3 class="text-muted">"i love sex grublox"</h3>
|
||||||
|
<!-- yes i tried making it -->
|
||||||
|
</div></div>
|
||||||
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue