Файл: public_html/index.php
Строк: 34
<?php
require_once 'includes/sys.php';
require_once 'includes/cache.php';
require_once 'includes/header.php';
/* $today00 = date('d-m-Y');
$timest = strtotime($today00);
$time_yest = $timest - 86400;
echo date('d.m.y, H:i', $time_yest);
*/
/*if($_SERVER['HTTP_X_FORWARDED_FOR']){
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if($_SERVER['HTTP_CLIENT_IP']){
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
else if($_SERVER['REMOTE_ADDR']){
$ip=$_SERVER['REMOTE_ADDR'];
}
$refurl = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
if (isset($refurl) and $refurl !== $_SERVER['HTTP_HOST']) {
$from_r = mysql_query("SELECT * FROM `from` WHERE `url` = '$refurl'");
$from = mysql_fetch_assoc($from_r);
if ($from['id']) {
mysql_query("UPDATE `from` SET `time` = '".time()."', `ip` = '".clean($ip)."', `per` = (`per`+1) WHERE `id` = '$from[id]'");
} else {
mysql_query("INSERT INTO `from` SET `time` = '".time()."', `url` = '$refurl', `ip` = '".clean($ip)."', `per` = (`per`+1)");
}
}
*/
$file = 'local/main/'.$act.'.tpl';
if (file_exists($file) and $act !== 'index') {
echo file_get_contents($file);
} else {
if (isset($u['id'])) {
tp($lang['welcome'].' '.$u['username']);
} else {
tp($lang['welcome'].' '.$lang['guest2'].'');
}
include_once 'local/main/index.tpl';
$ad_r = mysql_query("SELECT * FROM `ad` WHERE `type` = 2 ORDER BY `id`");
if (mysql_num_rows($ad_r)) {
echo '<div class="title">Реклама</div>';
while ($ad = mysql_fetch_assoc($ad_r)) {
echo '<div class="raz">» <a href="'.$ad['link'].'">'.$ad['name'].'</a></div>';
}
}
echo '<div class="foot">Онлайн: <a href="other/online.php">'.stats_online().'</a> из <a href="other/info.php?act=users">'.stats_users().'</a><br>Генерация: '.round(microtime(1) - $t, 4).' сек.</div>';
}
require_once 'includes/tail.php';
?>