<?php
global $zon, $site_url, $socket;
$gd = [];
if ($zon['page'][0] == 'single') {
$gd = getGamesById($zon['page'][1]);
}
if ($zon['page'][0] == 'game' && (count($zon['page']) == 3 || count($zon['page']) == 4)) {
$gd = getGamesById($zon['page'][2]);
}
$game_url = $site_url . 'game/' . makeSlug($gd['game_name']) . '/' . $gd['id'];
add_views($gd['id']);
if (isset($_POST) && !empty($_POST)) {
if (isset($_POST['comment'])) {
$subject = htmlspecialchars(mysqli_real_escape_string($socket, $_POST['subject']));
$date = date('D, d M Y');
$user_id = $zon['user']['id'];
$game_id = $gd['id'];
$sql = "INSERT INTO zon_comments (user_id, game_id, subject, date) VALUES ($user_id, $game_id, '$subject', '$date')";
if (mysqli_query($socket, $sql)) {
redirect('');
}
}
}
if (isset($_POST) && !empty($_POST)) {
if (isset($_POST['problem']) && !empty($_POST['problem'])) {
$game_name = $gd['game_name'];
$report_sub = mysqli_real_escape_string($socket, htmlspecialchars($_POST['problem']));
$game_id = $gd['id'];
if (mysqli_query($socket, "INSERT INTO " . T_ZON_REPORTS . " (game_name, report_subject, game_id) VALUES ('$game_name', '$report_sub', $game_id) ")) {
echo "<script>window.location.href = ''</script>";
}
}
}
?>
<div class="layout-section">
<div class="container-fluid">
<div class="row">
<div class="col-lg-auto d-none d-xxl-block">
<div class="w-lg-300">
<?php if (getAdById(4, 'status') == 0) { ?>
<div class="mb-3">
<?php echo getAdById(4, 'code') ?>
</div>
<?php } ?>
<div class="card-masonry">
<?php foreach (GameByCategoryWise($gd['game_category'], '14') as $game) { ?>
<a href="<?= $site_url . 'game/' . makeSlug($game['game_name']) . '/' . $game['id'] ?>"
class="card wow <?php echo $zon['config']['animate_class'] ?>">
<picture>
<source data-srcset="<?= $game['game_image_url'] ?>" type="image/webp" class="img-fluid"
srcset="<?= $game['game_image_url'] ?>">
<source data-srcset="<?= $game['game_image_url'] ?>" type="image/png" class="img-fluid"
srcset="<?= $game['game_image_url'] ?>">
<img data-src="<?= $game['game_image_url'] ?>" alt="Fidget Spinner Creator"
class="lazyload img-fluid" width="500" height="500">
</picture>
<div class="card-body">
<h3><?= $game['game_name'] ?></h3>
</div>
</a>
<?php } ?>
</div>
</div>
</div>
<div class="col-lg">
<div class="ratio ratio-16x9 overflow-hidden rounded-3 mb-4 game-ratio">
<iframe class="game-iframe lazyload" src="<?= $gd['game_url'] ?>" id="zonFrame" width="480"
height="320" scrolling="none" frameborder="0" allowfullscreen></iframe>
</div>
<div class="px-lg-3">
<div class="row">
<div class="col-lg">
<div class="mb-3">
<div class="card-category">
<a
href="<?= $site_url ?>category/?n=<?= $gd['game_category'] ?>"><?= $gd['game_category'] ?></a>
</div>
<h1 class="h4"><?= $gd['game_name'] ?></h1>
</div>
</div>
<div class="col-lg-auto text-xl-end">
<div class="w-lg-300">
<div class="mb-2 d-flex align-items-center justify-content-lg-end flex-nowrap">
<div class="dropdown mx-1 py-1" data-bs-tooltip="tooltip" data-bs-placement="top"
title data-bs-original-title="Fullscreen">
<button
class="btn btn-square btn-fullscreen btn-ghost rounded-circle dropdown-toggle">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 24 24">
<path fill="#fff"
d="M10 4H8v4H4v2h6zM8 20h2v-6H4v2h4zm12-6h-6v6h2v-4h4zm0-6h-4V4h-2v6h6z">
</path>
</svg>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="pb-2">
<h3 class="fs-sm fw-semibold mb-2">
Description </h3>
<p class="text-muted fs-sm" data-more data-limit="6"><?= $gd['game_description'] ?></p>
</div>
<div class="card-tags">
<?php foreach (getCategories(0) as $category) { ?>
<a href="<?= $site_url . 'category/?n=' . urlencode($category['name']) ?>"
class="rounded-pill"><?= $category['name'] ?></a>
<?php } ?>
</div>
<?php if (getAdById(2, 'status') == 0) { ?>
<div class="mx-auto py-3 px-2">
<?php echo getAdById(2, 'code') ?>
</div>
<?php } ?>
</div>
</div>
<div class="col-lg-auto">
<div class="w-lg-300">
<?php if (getAdById(5, 'status') == 0) { ?>
<div class="mb-3">
<?php echo getAdById(5, 'code') ?>
</div>
<?php } ?>
<div class="card-masonry">
<?php foreach (GameByCategoryWise($gd['game_category'], '14, 14') as $game) { ?>
<a href="<?= $site_url . 'game/' . makeSlug($game['game_name']) . '/' . $game['id'] ?>"
class="card wow <?php echo $zon['config']['animate_class'] ?>">
<picture>
<source data-srcset="<?= $game['game_image_url'] ?>" type="image/webp" class="img-fluid"
srcset="<?= $game['game_image_url'] ?>">
<source data-srcset="<?= $game['game_image_url'] ?>" type="image/png" class="img-fluid"
srcset="<?= $game['game_image_url'] ?>">
<img data-src="<?= $game['game_image_url'] ?>" alt="Fidget Spinner Creator"
class="lazyload img-fluid" width="500" height="500">
</picture>
<div class="card-body">
<h3><?= $game['game_name'] ?></h3>
</div>
</a>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php if (getAdById(3, 'status') == 0) { ?>
<div class="mx-auto py-3 px-2">
<?php echo getAdById(3, 'code') ?>
</div>
<?php } ?>
<div class="layout-section">
<div class="container-fluid">
<div class="layout-heading mb-3">
<h3 class="fs-lg fw-bold">You may also like</h3>
</div>
<div class="card-masonry">
<?php foreach (NewestGames(33) as $game) { ?>
<a href="<?= $site_url . 'game/' . makeSlug($game['game_name']) . '/' . $game['id'] ?>"
class="card wow <?php echo $zon['config']['animate_class'] ?> <?= isFeaturedGame($game['id']) ? 'large' : '' ?>">
<picture>
<source data-srcset="<?= $game['game_image_url'] ?>" type="image/webp" class="img-fluid"
srcset="<?= $game['game_image_url'] ?>">
<source data-srcset="<?= $game['game_image_url'] ?>" type="image/png" class="img-fluid"
srcset="<?= $game['game_image_url'] ?>">
<img data-src="<?= $game['game_image_url'] ?>" alt="Fidget Spinner Creator"
class="lazyload img-fluid" width="500" height="500">
</picture>
<div class="card-body">
<h3><?= $game['game_name'] ?></h3>
</div>
</a>
<?php } ?>
</div>
</div>
</div>
<script>
var game_frame = document.getElementById("zonFrame");
var game_frame_src = game_frame.src;
if (game_frame_src.includes("gamedistribution")) {
game_frame.src += "?gd_sdk_referrer_url=https://gamedistribution.com/games/cooking-festival";
}
</script>