-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathserver.php
More file actions
53 lines (41 loc) · 1013 Bytes
/
server.php
File metadata and controls
53 lines (41 loc) · 1013 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
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
<?php
/*!
*@name server.php
*@project jquery.barrager.js
*@des 弹幕插件服务端演示
*@author yaseng@uauc.net
*@url https://github.com/yaseng/jquery.barrager.js
*/
//mode=1 实时模式 mode=2 一次性获取模式
$mode=intval($_GET['mode']);
//数组里面可以自定义弹幕的所有属性。
$barrages=
array(
array(
'info' => '第一条弹幕',
'img' => 'static/img/heisenberg.png',
'href' => 'http://www.yaseng.org',
),
array(
'info' => '第二条弹幕',
'img' => 'static/img/yaseng.png',
'href' => 'http://www.yaseng.org',
'color' => '#ff6600'
),
array(
'info' => '第三条弹幕',
'img' => 'static/img/mj.gif',
'href' => 'http://www.yaseng.org',
'bottom' => 70 ,
),
array(
'info' => '第四条弹幕',
'href' => 'http://www.yaseng.org',
'close' =>false,
),
);
if($mode === 1 ){
echo json_encode($barrages[array_rand($barrages)]);
}elseif($mode === 2){
echo json_encode($barrages);
}