Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
tsyuha дайте пож. ссылочку на ваш чат.
Что нибудь нового для чата появилось???? Поделитесь пожалуйста.
Кто нибудь знает как запустить демона через CRON????
а есть примеры работы этого чата?
валаживаю скрипт работы чата под оперой
Для просмотра ссылки Войдиили Зарегистрируйся
Ты его проверял? Он же закодирован под локалку или 127.0.0.1, писать надо в примечании
<?
error_reporting(0);
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
header("X-Powered-By: TCL");
header("Connection: close");
header("Content-Type: text/html; charset=windows-1251");
function parse_agent($t = "") {
$ret = array();
$t = ($t=='') ? getenv("HTTP_USER_AGENT") : $t;
$ret['src'] = $t;
$r = array(
"Windows NT 7.0" => "Windows 7",
"Windows NT 6.0" => "Windows Vista",
"Windows NT 5.2" => "Windows Server 2003",
"Windows NT 5.1" => "Windows XP",
"Windows NT 5.0" => "Windows 2000",
"Windows NT 4.0" => "Windows NT 4.0"
);
foreach ($r as $k=>$v) {
$t = str_replace($k, $v, $t);
}
$os = array("Windows", "Linux", "FreeBSD", "Mac OS", "Debian", "Symbian", "MIDP", "SunOS", "WinNT");
$os_list = array();
foreach($os as $k) {
$k = preg_quote($k);
$cur = ""; $len = 0;
if (preg_match_all("#(\(|;)([^\(;]*{$k}[^\(;]*)(\)|;)#msi", $t, $m)) {
foreach($m[2] as $i=>$d) {
if (strlen($d)>$len) {
$cur = $d; $len = strlen($d);
}
}
}
if ($cur!='') {
$os_list[] = $cur;
}
}
$ret['os'] = implode(", ", $os_list);
$browsers = array('Opera', 'Firefox', 'Safari', 'Netscape', 'Konqueror', 'MSIE');
$b_list = array();
foreach($browsers as $k) {
$k = preg_quote($k);
if (preg_match("#(\(|;)([^\(;]*{$k}[^\(;]*)(\)|;)#msi", $t, $m)) {
$b_list[] = $m[2];
}
elseif (preg_match("#([^\(\);\s]*{$k}[0-9\.\s/]+)#msi", $t, $m)) {
$b_list[] = trim($m[1]);
}
elseif (preg_match("#([^\(\);\s]*{$k}[^\(\);\s]*)#msi", $t, $m)) {
$b_list[] = $m[1];
}
if (count($b_list)>0) break;
}
$ret['browser'] = implode(", ", $b_list);
$ret['browser'] = str_replace("MSIE", "Microsoft Internet Explorer", $ret['browser']);
return $ret;
}
function sockopen($host, $port, $uri, $vars){
$header = "GET $uri HTTP/1.1\r\n";
$header .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n";
$header .= "Referer: ".$_SERVER['HTTP_REFERER']."\r\n";
$header .= "Accept-Language: ru\r\n";
$header .= "Accept-Encoding: gzip, deflate\r\n";
$header .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; WebMoney Advisor; .NET CLR 2.0.50727)\r\n";
$header .= "Host: $host:$port\r\n";
$header .= "Connection: Keep-Alive\r\n";
$header .= "Cookie: ".$_SERVER['HTTP_COOKIE']."\r\n\r\n";
$fp = sockopen($host, $port, $errno, $errstr)or die("error");
if (!$fp) {
echo "<h2>Script Error</h2>\n";
} else {
fputs($fp, $header);
fwrite($fp, $header);
while (!feof($fp)) {
$outopera = fgets($fp, 1024);
$vh = array ("'HTTP/1.0.*?\n'si",
"'Content-Type:.*?\n'si",
"'Date:.*?\n'si",
"'Cache-Control:.*?\n'si",
"'Expires:.*?\n'si",
"'Pragma:.*?\n'si",
"'X-Powered-By:.*?\n'si",
"'Server:.*?\n'si",
"'Connection:.*?\n'si");
$outopera = preg_replace($vh,'',$outopera);
echo "$outopera";
fwrite($fp, "\x00");
flush();
}
fclose($fp);
flush();
}
}
$host=$_GET['url'];
$port = $_GET['port'];
$wwp = $_GET['wwp'];
$vars = "/cpsr460/{$host}_$wwp?&PHPSESSID=".$_GET['PHPSESSID']."&";
$uri = "$vars";
if(empty($host) || empty($port) || empty($wwp)){exit();}
$bw = parse_agent();
$bwinfo = explode(".", $bw['browser']);
echo "<meta http-equiv='refresh' content='1'>";
sockopen($host, $port, $uri, $vars);
?>