Esempio n. 1
0
 function getSteamData()
 {
     if (strlen($this->steamprofile) != 0) {
         $steam = new SteamAPI($this->steamprofile);
         $steam->setData($this->steamdata);
         return $steam;
     }
     return new SteamAPI($this->steamprofile);
 }
<?php

include_once 'SteamAPI.class.php';
$user = $_GET["user"];
$game = $_GET["game"];
$steamAPI = new SteamAPI();
$res = $steamAPI->getAchievementDetails($user, $game);
echo json_encode($res);
Esempio n. 3
0
 *      
 *      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *      THE SOFTWARE.
 *      
 */
require "SteamAPI.class.php";
$id = $_GET['id'];
if (empty($id)) {
    $id = "wbreadz";
}
$steam = new SteamAPI($id);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>Example Games</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<style type="text/css">
			.right{float:right;}
			.left{float:left;}
			.clear{clear:both;}
			a{text-decoration:none;color:inherit;}
			a img{border:none;margin:2px;}
			a:hover{color:#C1C1C1;}
			.status_online{color:#5BC34F;}
<?php

include_once 'SteamAPI.class.php';
$user = $_GET["user"];
$steamAPI = new SteamAPI();
$res = $steamAPI->getGamesOwned($user);
echo json_encode($res);
 *      
 *      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *      THE SOFTWARE.
 *      
 */
require "SteamAPI.class.php";
$id = $_GET['id'];
if (empty($id)) {
    $id = "wbreadz";
}
$steam = new SteamAPI($id);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>Example User Status box.</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<style type="text/css">
			.right{float:right;}
			.left{float:left;}
			.clear{clear:both;}
			a{text-decoration:none;color:inherit;}
			a img{border:none;margin:2px;}
			a:hover{color:#C1C1C1;}
			.status_online{color:#5BC34F;}
 // If the user is not logged in at all
 if (!isset($_SESSION['steamID'])) {
     // Validate the login with class
     $loginAttempt = $steamSignIn->validate();
     // Echo steam ID if login was successful
     if ($loginAttempt != '') {
         include_once 'db.class.php';
         $dbclass = new DB();
         $db = $dbclass->getConnection();
         // Check if the user exists already
         if ($result = $db->query("SELECT email FROM Users WHERE steamID={$loginAttempt}")) {
             // Store steam ID
             $_SESSION['steamID'] = $loginAttempt;
             // Get more information about the player
             include_once "SteamAPI.class.php";
             $steamAPI = new SteamAPI();
             $playerSummary = $steamAPI->getPlayerInfo($loginAttempt);
             // Store avatar and name
             print_r($playerSummary);
             $_SESSION['name'] = $playerSummary['personaname'];
             $_SESSION['avatar'] = $playerSummary['avatarfull'];
             if ($result->num_rows < 1) {
                 // If account doesn't exist, we need to request their email to
                 // create their account (to be implemented)
                 // This email isn't activated yet, we don't have the user in the database
                 $_SESSION['activated'] = false;
                 // Redirect to where they can activate their account
                 header('location: /newAccount.php');
             } else {
                 // This account is activated
                 $_SESSION['activated'] = true;
              <tr>
                <th>Game</th>
                <th>Achievement</th>
                <th>Challenged</th>
                <th>Bounty</th>
                <th>Done?</th>
                <th>Paid?</th>
              </tr>
            </thead>
            <tbody>
<?php 
include_once 'login/db.class.php';
include_once 'login/SteamAPI.class.php';
include_once 'login/JustGivingAPI.class.php';
$db = new DB();
$steamAPI = new SteamAPI();
$JGAPI = new JustGivingAPI();
foreach ($db->getChallengesMadeBy($_SESSION['steamID']) as $row) {
    echo '<tr>';
    echo '<td>' . $steamAPI->getGameName($row['appID']) . '</td>';
    echo '<td>' . $row['Achievement'] . '</td>';
    $toUser = $db->getUserDetails($row['toUser']);
    echo '<td>' . $toUser['name'] . '</td>';
    echo '<td>' . $row['amount'] . '</td>';
    if ($row['completed'] == 1) {
        echo '<td><a class="tick" href="javascript:void(0)"
                         title="Yes">
                      <i class="glyphicon glyphicon-ok"></i>
                  </a></td>';
    } else {
        echo '<td><a class="cross" href="javascript:void(0)"