-
Notifications
You must be signed in to change notification settings - Fork 11
/
app.php
74 lines (65 loc) · 2.34 KB
/
app.php
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
<?php
$pageTitle = 'App';
$appID = isset( $_GET[ 'appid' ] ) ? ($_GET[ 'appid' ] != '' ? $_GET[ 'appid' ] : '0' ) : '0';
include_once( 'includes/session.php' );
include_once( 'includes/functions_steam.php' );
include_once( 'includes/functions_apps.php' );
// are we supplying data via GET? → show app?
if ( $appID == '0' and ! is_numeric( $appID ) ) {
header( 'HTTP/1.0 404 Not Found' );
exit();
}
$gameProfile = getApp( $appID );
if ( $gameProfile == false ) {
header( 'HTTP/1.0 404 Not Found' );
exit();
}
$recentEvents = getRecentEventsForApp( $appID );
$gameImages = getAppImages( $appID );
$pageTitle = " – ‘{$gameProfile[ 'name' ]}’ Page";
$description = $gameProfile[ 'name' ] . ' is ' . ( $gameProfile[ 'onlinux' ] == 1 ? 'on Linux' : 'not yet on Linux' );
$extraCrap = <<<TWITCARD
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@SteamLUG">
<meta name="twitter:title" content="{$gameProfile[ 'name' ]}">
<meta name="twitter:description" content="{$description}…">
<meta name="twitter:image:src" content="{$gameImages[ 'header' ]}">
TWITCARD;
include_once( 'includes/header.php' );
$onlinux = ($gameProfile[ 'onlinux' ]) ? '<i class="fa-linux"> Yes</i>' : '<i class=""> No</i>';
echo <<<DOCUMENT
<h1 class="text-center">{$gameProfile[ 'name' ]}</h1>
<article class="panel panel-default person">
<header class="panel-heading">
<h3 class="panel-title">{$gameProfile[ 'name' ]}</h3>
</header>
<div class="panel-body">
<img class="eventimage" src="{$gameImages[ 'header' ]}" />
<dl class="dl-horizontal">
<dt>Group owners</dt><dd>{$gameProfile[ 'owners' ]}</dd>
<dt>On Linux?</dt><dd>{$onlinux}</dd>
</div>
</article>
DOCUMENT;
if ( ! empty( $recentEvents ) ) {
echo <<<HEADER
<article class="panel panel-default person">
<header class="panel-heading">
<h3 class="panel-title">Recent Events</h3>
</header>
<div class="panel-body">
HEADER;
foreach ( $recentEvents as $event ) {
echo <<<EVENT
<a href="/events/{$event['eventid']}"><time datetime="{$event['utctime']}">{$event['utctime']}</time> {$event['title']}</a>
EVENT;
}
echo <<<FOOTER
</div>
</article>
FOOTER;
}
// TODO list related clans
// TODO list related servers
// TODO Optionally? list people that love playing this at events
include_once( 'includes/footer.php' );