<?php
error_reporting(0);
header('Content-Type: text/html; charset=windows-1251');
$querystr = $_SERVER['QUERY_STRING'];
$querystr = strtolower($querystr);
if (strstr($querystr,"concat_ws") || strstr($querystr,"concat") || strstr($querystr,"http") || strstr($querystr,"'") || strstr($querystr,"union")){
header( "Location: /" );
exit;
}
ob_start();
define("HPURL", $_SERVER['HTTP_HOST'] . str_replace("/index.php", "", $_SERVER['PHP_SELF']) . "/");
include_once('config/db.config.php');
if((!isset($config['dbhost']) || $config['dbhost'] == '') || !isset($config['dbname'])){
header('Location:setup.php');
exit;
}
function Add_Array($array){
reset($array);
while (list($feld, $wert) = each($array)){
if (is_string($wert)) {
$array[$feld] = addslashes($wert);
} else {
if (is_array($wert)) {
$array[$feld] = Add_Array($wert);
}
}
}
return $array;
}
function win1251($data){
$data = iconv('UTF-8', 'windows-1251', $data);
return $data;
}
function SysEncode($string){
$string = base64_encode($string);
return $string;
}
function SysRecode($string){
$string = base64_decode($string);
$string = str_replace('&','&',$string);
return $string;
}
if(isset($_GET['gopage']) && $_GET['gopage'] != ''){
$gopage = SysRecode($_GET['gopage']);
refer("index.php?$gopage");
exit;
}
if (isset($HTTP_POST_VARS)){
$_POST = @$HTTP_POST_VARS;
$_GET = @$HTTP_GET_VARS;
$_REQUEST = array_merge($_POST, $_GET);
$_COOKIE = @$HTTP_COOKIE_VARS;
$_SESSION = @$HTTP_SESSION_VARS;
}
if (!get_magic_quotes_gpc()){
$_REQUEST = Add_Array($_REQUEST);
$_POST = Add_Array($_POST);
$_GET = Add_Array($_GET);
$_COOKIE = Add_Array($_COOKIE);
}
function to_abs($val){
if($val) return abs((int)$val);
}
$_REQUEST['id'] = to_abs(@$_REQUEST['id']);
$_REQUEST['galid'] = to_abs(@$_REQUEST['galid']);
$_REQUEST['hid'] = to_abs(@$_REQUEST['hid']);
$_REQUEST['categ'] = to_abs(@$_REQUEST['categ']);
$_REQUEST['catid'] = to_abs(@$_REQUEST['catid']);
$_REQUEST['limit'] = (isset($_REQUEST['limit']) && !empty($_REQUEST['limit'])) ? abs((int)$_REQUEST['limit']) : '';
$_REQUEST['pp'] = (isset($_REQUEST['pp']) && !empty($_REQUEST['pp'])) ? abs((int)$_REQUEST['pp']) : '';
$_REQUEST['prodid'] = (isset($_REQUEST['prodid']) && !empty($_REQUEST['prodid'])) ? abs((int)$_REQUEST['prodid']) : '0';
$_REQUEST['p'] = (isset($_REQUEST['p']) && $_REQUEST['p'] != '') ? preg_replace('/([^a-zA-Z]*)/', '', $_REQUEST['p']) : 'index';
$_REQUEST['t'] = (isset($_REQUEST['t']) && $_REQUEST['t'] != '') ? preg_replace('/([^-A-Za-z0-9]*)/', '', $_REQUEST['t']) : '-';
$_REQUEST['sort'] = (isset($_REQUEST['sort']) && $_REQUEST['sort'] != '') ? preg_replace('/([^-A-Za-z0-9]*)/', '', $_REQUEST['sort']) : '';
$_REQUEST['uid'] = (isset($_REQUEST['uid']) && !empty($_REQUEST['uid'])) ? abs((int)$_REQUEST['uid']) : '';
$_REQUEST['newsid'] = (isset($_REQUEST['newsid']) && !empty($_REQUEST['newsid'])) ? abs((int)$_REQUEST['newsid']) : '1';
$_REQUEST['page'] = (isset($_REQUEST['page']) && !empty($_REQUEST['page'])) ? abs((int)$_REQUEST['page']) : '1';
$_REQUEST['artpage']= (isset($_REQUEST['page']) && !empty($_REQUEST['artpage'])) ? abs((int)$_REQUEST['artpage']) : '1';
$_REQUEST['pp'] = (isset($_REQUEST['pp']) && !empty($_REQUEST['pp'])) ? abs((int)$_REQUEST['pp']) : '';
$_REQUEST['fid'] = (isset($_REQUEST['fid']) && !empty($_REQUEST['fid'])) ? abs((int)$_REQUEST['fid']) : '';
$_REQUEST['pid'] = (isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) ? abs((int)$_REQUEST['pid']) : '';
$_REQUEST['toid'] = (isset($_REQUEST['toid']) && !empty($_REQUEST['toid'])) ? abs((int)$_REQUEST['toid']) : '';
$_REQUEST['cid'] = (isset($_REQUEST['cid']) && !empty($_REQUEST['cid'])) ? abs((int)$_REQUEST['cid']) : '';
$_REQUEST['t_id'] = (isset($_REQUEST['t_id']) && !empty($_REQUEST['t_id'])) ? abs((int)$_REQUEST['t_id']) : '';
$_REQUEST['period'] = (isset($_REQUEST['period']) && !empty($_REQUEST['period'])) ? abs((int)$_REQUEST['period']) : '';
$_REQUEST['unit'] = (isset($_REQUEST['unit']) && !empty($_REQUEST['unit'])) ? eregi_replace('[^-A-Za-z0-9]', '', $_REQUEST['unit']) : '';
$_REQUEST['forum_id'] = (isset($_REQUEST['forum_id']) && !empty($_REQUEST['forum_id'])) ?abs((int)$_REQUEST['forum_id']) : '';
$_REQUEST['posticon'] = (isset($_REQUEST['posticon']) && !empty($_REQUEST['posticon'])) ? abs((int)$_REQUEST['posticon']) : '';
$_REQUEST['group'] = (isset($_REQUEST['group']) && !empty($_REQUEST['group'])) ? abs((int)$_REQUEST['group']) : '';
$_REQUEST['high'] = (isset($_REQUEST['high']) && !empty($_REQUEST['high'])) ? preg_replace('/([^-A-Za-z0-9_. ]*)/', '', $_REQUEST['high']) : '';
$_POST['posticon'] = (isset($_POST['posticon']) && !empty($_POST['posticon'])) ? abs((int)$_POST['posticon']) : '';
define ('BASE_DIR', str_replace("\\","/",getcwd()));
define ('SMARTY_DIR', BASE_DIR . '/compiler/');
include_once(BASE_DIR . '/config/sys.config.php');
include_once(BASE_DIR . '/config/db.config.php');
include_once(BASE_DIR . '/functions/Func.Session.php');
if(!defined('HPURL')) define("HPURL", HTTPSSL . $_SERVER['HTTP_HOST'] . str_replace("/index.php", "", $_SERVER['PHP_SELF']) . "/");
session_start();
session_name('SID');
define("SESSION", session_id());
define('PREFIX', $config['dbprefix']);
function __autoload($class){
include_once(BASE_DIR.'/class/Class.' . $class . '.php');
if (!class_exists($class, false)) {
trigger_error("Не удалось подключить класс: $class", E_USER_WARNING);
}
}
if(isset($_REQUEST['b64redir']) && !empty($_REQUEST['b64redir'])){
$red_to = base64_decode($_REQUEST['b64redir']);
$locati = str_replace("&", "&", $red_to);
refer($locati);
exit;
}
include_once(BASE_DIR . '/lib/db.conntest.php');
include_once(BASE_DIR . '/class/Class.DB.php');
$handle = opendir(BASE_DIR . '/functions/');
while ($file = readdir ($handle)){
if($file{0} != '.') {
if(is_file(BASE_DIR . '/functions/'.$file)) {
include_once(BASE_DIR . '/functions/'.$file);
}
}
}
closedir($handle);
set_error_handler('err_handler');
include(BASE_DIR.'/lib/ssl.php');
if(isset($_SESSION['area']) && is_numeric($_SESSION['area']) && $_SESSION['area'] >= 1 && !isset($_REQUEST['area'])){
$area = preg_replace("/([^0-9]*)/", "", $_SESSION['area']);
$_SESSION['area'] = $area;
$_REQUEST['area'] = $area;
} elseif(isset($_REQUEST['area']) && is_numeric($_REQUEST['area']) && $_REQUEST['area'] >= 1) {
$area = preg_replace("/([^0-9]*)/", "", $_REQUEST['area']);
$_SESSION['area'] = $area;
$_REQUEST['area'] = $area;
} else {
$_SESSION['area'] = 1;
$_REQUEST['area'] = 1;
}
include_once(BASE_DIR . '/compiler/Smarty.class.php');
include_once(BASE_DIR . '/compiler/Sys_Config.class.php');
$GLOBALS['config'] = $config;
$GLOBALS['db'] = new DB($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']);
$sql = $GLOBALS['db']->Query("SET NAMES cp1251");
checkIp();
$active = $GLOBALS['db']->Query("SELECT * FROM " . PREFIX . "_bereiche",-1,true);
while($row_active=$active->fetcharray()){
$activ_sections[$row_active['Name']] = $row_active['Aktiv'];
}
$GLOBALS['Active'] = $activ_sections;
$langcodes = array();
$sql = $GLOBALS['db']->Query("SELECT Id,Sprachcode,Sprache FROM " . PREFIX . "_sprachen WHERE Aktiv = 1 ORDER BY Posi ASC",-1,true);
while($row = $sql->fetcharray()){
array_push($langcodes, $row);
$langlong[$row['Id']] = $row['Sprache'];
$config['lang'][$row['Id']] = $row['Sprachcode'];
}
if(isset($_SESSION['lang']) && !empty($_SESSION['lang']) && !isset($_REQUEST['lang']) && (@file_exists(BASE_DIR . '/lang/' . $_SESSION['lang'] . '/main.txt'))){
$Language = $_SESSION['lang'];
} else {
$Language = (isset($_REQUEST['lang']) && strlen($_REQUEST['lang']) == 2 && (@file_exists(BASE_DIR . '/lang/' . $_REQUEST['lang'] . '/main.txt')) ) ? $_REQUEST['lang'] : $config['lang'][1];
$_SESSION['lang'] = $Language;
if(isset($_REQUEST['lredirect']) && !empty($_REQUEST['lredirect'])){
$redir = base64_decode($_REQUEST['lredirect']);
$redir = str_replace('&', '&', $redir);
refer("$redir");
exit;
}
}
$sql_globals = $GLOBALS['db']->Query("SELECT * FROM " . PREFIX . "_einstellungen LIMIT 1",-1,true);
$row_globals = $sql_globals->fetcharray();
$GLOBALS['settings'] = $row_globals;
define ('BBCODESITE', $row_globals['SysCode_Aktiv']);
define ('SMILIES', $row_globals['SysCode_Smilies']);
define ('IMAGECODE', $row_globals['SysCode_Bild']);
define ('STANDARDMAIL', $row_globals['Mail_Absender']);
$Langcode = array_flip($config['lang']);
if(@!$Langcode[$_SESSION['lang']]){
$res = $GLOBALS['db']->RowQuery("SELECT Id,Sprachcode FROM " . PREFIX . "_sprachen WHERE Aktiv = 1 ORDER BY Posi ASC LIMIT 1",-1,true);
$_SESSION['lang'] = $res->Sprachcode;
}
$_SESSION['Langcode'] = $Langcode[$_SESSION['lang']];
$sql_lang_settings = $GLOBALS['db']->Query("SELECT * FROM " . PREFIX . "_sprachen WHERE Id = '" . $_SESSION['Langcode'] . "' AND Aktiv = 1" ,-1,true);
$row_lang_settings = $sql_lang_settings->fetcharray();
$GLOBALS['sprachen'] = $row_lang_settings;
$locale = $row_lang_settings['Sprachcode'];
if($locale == 'ru'){
@setlocale (LC_ALL, 'ru_RU.CP1251','ru_RU.cp1251', 'rus_RUS.CP1251', 'Russian_Russia.1251', 'ru_RU', 'ru', 'russian');
}else{
@setlocale (LC_ALL, $locale . _ . strtoupper($locale), $locale);
}
$area = $_REQUEST['area'];
$_SESSION['Area'] = $area;
$_SESSION['area'] = $area;
$sql_area = $GLOBALS['db']->Query("SELECT * FROM " . PREFIX . "_sektionen WHERE Id = '{$area}' AND Aktiv = '1'",-1,true);
$row_area = $sql_area->fetcharray();
if(!is_array($row_area)){
$sql_area_p = $GLOBALS['db']->Query("SELECT * FROM " . PREFIX . "_sektionen WHERE Id = '{$area}'",-1,true);
$row_area_p = $sql_area_p->fetcharray();
if(isset($_GET['pass']) && !empty($_GET['pass']) && $_GET['pass'] == $row_area_p['Passwort'] && $row_area_p['Passwort']!=''){
$_SESSION['secpass'][$row_area_p['Id']] = $row_area_p['Passwort'];
}
if($row_area_p['Aktiv'] != 1){
if(isset($_SESSION['secpass'][$row_area_p['Id']]) && $_SESSION['secpass'][$row_area_p['Id']] == $row_area_p['Passwort']){
$row_area = $row_area_p;
} else {
echo "<pre>" . stripslashes($row_area_p['Meldung']) . "</pre>";
exit;
}
}
if(!is_array($row_area_p)){
$sql_area = $GLOBALS['db']->Query("SELECT * FROM " . PREFIX . "_sektionen WHERE Id = '1'",-1,true);
$row_area = $sql_area->fetcharray();
$area = 1;
$_SESSION['Area'] = 1;
}
}
if(!is_dir(BASE_DIR.'/temp/compiled/' . $area . '/')){
if(!@mkdir(BASE_DIR.'/temp/compiled/' . $area . '/')) error('Не дается создать директорию "<b>/temp/compiled/'.$area.'</b>". Пожалуйста, создайте директорию вручную.');
else @chmod(BASE_DIR.'/temp/compiled/' . $area . '/', 0777);
}
if(@!is_writable(BASE_DIR.'/temp/compiled/' . $area . '/')) error('Директория "<b>/temp/compiled/'.$area.'</b>" не имеет прав на запись. Пожалуйста, установите соответсвующие права "<b>(CHMOD 777)</b>"');
$GLOBALS['section'] = $row_area;
$_SESSION['tpl_current'] = (isset($_POST['tpl_current']) && !empty($_POST['tpl_current']) && is_dir('theme/' . $_POST['tpl_current'])) ? $_POST['tpl_current'] : ((isset($_SESSION['tpl_current']) && !empty($_SESSION['tpl_current'])) ? $_SESSION['tpl_current'] : '');
$row_area['Template'] = (isset($_SESSION['tpl_current']) && !empty($_SESSION['tpl_current']) && is_dir('theme/' . $_SESSION['tpl_current'])) ? $_SESSION['tpl_current'] : $row_area['Template'];
$config['std_theme'] = $row_area['Template'];
if(!is_dir(BASE_DIR.'/theme/' . $config['std_theme'])) error('Папка содержащая файлы Вашей темы не найдена!');
$tmpl = new Sys_Smarty(BASE_DIR . '/theme/' . $config['std_theme'], $config['std_theme'], $area, $row_lang_settings);
$GLOBALS['tmpl'] = $tmpl;
$GLOBALS['theme'] = $config['std_theme'];
$GLOBALS['tmpl']->assign('sysversion', SYS_VERSION);
$GLOBALS['tmpl']->register_function('sys_encode', 'SysEncode');
$Source = BASE_DIR . '/theme/' . $config['std_theme'];
$GLOBALS['config']['source'] = $Source;
$tmpl->config_load(BASE_DIR . '/lang/' . $Language . '/main.txt');
$config_vars = $GLOBALS['tmpl']->get_config_vars();
$Sys = new Sys;
$Login = new Login;
$GLOBALS['tmpl']->assign('is_active', $GLOBALS['Active']);
$GLOBALS['tmpl']->assign('shop_is_startpage', ($GLOBALS['settings']['shop_is_startpage']==1 ? 1 : ''));
$GLOBALS['tmpl']->assign('sess', SESSION);
$GLOBALS['tmpl']->register_function('navi', 'Navi');
$GLOBALS['tmpl']->assign('sys_version', VERSION);
$GLOBALS['tmpl']->assign('settings', $row_globals);
$GLOBALS['tmpl']->assign('config_vars', $config_vars);
$GLOBALS['tmpl']->assign('user_login', $Login->UserLogin($Source));
if(isset($_SESSION['user_group']) && $_SESSION['user_group'] != '2' && isset($_SESSION['benutzer_id'])){
$group_settings = $GLOBALS['db']->RowQuery("SELECT SysCode_Signatur, Signatur_Erlaubt, Signatur_Laenge, Avatar_B, Avatar_H, MaxPn, MaxPn_Zeichen, MaxAnlagen, MaxZeichenPost FROM " . PREFIX . "_benutzer_gruppen WHERE Id = '" . $_SESSION['user_group'] . "'");
define('SIG_SYSCODE', $group_settings->SysCode_Signatur);
define('SIG_ERLAUBT', $group_settings->Signatur_Erlaubt);
define('SIG_LAENGE', $group_settings->Signatur_Laenge);
define('AVATAR_W', $group_settings->Avatar_B);
define('AVATAR_H', $group_settings->Avatar_H);
define('MAXPN', $group_settings->MaxPn);
define('MAXPNLENGTH', $group_settings->MaxPn_Zeichen);
define('MAXATTCHMENT', $group_settings->MaxAnlagen);
define('MAXLENGTH_POST', $group_settings->MaxZeichenPost);
define('UID', $_SESSION['benutzer_id']);
define('UGROUP', $_SESSION['user_group']);
define('UNAME', sysspecialchars($_SESSION['user_name']));
define('ISLOGGED', 1);
if(isset($_SESSION['perm'])) unset($_SESSION['perm']);
if(isset($_SESSION['perm_admin'])) unset($_SESSION['perm_admin']);
$GLOBALS['db']->Query("UPDATE " . PREFIX . "_benutzer SET Zuletzt_Aktiv = '" . time() . "' WHERE Id = '" . $_SESSION['benutzer_id'] . "'");
$row_land = $GLOBALS['db']->RowQuery("SELECT LandCode FROM " . PREFIX . "_benutzer WHERE Id = '" . $_SESSION['benutzer_id'] . "' AND Kennwort = '" . $_SESSION['login_pass'] . "'");
if(is_object($row_land)){
$_SESSION['user_country'] = $row_land->LandCode;
$row_perm = $GLOBALS['db']->RowQuery("SELECT Rechte,Rechte_Admin FROM " . PREFIX . "_berechtigungen WHERE Gruppe = '" . $_SESSION['user_group'] . "' AND Sektion = '$area'");
if(is_object($row_perm)){
$perms_arr = explode(',', $row_perm->Rechte);
foreach($perms_arr as $perm) $_SESSION['perm']["{$perm}{$area}"] = 1;
}
if(is_object($row_perm)){
$perms_arr = explode(',', $row_perm->Rechte_Admin);
foreach($perms_arr as $perm) $_SESSION['perm_admin']["{$perm}{$area}"] = 1;
}
} else {
if(isset($_SESSION['benutzer_id'])) unset($_SESSION['benutzer_id']);
$_SESSION['user_country'] = $GLOBALS['settings']['Land'];
$_SESSION['user_group'] = 2;
$_SESSION['benutzer_id'] = 0;
if(!defined('UID') || UID == '') define('UID', 2);
if(!defined('UGROUP')) define('UGROUP', 2);
if(!defined('UNAME')) define('UNAME', 'UNAME');
if(!defined('ISLOGGED')) define('ISLOGGED', 0);
if(isset($_SESSION['perm'])) unset($_SESSION['perm']);
$row_perm = $GLOBALS['db']->RowQuery("SELECT Rechte FROM " . PREFIX . "_berechtigungen WHERE Gruppe = '2' AND Sektion = '$area'" );
$perms_arr = explode(',', @$row_perm->Rechte);
foreach($perms_arr as $perm) $_SESSION['perm']["{$perm}{$area}"] = 1;
}
} else {
if(isset($_SESSION['benutzer_id'])) unset($_SESSION['benutzer_id']);
$group_settings = $GLOBALS['db']->RowQuery("SELECT MaxPn,MaxPn_Zeichen,MaxAnlagen,MaxZeichenPost FROM " . PREFIX . "_benutzer_gruppen WHERE Id = '2'");
define('MAXPN', 0);
define('MAXPNLENGTH', 0);
define('MAXATTCHMENT', $group_settings->MaxAnlagen);
define('MAXLENGTH_POST', $group_settings->MaxZeichenPost);
$_SESSION['user_country'] = $GLOBALS['settings']['Land'];
$_SESSION['user_group'] = 2;
$_SESSION['benutzer_id'] = 0;
define('UID', 2);
define('UGROUP', 2);
define('UNAME', 'UNAME');
define('ISLOGGED', 0);
if(isset($_SESSION['perm'])) unset($_SESSION['perm']);
$row_perm = $GLOBALS['db']->RowQuery("SELECT Rechte FROM " . PREFIX . "_berechtigungen WHERE Gruppe = '2' AND Sektion = '$area'");
$perms_arr = explode(',', @$row_perm->Rechte);
foreach($perms_arr as $perm) $_SESSION['perm']["{$perm}{$area}"] = 1;
}
$GLOBALS['tmpl']->assign('login', ISLOGGED);
$GLOBALS['tmpl']->assign('ugroup', UGROUP);
$GLOBALS['tmpl']->assign('langcount', count($config['lang']));
$GLOBALS['tmpl']->assign('languages', $config['lang']);
$GLOBALS['tmpl']->assign('langcodes', $langcodes);
$GLOBALS['tmpl']->assign('quicknavi', Quicknavi());
$GLOBALS['tmpl']->assign('maxattachment', MAXATTCHMENT);
$expire = time() + (60 * 10);
$GLOBALS['db']->Query("DELETE FROM " . PREFIX . "_benutzer_online WHERE Expire <= '" . time() . "'");
$sql = $GLOBALS['db']->Query("SELECT Ip FROM " . PREFIX . "_benutzer_online WHERE Ip='" . $_SERVER['REMOTE_ADDR'] . "' limit 1");
$num = $sql->numrows();
if(@$_SESSION['loggedin'] == 1){
$user_logged = $_SESSION['user_name'];
} else {
$user_logged = 'UNAME';
}
if ($num < 1){
$GLOBALS['db']->Query("INSERT INTO " . PREFIX . "_benutzer_online (Uid,Ip,Expire,Benutzername,Unsichtbar) VALUES ('" . $_SESSION['benutzer_id'] . "', '" . $_SERVER['REMOTE_ADDR'] . "','$expire','" . $user_logged . "','" . (isset($_SESSION['unsichtbar']) && $_SESSION['unsichtbar'] == 1 ? 'INVISIBLE' : '0') . "')");
} else {
$GLOBALS['db']->Query("UPDATE " . PREFIX . "_benutzer_online set Unsichtbar = '" . (isset($_SESSION['unsichtbar']) && $_SESSION['unsichtbar'] == 1 ? 'INVISIBLE' : '0') . "', Benutzername='" . $user_logged . "', Uid='" . $_SESSION['benutzer_id'] . "' WHERE Ip='" . $_SERVER['REMOTE_ADDR'] . "'");
}
include_once(BASE_DIR . '/lib/counter.php');
if(@$GLOBALS['Active']['langchooser']==1){
$GLOBALS['tmpl']->assign('langchooser', $tmpl->fetch($Source . '/langswitcher/switcher.tpl'));
}
$current = substr($_SERVER['REQUEST_URI'],-7);
$current_mr = substr($_SERVER['REQUEST_URI'],-10);
$GLOBALS['tmpl']->assign('printversion', (@$current=='print=1' || @$current_mr=='print.html') ? 1 : 0);
$inc = (isset($_REQUEST['p']) && $_REQUEST['p'] != '') ? $_REQUEST['p'] : 'index';
include_once(BASE_DIR . '/lib/setglobal.php');
$inc = eregi_replace('[^_a-zA-Z0-9]', '', $inc);
$tpl_fetch = BASE_DIR . '/theme/' . $config['std_theme'] . '/';
$_SESSION['Theme'] = $config['std_theme'];
if(defined('OUTPUT')){
include_once((!file_exists("system/{$inc}.php") ? "system/index.php" : "system/{$inc}.php") );
$out = (defined('NOOUT')) ? OUTPUT : $tmpl->fetch($tpl_fetch . TPL);
} else {
if($current=='print' || $current=='print=1' || (isset($_REQUEST['print']) && $_REQUEST['print']==1) || @$current_mr=='print.html'){
$GLOBALS['tmpl']->assign('printversion', 1);
define('PRINTVERSION', 1);
$_REQUEST['print'] = 1;
}
$gtpl = (!isset($_REQUEST['p']) || $_REQUEST['p']=='') ? 'index' : $_REQUEST['p'];
if(!file_exists(BASE_DIR . "/system/{$inc}.php")){
$_REQUEST['p'] = "index";
$include = BASE_DIR . "/system/index.php";
} else {
$include = BASE_DIR . "/system/{$inc}.php";
}
if($_REQUEST['p']!='showforums' && $_REQUEST['p']!='showforum' && $_REQUEST['p']!='showtopic' && $_REQUEST['p']!='forum' && $_REQUEST['p']!='members' && $_REQUEST['p']!='movepost' && $_REQUEST['p']!='newtopic' && $_REQUEST['p']!='newpost' && $_REQUEST['p']!='pn'){
if(VERSION == 'PRO'){
include_once(BASE_DIR . '/lib/shopinit.php');
$shop = new Shop;
$TimeTill = 86400 * 14;
$GLOBALS['db']->Query("DELETE FROM " . PREFIX . "_shop_warenkorb WHERE ZeitBis+{$TimeTill} < '".time()."'");
if(!isset($_SESSION['unique_visitor_number'])){
$_SESSION['unique_visitor_number'] = textrandom(10);
}
if(isset($_SESSION['benutzer_id']) && $_SESSION['loggedin'] == 1){
$ZeitBis = time() + $shop->_basket_cookietime;
$ZeitBisRaw = date('d.m.Y, H:i:s',$ZeitBis);
$check = $GLOBALS['db']->RowQuery("SELECT COUNT(Id) AS Bcount FROM " . PREFIX . "_shop_warenkorb WHERE Benutzer = '".$_SESSION['benutzer_id']."' AND Gesperrt != '1' AND EingeloestAm = '0' AND Code != '".$_SESSION['unique_visitor_number']."'");
if(is_object($check) && $check->Bcount >= 1){
$GLOBALS['tmpl']->assign('Bcc', $check);
$GLOBALS['tmpl']->assign('Baskets', true);
}
}
}
}
include_once($include);
if(!defined('AJAX_OUTPUT')) $out = (isset($_GET['blanc']) && $_GET['blanc']==1) ? $tmpl->fetch($tpl_fetch . '/page/popup.tpl') : $tmpl->fetch($tpl_fetch . (($current=='print' || $current=='print=1' || (isset($_REQUEST['print']) && $_REQUEST['print']==1) || @$current_mr=='print.html') ? 'page/print.tpl' : 'page/' . getTpl($_REQUEST['p'])) );
}
if(!defined('AJAX_OUTPUT')){
echo ($out);
$Ausgabe = ob_get_contents();
ob_end_clean();
$Ausgabe = str_replace('index.php&lang=', 'index.php?lang=', $Ausgabe);
$base = substr($_SERVER['PHP_SELF'],0,-9);
$Ausgabe = str_replace('%%ECRUOS_GMI_IBOOK%%', $base, $Ausgabe);
$Ausgabe = str_replace('index.php&mode=rss', 'index.php?mode=rss', $Ausgabe);
$Ausgabe = str_replace('<br type="_moz" />', '', $Ausgabe);
include_once(BASE_DIR . '/functions/Func.ReplacementIndex.php');
$Ausgabe = PageReplacements($Ausgabe);
$Ausgabe = IndexReplacement($Ausgabe);
if($GLOBALS['settings']['use_seo'] == 1){
include_once(BASE_DIR . '/functions/Func.Rewrite.php');
$Ausgabe = Seo($Ausgabe);
}
$view = new CompressorView();
$user_agent = new UserAgent();
if(substr(phpversion(),0,1) == 5) {
$jsmin = new JSMin($contents);
}
$compressor = new Compressor(array('view'=>$view, 'options'=>$config_cashe, 'jsmin'=>$jsmin, 'user_agent'=>$user_agent));
echo $Ausgabe;
$compressor->finish();
}
?>