-
Notifications
You must be signed in to change notification settings - Fork 33
/
vw_extchat.php
46 lines (35 loc) · 895 Bytes
/
vw_extchat.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
<?php
$updated = $_POST['t'];
$room = $_POST['r'];
//do not allow uploads to other folders
include_once("incsan.php");
sanV($room);
sanV($updated);
if (!$room) exit;
if ($room!="null")
{
$dir = "uploads";
if (!file_exists($dir)) @mkdir($dir);
@chmod($dir, 0755);
$dir .= "/".$room;
if (!file_exists($dir)) @mkdir($dir);
@chmod($dir, 0755);
$dir .= "/external";
if (!file_exists($dir)) @mkdir($dir);
@chmod($dir, 0755);
$day=date("y-M-j",time());
$fname="uploads/$room/external/$day.html";
$chatText="";
if (file_exists($fname))
{
$chatData = implode('', file($fname));
$chatLines=explode(";;\r\n",$chatData);
foreach ($chatLines as $line)
{
$items = explode("\",\"", $line);
if (trim($items[0], " \"") > $updated) $chatText .= trim($items[1], " \"");
}
}
$ztime = time();
}
?>chatText=<?=urlencode($chatText)?>&updateTime=<?=$ztime?>