so true
This commit is contained in:
parent
e6c135a37f
commit
c2c4dec275
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
ob_start();
|
||||
error_reporting(0);
|
||||
ini_set('extension', 'soap');
|
||||
// settingz
|
||||
|
||||
//daily pay aka mone
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ $q->bindParam(':description',$_POST['description']);
|
|||
$q->bindParam(':playerlimit',$_POST['playerlimit']);
|
||||
$q->bindParam(':creator',$_SESSION['user'],PDO::PARAM_INT);
|
||||
$q->execute();
|
||||
|
||||
header("Location: /games?uploaded=true);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,14 @@ session_start();
|
|||
if($maintenance && $pagename !== "Maintenance") {
|
||||
header("Location: /maintenance"
|
||||
); }
|
||||
if($loggedIn) {
|
||||
if (isset($_GET['client']) && $_GET['client'] == 2016 && $_GET['type'] == "player") {
|
||||
die(header("Location: /downloads/player-2016.zip"));
|
||||
}
|
||||
if (isset($_GET['client']) && $_GET['client'] == 2016 && $_GET['type'] == "studio") {
|
||||
die(header("Location: /downloads/studio-2016.zip"));
|
||||
}
|
||||
} else {
|
||||
die("Corrupted."); // be as vague as possible.
|
||||
exit;
|
||||
}
|
||||
|
|
@ -24,17 +24,6 @@ $loggedIn = false;
|
|||
$getitstarted = new PartyStarter;
|
||||
$getitstarted->header();
|
||||
|
||||
if($loggedIn == true) {
|
||||
if($_POST['submit'] ?? "No" == "Update place" || isset($_FILES['userfile']['name']) || isset($_POST['name']) || isset($_POST['description']) || isset($_POST['playerlimit']) && $_POST['playerlimit'] >= 1 ) {
|
||||
$q = $con->prepare("UPDATE FROM games (name, description, creator, players, state, thumbnail) VALUES (:name, :description, :playerlimit, :creator, 'pending', 'empty')");
|
||||
$q->bindParam(':name',$_POST['name']);
|
||||
$q->bindParam(':description',$_POST['description']);
|
||||
$q->bindParam(':playerlimit',$_POST['playerlimit']);
|
||||
$q->bindParam(':creator',$_SESSION['user'],PDO::PARAM_INT);
|
||||
$q->execute();
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($_GET["id"])) {
|
||||
header("Location: ?id=".$_SESSION['user']);
|
||||
} else {
|
||||
|
|
@ -51,6 +40,26 @@ if(!$item) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if($item['creator'] !== $_SESSION['user']) {
|
||||
header('location: /error?err=403');
|
||||
exit;
|
||||
}
|
||||
|
||||
if($loggedIn == true) {
|
||||
if($_POST['submit'] ?? "No" == "Update place" || isset($_FILES['userfile']['name']) || isset($_POST['name']) || isset($_POST['description']) || isset($_POST['playerlimit']) && $_POST['playerlimit'] >= 1 ) {
|
||||
$q = $con->prepare("UPDATE games SET name=:name, description=:description, creator=:creator, players=:playerlimit, state='pending' WHERE id=:placeid");
|
||||
$q->bindParam(':name',$_POST['name']);
|
||||
$q->bindParam(':description',$_POST['description']);
|
||||
$q->bindParam(':playerlimit',$_POST['playerlimit']);
|
||||
$q->bindParam(':creator',$_SESSION['user'],PDO::PARAM_INT);
|
||||
$q->bindParam(':placeid',$_GET['id'],PDO::PARAM_INT);
|
||||
$q->execute();
|
||||
header("Location: /place?id=".$_GET['id']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</head>
|
||||
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||
|
|
|
|||
|
|
@ -78,7 +78,11 @@ $random_search = array_rand($random_search_array, 1);
|
|||
if ($numberOfGames >= 1) {
|
||||
$rows = array_slice($q->fetchAll(), $offset, $limit);
|
||||
foreach($rows as $game) {
|
||||
$playingCount = 69;
|
||||
$sql = "SELECT allStar FROM games WHERE id=:id";
|
||||
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
|
||||
$q->bindParam(':id',$game["id"],PDO::PARAM_INT);
|
||||
$q->execute();
|
||||
$playingCount = 0;
|
||||
?>
|
||||
<div class="col">
|
||||
<div class="card bg-dark border-start rounded shadow-sm" style="min-width: 140px; max-width: 220px; margin-right: 9px;">
|
||||
|
|
|
|||
4
home.php
4
home.php
|
|
@ -52,7 +52,7 @@ $getitstarted->header();
|
|||
<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 class="d-flex flex-row justify-content-between mb-3">
|
||||
<h4 class=" card-title">Friends (<?php $q=$con->prepare("SELECT count(*) FROM users");$q->execute(); $numberOfFriends = $q->fetchColumn(); echo $numberOfFriends; ?>)</h4>
|
||||
<h4 class=" card-title">Friends (<?php $q=$con->prepare("SELECT count(*) FROM friends WHERE user=:id AND state='approved'"); $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); $q->execute(); $numberOfFriends = $q->fetchColumn(); echo $numberOfFriends; ?>)</h4>
|
||||
<a href="/friends" class="btn btn-link text-decoration-none align-self-end">See all <i class="bi bi-caret-right"></i></a>
|
||||
</div>
|
||||
<div class="card shadow-sm" style="height: 11.75rem;">
|
||||
|
|
@ -72,7 +72,7 @@ $getitstarted->header();
|
|||
</div>
|
||||
<?php }
|
||||
} else {
|
||||
echo "u have no friend wtf noob";
|
||||
echo "</div> <h4 class='text-muted text-center mb-4'><i class='bi bi-egg-fried' style='font-size: 6rem;'></i><br> You have no friends.</h4>";
|
||||
} ?>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,12 @@ $getitstarted->header();
|
|||
<br><br>
|
||||
|
||||
<div class="card shadow-sm w-100">
|
||||
<div class="card-header"> <h3 class="float-start"><?php echo htmlspecialchars($item["name"]); ?> </h3> <a class="float-end btn btn-info bi bi-pencil-square" href="/edit_place?id=<?php echo htmlspecialchars($item['id']); ?>"></a></div>
|
||||
<div class="card-header"> <h3 class="float-start"><?php echo htmlspecialchars($item["name"]); ?> </h3>
|
||||
<?php
|
||||
if($item['creator'] == $_SESSION['user']) {?>
|
||||
<a class="float-end btn btn-info bi bi-pencil-square" href="/edit_place?id=<?php echo htmlspecialchars($item['id']); ?>"></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="card-body mx-md-auto mx-xl-0">
|
||||
<div class="row g-2">
|
||||
<div class="col-md-6 h-100 align-self-center d-block text-center">
|
||||
|
|
|
|||
Loading…
Reference in New Issue