Просмотр файла gb/incl/head.php

Размер файла: 2.16Kb
<?
/*
GB(v1.0) by Viktor
icq:357332321
site: http://yarap.ru
http://xwab.ru/forum/profile656
[incl/head.php]
*/
header('Content-Type: text/html; charset=UTF-8');
session_start();

if (!(@fopen("viktor_gb_config.php", "r")))
    {
    header("Location: install.php");exit;
    }
require('viktor_gb_config.php');
include('incl/func.php');
if($_SESSION[$pref.'lang'])$lang=$_SESSION[$pref.'lang'];
else
    {
    $sql_lang=sql("SELECT * FROM ".$pref."config WHERE c='lang'");
    $lang=$sql_lang['o'];
    }
$sql_lang=sql("SELECT * FROM ".$pref."lang WHERE id=$lang");
$lang=$sql_lang['file'];
query("DELETE FROM ".$pref."bans WHERE time<>-1 AND time<".time());
query("DELETE FROM ".$pref."online WHERE time<".(time()+360));
if(!(sql("SELECT * FROM ".$pref."online WHERE ip='".user_ip()."'")))
    query("INSERT INTO ".$pref."online (ip, time) VALUES ('".user_ip()."', ".time().")");
else
    query("UPDATE ".$pref."online SET time=".time()." WHERE ip='".user_ip()."'");
include('lang/'.$lang.'.php');
if ($tpl<>1)
    {
    include('incl/template.php');
    $template->set_filenames(array(
            'body1' => 'head.tpl'));
    $title_sql=sql("SELECT * FROM ".$pref."config WHERE c='title'");
    $title=$title_sql['o'];
    $res_reklama1=query("SELECT * FROM ".$pref."reklama WHERE id>0");
    while($row=row($res_reklama1))
        {
        $template->assign_block_vars("reklama_up", array("TEXT"=>$row['text'], "ID"=>$row['id'], "LINK"=>$row['link']));
        }
    $template->assign_vars(array(
        "TITLE"=>$title));
    $template->pparse('body1');
    if($ban=sql("SELECT * FROM ".$pref."bans WHERE ip='".user_ip()."'"))
        {
        $template->set_filenames(array(
            'body' => 'ban.tpl'));
        $template->assign_vars(array(
            "STEXT"=>$l[27],
            "SPRI"=>$l[88],
            "SNAME"=>$l[25],
            "PRI"=>$ban['pri'],
            "IP"=>$ban['ip'],
            "DATA"=>($ban['time']==-1) ? $l[99] : $l[100].data($ban['time']),
            "NAME"=>$ban['name'],
            "TEXT"=>$ban['text']));
        $template->pparse('body');
        include('foot.php');
        exit;
        }
    }
?>