1
difenduandada
2024-10-15 7fd2948ee35c8e147ed35ce6d8502f94a98ddd22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
 
//New window page for gameplay
 
require_once( TEMPLATE_PATH . '/functions.php' );
 
if ( !isset($_GET['slug']) || !$_GET['slug'] ) {
    require( ABSPATH . 'includes/page-404.php' );
    return;
}
 
$_GET['slug'] = htmlspecialchars($_GET['slug']);
 
$game = Game::getBySlug( $_GET['slug'] );
if($game){
    if($game->source == 'self' && get_setting_value('splash')){
        require( ABSPATH . 'includes/page-splash.php' );
        return;
    }
    $page_title = $game->title;
    $meta_description = str_replace(array('"', "'"), "", strip_tags($game->description));
 
    ?>
 
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title><?php echo $page_title ?></title>
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta name="description" content="<?php echo $meta_description ?>">
        <meta name="robots" content="noindex">
        <style type="text/css">
            body {
                color: #eee;
                line-height: 1.43;
                position: inherit;
                margin: 0;
                padding: 0;
                background-color: #000;
                overflow: hidden;
                height: 100%;
            }
            #game-content {
                position: absolute;
                top: 0;
                left: 0;
                width: 0;
                height: 0;
                overflow: hidden;
                max-width: 100%;
                max-height: 100%;
                min-width: 100%;
                min-height: 100%;
                box-sizing: border-box;
            }
        </style>
    </head>
    <body>
        <?php
        $url = esc_url($game->url);
        if($game->source == 'gamedistribution'){
            //GameDistributon new url
            $url .= '?gd_sdk_referrer_url='.get_permalink('full', $game->slug);
        }
        ?>
        <iframe id="game-content" frameborder="0" allow="autoplay" allowfullscreen="" seamless="" scrolling="no" src="<?php echo $url ?>"></iframe>
    </body>
    </html>
 
    <?php
} else {
    require( ABSPATH . 'includes/page-404.php' );
}
 
?>