<?php
defined('_CMEX_') or die('Error. You don`t have permision to access.');
session_name('sid');
session_start();
define('MT', microtime(1));
define('COPY', '© Powered by CMEX');
define('ADMIN', '111111');
define('DBhost', 'localhost');
define('DBuser', 'root');
define('DBpass', '');
define('DBname', 'mysql');
mysql_connect(DBhost, DBuser, DBpass) or die('Database does not exist...');
mysql_select_db(DBname) or die('Lost connection to SQL database...');
mysql_unbuffered_query('SET charset utf8');
mysql_unbuffered_query('SET names utf8');
mysql_unbuffered_query('SET character_set_client="utf8"');
mysql_unbuffered_query('SET character_set_connection="utf8"');
ini_set('error_reporting', 7);
ini_set('magic_quotes_gpc', 0);
ini_set('magic_quotes_runtime', 0);
ini_set('session.use_cookies', 1);
ini_set('arg_separator.output', '&');
ini_set('mysql.trace_mode', 'off');
require 'Filter.class.php';
$Filter = new Filter;
require 'Show.class.php';
$Show = new Show;
require 'Navigator.class.php';
function show_time($times=NULL) {
$time = time();
$today = date("j M Y", $time);
$yesterday = date("j M Y", strtotime("-1 day"));
$timesp=date("j M Y в H:i", $times);
$timesp = str_replace($today, 'Сегодня', $timesp);
$timesp = str_replace($yesterday, 'Вчера', $timesp);
$timesp = strtr($timesp, array ("Jan" => "Янв","Feb" => "Фев","Mar" => "Марта","May" => "Мая","Apr" => "Апр","Jun" => "Июня","Jul" => "Июля","Aug" => "Авг","Sep" => "Сент","Oct" => "Окт","Nov" => "Ноября","Dec" => "Дек",));
return $timesp;
}
function quickcode() {
echo '<div class="menu">
<a href="#form" onclick="javascript:tag(\'[red]\', \'[/red]\');">[red]</a>
<a href="#form" onclick="javascript:tag(\'[yellow]\', \'[/yellow]\');">[yellow]</a>
<a href="#form" onclick="javascript:tag(\'[green]\', \'[/green]\');">[green]</a>
<a href="#form" onclick="javascript:tag(\'[blue]\', \'[/blue]\');">[blue]</a>';
}
// -------------- Вспомогательная функция быстрой вставки -------------//
function quickpaste($form)
{
echo '<script language="JavaScript" type="text/javascript">
function tag(text1, text2) {
if ((document.selection)) {
document.form.' . $form . '.focus();
document.form.document.selection.createRange().text = text1+document.form.document.selection.createRange().text+text2;
} else if(document.forms[\'form\'].elements[\'' . $form . '\'].selectionStart!=undefined) {
var element = document.forms[\'form\'].elements[\'' . $form . '\'];
var str = element.value;
var start = element.selectionStart;
var length = element.selectionEnd - element.selectionStart;
element.value = str.substr(0, start) + text1 + str.substr(start, length) + text2 + str.substr(start + length);
} else document.form.' . $form . '.value += text1+text2;
}
</script>';
}
ob_start();
if (!isset($_SESSION['traf'])) $_SESSION['traf'] = 0;
?>