-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlatest.php
More file actions
47 lines (39 loc) · 972 Bytes
/
latest.php
File metadata and controls
47 lines (39 loc) · 972 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
<?php
include 'Settings.php';
include './includes/tables.php';
include './includes/users.php';
include './includes/ucp/login.php';
include './includes/funcs.php';
include './includes/database/database.php';
$connection = -1;
$DB_CONNECTED = false;
$DB_CONNECTION = ConnectDataBase();
$arr = GetTableContents(pastes,array('id','title','language','created'),' WHERE created >= '.$_GET['t']);
while(true){
if(count($arr)>0){
for($i = 0; $i < count($arr);$i++){
$arr[$i]['created'] = date("d M Y H:i:s",$arr[$i]['created'] );
}
$arr['timestamp']=time();
echo json_encode($arr);
file_put_contents ( "dbg.txt" , print_r("ret",true));
die();
}else{
sleep(1);
$arr = GetTableContents(pastes,array('id','title','language','created'),' WHERE created > '.($_GET['t']));
}
}
//dbg($arr);
$arr = array(
1=>array(
'lng' => 'Cpp',
'title' => 'title',
'time'=> 'time'
),
2=>array(
'lng' => 'CS',
'title' => 'title2',
'time'=> 'time2'
)
);
?>