-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.php
executable file
·68 lines (64 loc) · 3.34 KB
/
api.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
<?php
require_once('obj/db.php');
switch($_GET['type']) {
case 'misc': require_once('api/misc.php');
switch($_GET['method']) {
case 'submitAcronym': print json_encode(APIMisc::submitAcronym()); break;
case 'modAcronym': print json_encode(APIMisc::modAcronym()); break;
} break;
case 'post': require_once('api/post.php');
switch ($_GET['method']) {
case 'adminDeletePost': print json_encode(APIPost::adminDeletePost()); break;
case 'userDeletePost': print json_encode(APIPost::userDeletePost()); break;
case 'loadNextPage': print json_encode(APIPost::loadNextPage()); break;
} break;
case 'topic': require_once('api/apitopic.php');
switch($_GET['method']) {
case 'adminDeleteTopic': print json_encode(APITopic::adminDeleteTopic()); break;
} break;
case 'sess': require_once('api/apisess.php');
switch($_GET['method']) {
case 'addToSession': print json_encode(APISess::addToSession()); break;
case 'logout': APISess::logout(); break;
case 'loginUser': print json_encode(APISess::loginUser()); break;
} break;
case 'forum': require_once('api/forum.php'); require_once('api/apitopic.php');
switch($_GET['method']) {
case 'newTopic': print json_encode(APIForum::newTopic()); break;
case 'reply': print json_encode(APITopic::reply()); break;
case 'getForums': print json_encode(APIForum::getForums()); break;
case 'getTopicsInForumByPage': print json_encode(APIForum::getTopicsInForumByPage()); break;
case 'getTopic': print json_encode(APIForum::getTopic()); break;
case 'editPost': print json_encode(APIForum::editPost()); break;
case 'deletePost': print json_encode(APIForum::deletePost()); break;
case 'deleteTopic': print json_encode(APIForum::deleteTopic()); break;
} break;
case 'stream': require_once('api/apistream.php');
switch($_GET['method']) {
case 'editStream': print json_encode(APIStream::editStream()); break;
} break;
case 'tournament': require_once('api/tournament.php');
switch($_GET['method']) {
case 'register': print json_encode(APITournament::register()); break;
case 'uploadReplay': print json_encode(APITournament::uploadReplay()); break;
case 'generateBracket': print json_encode(APITournament::generateBracket()); break;
case 'editMatch': print json_encode(APITournament::editMatch()); break;
case 'getBracket': print json_encode(APITournament::getBracket()); break;
case 'reportWin': print json_encode(APITournament::reportWin()); break;
case 'getMapList': print json_encode(APITournament::getMapList()); break;
case 'editTournament': print json_encode(APITournament::editTournament()); break;
case 'deleteTournament': print json_encode(APITournament::deleteTournament()); break;
case 'createTournament': print json_encode(APITournament::createTournament()); break;
case 'reportResults': print json_encode(APITournament::reportResults()); break;
} break;
case 'user': require_once('api/user.php');
switch($_GET['method']) {
case 'changePic': print json_encode(APIUser::changePic()); break;
case 'setBnet': print json_encode(APIUser::setBnet()); break;
} break;
case 'register': require_once('api/register.php');
switch($_GET['method']) {
case 'registerUser': print json_encode(APIRegister::registerUser()); break;
} break;
}
?>