-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestapp.php
69 lines (65 loc) · 2.06 KB
/
testapp.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
error_reporting(0);
header("Access-Control-Allow-Origin: *"); // allow gamebanana to request the URL via AJAX
?>
<? if (isset($_GET["main"])): ?>
<p>Hello world</p>
<? elseif (isset($_GET["settings"])): ?>
<form>
<input type="text"/>
</form>
<? elseif (isset($_GET["nav"])): ?>
<dl>
<dt>Today's date</dt>
<dd><?= date('l \t\h\e jS \o\f F, Y') ?></dd>
<dt>Your userID</dt>
<dd><?= $_GET["_idMember"] ?></dd>
<dt>Your IP</dt>
<dd><?= $_GET["_sIpAddress"] ?></dd>
<dt>Your current location</dt>
<dd><?= $_GET["_sUrl"] ?></dd>
</dl>
<? else: ?>
<div class="Module">
<h3>Test Module</h3>
<div class="Content">
<p>
Today's date is:
</p>
<p>
<strong style="font-size:2em"><?= date('l \t\h\e jS \o\f F, Y') ?></strong>
</p>
<p>
This is a <b>Third Party Module</b>. You can have it on your profile by adding the following code in your
<a href="http://gamebanana.com/members/settings/appearance/template/profile/<?= $_GET["_idMember"] ?>">Profile Template Editor</a>:
</p>
<p>
<code><?= htmlspecialchars('<?= $d["_aThirdPartyModules"]["_sTestModule"] ?>') ?></code>
</p>
<h2>Are you a coder?</h2>
<p>
These apps can be created by anyone! Want to
create your own? You just need your own webserver. <a href="http://gamebanana.com/apps/add">Add an App</a>
</p>
<p>
Variables that are sent to your webserver when GameBanana requests your App:
</p>
<dl>
<dt>Your MemberID</dt>
<dd><?= $_GET["_idMember"] ?> (<code><?= htmlspecialchars('$_GET["_idMember"]') ?></code>)</dd>
<dt>This Profile Owner's MemberID</dt>
<dd><?= $_GET["_idProfile"] ?> (<code><?= htmlspecialchars('$_GET["_idProfile"]') ?>)</code></dd>
</dl>
<p>
How does this App work? See it on <a href="https://github.com/banana-org/testapp">Github</a>.
</p>
<p>
Here's the PHP code executed when GameBanana accesses this App's
response URLs (<code>http://banana.org/testapp.php</code>):
</p>
<p>
<textarea><?= htmlspecialchars(file_get_contents(__FILE__)) ?></textarea>
</p>
</div>
</div>
<? endif ?>