Ejemplo n.º 1
0
/**
 * Private function, returns SVG-formatted game plate for our thumbnail
 * @param string $string of the form: ‘000000’ (Steam appid) / ‘//example.com/image.png’ (URL)
 * @param integer $offset translate this nameplate by this value horizontally
 * @return string a rendered version of $string
 */
function _gameplate($string, $offset)
{
    $url = "";
    foreach (explode(" ", $string) as $data) {
        // appid numbers
        if (preg_match('/^([0-9]*)$/i', $data, $appidResult)) {
            $appid = $appidResult[1];
        } else {
            $url = $data;
        }
    }
    if (isset($appid)) {
        $images = getAppImages($appid);
        $url = $images['capsule_lg'];
        /* TODO check this is all good, all the time */
        $localcopy = "/avatars/apps/{$appid}.capsule_184x69.jpg";
        if (file_exists('.' . $localcopy) and !is_dir('.' . $localcopy)) {
            $url = $localcopy;
        } else {
            if (writeURLToLocation('http:' . $url, '.' . $localcopy)) {
                /* TODO verify we always get jpg files back */
                $url = $localcopy;
            }
        }
    }
    return <<<GAMEPLATE
\t\t\t\t<g transform="translate({$offset},0)">
\t\t\t\t\t<rect width="190" height="75" x="-3" y="-3" rx="6" ry="6" style="opacity:0.25;fill:#000000;filter:url(#blur)" />
\t\t\t\t\t<image xlink:href="{$url}" width="184" height="69" preserveAspectRatio="xMidYMid meet" clip-path="url(#game-clip)" />
\t\t\t\t</g>

GAMEPLATE;
}
Ejemplo n.º 2
0
$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
\t\t<meta name="twitter:card" content="summary_large_image">
\t\t<meta name="twitter:site" content="@SteamLUG">
\t\t<meta name="twitter:title" content="{$gameProfile['name']}">
\t\t<meta name="twitter:description" content="{$description}…">
\t\t<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
\t\t<h1 class="text-center">{$gameProfile['name']}</h1>
\t\t\t<article class="panel panel-default person">
Ejemplo n.º 3
0
\t\t\t</article>
ENDCLANS;
}
$recentEvents = getRecentAttendance($profile['steamid']);
$events = "";
if ($recentEvents != false) {
    $events = <<<STARTEVENTS
\t\t\t<article class="panel panel-default person">
\t\t\t\t<header class="panel-heading">
\t\t\t\t\t<h3 class="panel-title">Recent events attended…</h3>
\t\t\t\t</header>
\t\t\t\t<div class="panel-body">
\t\t\t\t\t<ol>
STARTEVENTS;
    foreach ($recentEvents as $event) {
        $app = getAppImages($event['appid']);
        $events .= '<li><a href="/event/' . $event['eventid'] . '"><img src="' . $app['capsule'] . '"/> ' . $event['title'] . "</a></li>\n";
    }
    $events .= <<<ENDEVENTS
\t\t\t\t\t</ol>
\t\t\t\t</div>
\t\t\t</article>
ENDEVENTS;
}
$lovehatesteamlug = '<a href="//steamcommunity.com/groups/steamlug">' . ($profile['isgroupmember'] ? "Loves SteamLUG!" : "Hasn’t joined SteamLUG proper") . '</a>';
$share = !array_key_exists('memberurl', $profile) || $profile['memberurl'] == '' ? '' : "<a href=\"{$profile['memberurl']}\">Share your profile</a><br>";
/*
This is WIP, no idea how we want to present it atm…
*/
echo <<<DOCUMENT
\t\t\t<article class="panel panel-default person">