forked from gbishop/TarHeelGameplay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreator.php
More file actions
28 lines (27 loc) · 823 Bytes
/
creator.php
File metadata and controls
28 lines (27 loc) · 823 Bytes
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
<?php
// get the id if any
global $current_user;
get_currentuserinfo();
global $Templates;
$view = array(
'loggedin' => is_user_logged_in(),
'topics' => $Templates['categories'],
'languages' => $Templates['languages'],
'user' => $current_user->display_name
);
$key = getParam('key', '', null);
$id = getParam('id', '', null);
echo "<!-- $key $id -->";
$script = "";
if ($key) {
$json = gps_get_json($key);
$script = "<script>window.game_init=$json; </script>";
} elseif($id) {
$post = get_post($id);
$gameplay = ParseGameplayPost($post);
$json = json_encode($gameplay);
$script = "<script>window.game_init=$json; </script>";
}
$view['script'] = $script;
echo template_render('creator', $view);
?>