-
Notifications
You must be signed in to change notification settings - Fork 0
/
get.php
60 lines (55 loc) · 974 Bytes
/
get.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
<?php
header('Access-Control-Allow-Origin:*');
require_once "config.php";
$object = new BulletScreen();
if (isset($_GET['id']))
{
$id = @$_GET['id'];
$query = $object->get_mysql(
'bulletscreen',
'*',
"`id` = '$id'",
false,
true
);
if ($query && mysql_num_rows($query) > 0)
{
$data = mysql_fetch_array($query);
$output = array(
'id' => $data['id'],
'nickname' => $data['nickname'],
'time' => $data['time'],
'content' => $data['content'],
);
echo json_encode($output);
}
else
{
exit('{"error":"id"}');
}
}
else
{
$status = $object->mem->get("BulletScreen-Display");
if ( ! $status)
{
exit('{"display":false}');
}
$query = $object->get_mysql(
'bulletscreen',
'`id`,`status`',
'`status`>0',
'`id` ASC',
false
);
$temp = array();
while ($data = mysql_fetch_array($query))
{
$temp[$data[0]] = $data[1];
}
$output = array(
"display" => true,
"list" => $temp,
);
echo json_encode($output);
}