forked from kongregate/kompatible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
35 lines (33 loc) · 1.06 KB
/
index.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
<?php
error_reporting(E_ALL);
if(file_exists('config.json')){
$config = json_decode(file_get_contents('config.json'), true);
} else {
print("put credentials in config.json");
die();
}
if (isset($_REQUEST['platform']) && $_REQUEST['platform'] == "fb") {
require_once("FacebookPlatform.php");
$kompatible = new FacebookPlatform($config['facebook']);
} else {
require_once("KongregatePlatform.php");
$kompatible = new KongregatePlatform($config['kongregate']);
}
$user_id = $kompatible->login();
?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
</head>
<?= $kompatible->loadLibraries(); ?>
<body>
<?= $kompatible->displayHeader(); ?>
<h1>Hello <?= $kompatible->getUserName() ?>!</h1>
<?= $kompatible->showPurchaseButton() ?>
<?php if ($kompatible->isFeatureEnabled("invites")) { ?>
<a onclick='showInvitePopup();' href="#">Invite a Friend!</a>
<?php }?>
<?= $kompatible->getFriends(); ?>
<?= $kompatible->displayFooter(); ?>
</body>