Пример #1
0
$pageTitle = "Live Stream";
// because we hate cache
header("Cache-Control: no-cache, must-revalidate");
// HTTP 1.0ld header("Pragma: no-cache");
include_once 'includes/header.php';
include_once 'includes/functions_events.php';
include_once 'includes/functions_geturl.php';
include_once 'includes/functions_mumble.php';
$murmur = getMumble();
$maxUsers = $murmur->get_status()['original']['x_gtmurmur_max_users'];
$mumbleHeader = ": Offline";
if ($murmur->is_online()) {
    $mumbleHeader = ': Online, ' . count($murmur->get_users()) . ' ⁄ ' . $maxUsers;
}
$data = getNextEvent(false);
$someoneStreaming = false;
$twitchOnline = false;
$hitboxOnline = false;
$streamers = "";
$streamers = '<div class="row">';
/* Twitch */
$maybeOnline = geturl('https://api.twitch.tv/kraken/streams/steamlug', array(), array('Accept: application/vnd.twitchtv.v3.json'));
$twitchStream = json_decode($maybeOnline, true);
if ($twitchStream['stream'] != null) {
    $someoneStreaming = true;
    $twitchOnline = true;
} else {
    // if Twitch is offline, maybe we can pull the channel following
    $twitchUsers = geturl('https://api.twitch.tv/kraken/users/steamlug/follows/channels', array(), array('Accept: application/vnd.twitchtv.v3.json'));
    $twitchStreamers = @json_decode($twitchUsers, true);
Пример #2
0
    $me = $_SESSION['u'];
}
// are we admin? no → leave
if (in_array($me, getAdmins())) {
} else {
    header("Location: /");
    exit;
}
include_once 'includes/functions_events.php';
include_once 'includes/functions_cast.php';
include_once 'includes/functions_twitter.php';
$action = "Failure";
$body = "";
$style = " panel-success";
$nextGameEvent = getNextEvent(false, 3600);
$nextCastEvent = getNextEvent(true, 3600);
$latestCast = getLatestCast();
$recentTweets = getRecentTweets();
// are we supplying tweet, message via POST? → send tweet
if (isset($_POST['tweet']) and isset($_POST['message'])) {
    $action = "Post Tweet";
    // set $body to a success or fail message
    $reply = postTweet($_POST['message']);
    // test reply here…
    if (array_key_exists('errors', $reply)) {
        $style = "panel-danger";
        // TODO, do additional checks in the future. Ask admins to copy/paste the error
        $body = 'Error code ' . $reply['errors'][0]['code'] . ', with message: ' . $reply['errors'][0]['message'] . '<br>';
        $body .= print_r($reply, true);
        $body .= "<br>Please copy/paste the above error, put it in a gist and share with webmaster.";
    } else {
Пример #3
0
<?php

$pageTitle = "Events";
include_once 'includes/functions_events.php';
$data = getRecentEvents();
if ($eventID == "0") {
    $event = getNextEvent(false, 3600);
    if ($event != null) {
        $eTime = $event['utctime'];
    }
} else {
    $event = findEvent($eventID);
    if ($event != null) {
        $eTime = $event['utctime'];
    }
}
if (isset($eTime)) {
    $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="{$event['title']}">
\t\t<meta name="twitter:description" content="Join our community playing ‘{$event['title']}’ at {$event['time']} UTC. Everyone is welcome!&lt;br&gt;{$event['url']}">
\t\t<meta name="twitter:image:src" content="https:{$event['img_header']}">

TWITCARD;
    $extraJS = "\t\t\tvar target = new Date(" . $eTime . ");";
    $tailJS = array('/scripts/events.js');
}
include_once 'includes/header.php';
?>
		<h1 class="text-center">SteamLUG Events</h1>
Пример #4
0
<?php

include_once 'includes/functions_cast.php';
include_once 'includes/functions_events.php';
include_once 'includes/functions_avatars.php';
include_once 'includes/functions_stats.php';
$cast = getNextEvent(true);
if ($cast != null) {
    $eTime = $cast['utctime'];
    $dt = $cast['date'] . " " . $cast['time'] . " " . $cast['tz'];
    $u = $cast['url'];
    if (preg_match("#.*S([0-9]+)E([0-9]+).*#", $cast["title"], $matches) == 1) {
        $c = 'e' . str_pad($matches[2], 2, '0', STR_PAD_LEFT);
        $s = 's' . str_pad($matches[1], 2, '0', STR_PAD_LEFT);
    } else {
        unset($eTime);
    }
}
if (isset($eTime)) {
    $extraJS = "\t\t\tvar target = new Date(" . $eTime . ");";
}
$castList = true;
$tailJS = array('/scripts/events.js', '/scripts/jquery.tablesorter.min.js');
$pageTitle = "Cast";
$rssLinks = '<link rel="alternate" type="application/rss+xml" title="SteamLUG Cast (mp3) Feed" href="https://steamlug.org/feed/cast/mp3" /><link rel="alternate" type="application/rss+xml" title="SteamLUG Cast (Ogg) Feed" href="https://steamlug.org/feed/cast/ogg" />';
function slenc($u)
{
    return htmlentities($u, ENT_NOQUOTES, "UTF-8");
}
function nameplate($string, $size = 32)
{
Пример #5
0
if (Session::isLoggedIn() && (Session::getUser()->hasPriv('SUPERUSER') || Session::getUser()->getData('organization') == $organizer['id'])) {
    $sql = 'SELECT u.id, u.username, u.lastLogin FROM users u WHERE u.organization = :organizer';
    $stmt = $db->prepare($sql);
    $stmt->bindValue(':organizer', $organizer['id']);
    $stmt->execute();
    $tpl->assign('associatedUsers', $stmt->fetchAll());
    $sql = 'SELECT v.id, v.title, count(e.id) AS eventCount FROM venues v LEFT JOIN events e ON e.venue = v.id WHERE v.organizer = :organizer GROUP BY v.id';
    $stmt = $db->prepare($sql);
    $stmt->bindValue(':organizer', $organizer['id']);
    $stmt->execute();
    $tpl->assign('associatedVenues', $stmt->fetchAll());
}
$tpl->assign('userlist', Session::hasPriv('USERLIST'));
$tpl->display('viewOrganizer.tpl');
startSidebar();
$nextEvent = getNextEvent($organizer['id']);
echo '<div class = "infobox"><h2>Next event for ' . $organizer['title'] . '</h2>';
if (empty($nextEvent)) {
    echo '<p style = "color:red">To the best of our knowledge, ' . $organizer['title'] . ' has nothing planned... :(</p>';
} else {
    echo '<p>Next event is <a href = "viewEvent.php?id=' . $nextEvent['id'] . '">' . $nextEvent['title'] . '</a></p>';
}
echo '<p>You may find another organizer near you on the <a href = "eventsMap.php">map</a> or from the <a href = "listOrganizers.php">list of organizers</a>.</p>';
echo '</div>';
if (Session::isLoggedIn() && Session::getUser()->hasPriv('EDIT_ORGANIZER') || Session::isLoggedIn() && Session::getUser()->getData('organization') == $organizer['id']) {
    echo '<div class = "infobox">';
    echo '<h2>Organizer admin</h2>';
    echo '<ul>';
    if ($organizer['venueCount'] == 0) {
        echo '<li>New Event - <em>Make a venue first</em></li>';
    } else {