php ob_start microtime function verh page global us echo xml version e

 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
<?php
ob_start();
$t = microtime(1);
function verh($page){
global $us;
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="title" content="GearNET.RU - Социальная сеть!"/>
<meta name="author" content="SANKEY"/>
<meta name="Reply-to" content="Dario430@yandex.ru"/>
<link rel="stylesheet" href="/templates/styles/default/desing.css" type="text/css"/>
<link rel="shortcut icon" href="/templates/imagick/favicon.ico" type="image/x-icon" />
<title>'.$page.'</title></head><body>
<div class="logos"><a href="/"><img src="/templates/imagick/logo.png" alt=""/></a></div>
</body>
</html>';
}
if (isset ($_COOKIE['id'], $_COOKIE['pass'])) {
$query = DB :: $dbs -> query ("SELECT * FROM `blogger` WHERE (`id`=?) AND (`pass`=?)", array (intval ($_COOKIE['id']), addslashes ($_COOKIE['pass'])));
if ($query -> rowCount () != 0) {
$blogger = $query -> fetch ();
// update activity
DB :: $dbs -> query("UPDATE `blogger` SET `last`='" . time () . "',`ip`=?,`soft`=? WHERE (`id`='" . $us['id'] . "')", array ($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
// if last activity < 1 hour update all online
if ((time () - $blogger['last']) < 3600) {
DB :: $dbs -> query("UPDATE `blogger` SET `online`=`online`+'" . (time () - $blogger['last']) . "' WHERE (`id`='" . $blogger['id'] . "')", array ($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
}
}
}
?>