예제 #1
0
 public function __construct($id)
 {
     $db = Database::obtain();
     $sql = 'SELECT * FROM users WHERE id = ' . $db->escape($id);
     $userinfo = $db->query_first($sql);
     $this->id = $userinfo['id'];
     $this->nickname = $userinfo['nickname'];
     $this->steamid = $userinfo['steamid'];
     $this->country = $userinfo['country'];
     $this->email = $userinfo['email'];
     $this->banpoints = $userinfo['banpoints'];
     $this->rating = rating($this->id);
     $this->mainclass = mainclass($this->id);
     $this->avatar = APIGet($this->steamid, avatar);
     $this->etf2lid = str_replace('STEAM_', '', GetAuthID($this->steamid));
     $this->division = etf2ldiv($this->etf2lid);
     $this->latitude = $userinfo['latitude'];
     $this->longitude = $userinfo['longitude'];
     $this->status = $userinfo['status'];
 }
예제 #2
0
function getfriends($id, $extra = 'simple')
{
    $db = Database::obtain();
    $query = 'SELECT friends FROM users WHERE id=' . $db->escape($id);
    $result = $db->query($query);
    $friendsinfo = $db->fetch($result);
    $fids = $friendsinfo['friends'];
    if ($fids != "" && count($fids) > 0) {
        if ($extra == 'remove') {
            $limit = '';
        } else {
            $limit = 'LIMIT 10';
        }
        $query = 'SELECT * FROM users WHERE id IN(' . $db->escape($fids) . ') ORDER BY lastseen DESC ' . $limit;
        $result = $db->query($query);
        while ($friend = $db->fetch($result)) {
            $online = getOnline($friend['id']);
            $nickname = $friend['nickname'];
            $steamid = $friend['steamid'];
            $uid = $friend['id'];
            if ($online == "Online") {
                $status = '<li>';
            } else {
                $status = '<li class="friend_offline">';
            }
            if ($extra == 'invite' && $online == 'Online') {
                $extrahtml = '<a class="friend_inv" href="#invite" title="Invite to Lobby">Inv+</a>';
            }
            if ($extra == 'remove') {
                $extrahtml = '<a class="friend_del" href="#del" title="Remove from Friendlist">Remove from Friendlist</a>';
            }
            $return = $status . '<a href = "profile.php?id=' . $uid . '">
			<img src=' . APIGet($steamid, avatar) . ' width="32" height="32"></img>' . '<span class="user_name">' . $nickname . '</span>' . '<span class="user_steamid">' . GetAuthID($steamid) . '</span>' . '<span class="user_steamon">' . $online . '</span><br />
			' . $extrahtml . '
			</a></li>';
            echo $return;
        }
    } else {
        echo 'You have no friends yet';
    }
}
예제 #3
0
	<div id="wrapper">
		<div id="header">
			<a href="" id="logo">TF2 Matchmaking System</a>
		</div>
		<div id="content" class="big_panel">
			<ul class="nav_panel">
				<li><a href="index.html">Home</a></li>
				<li class="current"> &raquo; Register</li>
			</ul>
		<h1 style="float: left; font-size: 3em; width: 90%; text-align: center; border-bottom: 1px solid; margin: 20px 5%; padding-bottom: 10px;">Welcome!</h1>
		<form method="post" action="" style="margin-top: 10px;">
		<input type="hidden" name="steamId64" value="' . $_SESSION['steamid'] . '">
			<p style="margin: 10px 50px;">Thank you for using TF2MM! Since this is the first time you\'re using TF2MM, we\'d like to know more about you.</p>
			<div class="panel" style="width: 500px; margin-left: 50px;">
				<label>Nickname:</label>
				<input type="text" value="' . APIGet($steamid, personaname) . '" name="nickname"/><small style="float: left;margin: 3px;">(Cannot be blank)</small>
			</div>
			<input type="submit" style="float: right; width: 250px; margin-right:54px;  margin-bottom: 0;" value="Submit" class="button submit" />
			<div class="panel" style="width: 500px; margin-left: 50px;">
				<label>Email:</label>
				<input type="text" name="email"/><small style="float: left;margin: 3px;">(Can opt-out at any time)</small>
				<label>Country:</label>
				<select type="text" name="loc">
					<option value="Austria">Austria</option>
					<option value="Belarus">Belarus</option>
					<option value="Belgium">Belgium</option>
					<option value="Bosnia Herzegovina">Bosnia Herzegovina</option>
					<option value="Bulgaria">Bulgaria</option>
					<option value="Croatia">Croatia</option>
					<option value="Czech Republic">Czech Republic</option>
					<option value="Denmark">Denmark</option>
예제 #4
0
if (!$id) {
    header('Location: index.php');
}
$user = new User($id);
$css = 'style_profile.css';
$js = 'profile.js';
include_once 'includes/header.inc';
echo '
        <div id="content" class="big_panel">
            <ul class="nav_panel">
                <li><a href="index.php">Home</a></li>
                <li class="current"> &raquo; Profile</li>
                <li><a href="usercenter.php"> &raquo; Control Center</a></li>
            </ul>
            <div class="avatar_panel">
                <img class="avatar_big" src="' . APIGet($user->steamid, avatar) . '">';
if ($id != $_SESSION['id']) {
    echo '
                <div class="friend_add button">+ Add</div>';
}
echo '</div>
            ' . $user->display_profile($id, false) . '
            <ul class="recentlobby_panel">
                ' . displayLastLobbies($id) . '
            </ul>
            <dl class="stats_panel">
                <dt>Wins</dt><dd>7</dd>
                <dt>Losses</dt><dd>10</dd>
                <dt>Ratio</dt><dd>0.7</dd>
            </dl>
            <div class="friends_panel">
예제 #5
0
function grabLobbyPlayers($lobbyID, $lobbytype, $team)
{
    $db = Database::obtain();
    $sql = "SELECT * FROM lobby_players WHERE `lobbyID` = '" . $db->escape($lobbyID) . "' AND `team` = '" . $db->escape($team) . "'";
    $res = $db->query($sql);
    $data = array();
    while ($row = $db->fetch($res)) {
        $player = player($row["playerid"]);
        $steamid = $player["steamid"];
        $avatar = APIGet($steamid, avatar);
        $class = player_class($row["class"]);
        $id = getLPid($player['id'], $lobbyID);
        $data[] = array('id' => $player['id'], 'class' => $class, 'nickname' => $player['nickname'], 'ready' => readystatus($id, true), 'avatar' => $avatar);
    }
    return $data;
}