-
Notifications
You must be signed in to change notification settings - Fork 1
/
define.php
136 lines (95 loc) · 5.16 KB
/
define.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!doctype html>
<html>
<?php
$loggedin = 0;
$loginUrl ="";
$advancedinfo = "";
;
include "header.php";
include "login.php";
$accessToken = ($_SESSION[fb_token]);
?>
</ul>
</div>
</div>
</div>
<?php
if ($loggedin==1){
if ($_GET[type]=='Profile'){
//render form to define Livestream to Facebook Profile
echo"
<div class='content'>
<h2 class='content-head is-center'>Create Live Event</h2>
<form class='pure-form pure-form-stacked' method='POST' action='create.php'>
<fieldset>
<label for='token' $advancedinfo>Token</label>
<input type='text' name='token' id='token' value='$accessToken' readonly='readonly' $advancedinfo>
<label for='Profile'>Profile</label>
<input type='text' name='Profile' id='Profile' value='$user[name]' readonly='readonly'>
<label for='profileid' $advancedinfo>Profile ID</label>
<input type='text' name='profileid' id='profileid' value='$user[id]' readonly='readonly' $advancedinfo>
<label for='title'>Title</label>
<input type='text' name='title' id='title'>
<label for='description'>Description</label>
<input type='text' name='description' id='description'>
<button type='submit' class='pure-button button-create' > <i class='fas fa-video'></i> Create Event</button>
</fieldset>
</form>
</div>
";
} elseif ($_GET[type]=='Page'){
$pagetoken = $fb->get('/' . $_GET[pageid] . '?fields=access_token')->getGraphNode()->asArray();
$page = $fb->get('/' . $_GET[pageid])->getGraphNode()->asArray();
//render form to define Livestream to Facebook Page
echo"
<div class='content'>
<h2 class='content-head is-center'>Create Live Event</h2>
<form class='pure-form pure-form-stacked' method='POST' action='create.php'>
<fieldset>
<label for='pagetoken' $advancedinfo>Page Token</label>
<input type='text' name='pagetoken' id='pagetoken' value='$pagetoken[access_token]' readonly='readonly' $advancedinfo>
<label for='page'>Page</label>
<input type='text' name='page' id='page' value='$page[name]' readonly='readonly'>
<label for='pageid' $advancedinfo>Page ID</label>
<input type='text' name='pageid' id='pageid' value='$page[id]' readonly='readonly' $advancedinfo>
<label for='title'>Title</label>
<input type='text' name='title' id='title'>
<label for='description'>Description</label>
<input type='text' name='description' id='description'>
<button type='submit' class='pure-button button-create' > <i class='fas fa-video'></i> Create Event</button>
</fieldset>
</form>
</div>
";
} elseif ($_GET[type]=='Group'){
$group = $fb->get('/' . $_GET[groupid])->getGraphNode()->asArray();
//render form to define Livestream to Facebook Group
echo"
<div class='content'>
<h2 class='content-head is-center'>Create Live Event</h2>
<form class='pure-form pure-form-stacked' method='POST' action='create.php'>
<fieldset>
<label for='token' $advancedinfo>Token</label>
<input type='text' name='token' id='token' value='$accessToken' readonly='readonly' $advancedinfo>
<label for='group'>Group</label>
<input type='text' name='group' id='group' value='$group[name]' readonly='readonly'>
<label for='groupid' $advancedinfo>Group ID</label>
<input type='text' name='groupid' id='groupid' value='$group[id]' readonly='readonly' $advancedinfo>
<label for='title'>Title</label>
<input type='text' name='title' id='title'>
<label for='description'>Description</label>
<input type='text' name='description' id='description'>
<button type='submit' class='pure-button button-create' > <i class='fas fa-video'></i> Create Event</button>
</fieldset>
</form>
</div>
";
}else{
//No stream type selected, redirecting to Home
header('Location: ./');
}
} else {
//Not logged in, redirecting to Home
header('Location: ./');
}
?>