home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
79.96.193.101
/
79.96.193.101.tar
/
79.96.193.101
/
www
/
index.php
< prev
next >
Wrap
PHP Script
|
2014-10-20
|
10KB
|
318 lines
<?php
//============================================
// Easy 2.0
// Copyright : .exe Evolution
// Wersja : 2.0
// Uwagi : Brak
//============================================
ob_start();
$_global_start_time = microtime();
$_smarty_control_time = 0;
if(isset($_REQUEST['area']) && !is_numeric($_REQUEST['area']))
{
header("Location:index.php?area=1");
exit;
}
header("Content-type: text/html; charset=UTF-8");
define("BASEDIR", dirname(__FILE__));
define('AJAX', true);
require(BASEDIR . "/inc/init.php");
if(SSLMODE==1 && $_SERVER['SERVER_PORT']=='80') header("Location:".redir()."");
if(SSLMODE!=1 && $_SERVER['SERVER_PORT']=='443') header("Location:".redir()."");
define("HPURL", HTTPSSL . $_SERVER['HTTP_HOST'] . str_replace("/index.php", "", $_SERVER['PHP_SELF']) . "/");
if(isset($_REQUEST['p']) && $_REQUEST['p']=='shop' && ISSHOP != 1) header("Location:index.php");
if(isset($_REQUEST['p']) && $_REQUEST['p']=='register') header("Location:index.php?p=signup");
$expire = time() + (60 * 10);
$sql = $db->Query("DELETE FROM " . PREFIX . "_useronline WHERE expire <= '" . time() . "'");
$sql = $db->Query("SELECT ip FROM " . PREFIX . "_useronline WHERE ip='" . $_SERVER['REMOTE_ADDR'] . "' limit 1");
$num = $sql->numrows();
if ($num < 1)
$sql = $db->Query("INSERT INTO " . PREFIX . "_useronline (ip,expire,uname,invisible) VALUES ('" . $_SERVER['REMOTE_ADDR'] . "','$expire','" . UNAME . "','" . INVISIBLE . "')");
else
$sql = $db->Query("UPDATE " . PREFIX . "_useronline set uname='" . UNAME . "' WHERE ip='" . $_SERVER['REMOTE_ADDR'] . "'");
if (!isset($_REQUEST['p'])) {
$_REQUEST['p'] = "index";
$loader = "?";
}
$buffer = str_replace(array(":", "/", "..", ".", ";", "\\", "http", "ftp"), "", $_REQUEST['p']);
$sql = $db->Query("SELECT area_template,active FROM " . PREFIX . "_areas WHERE area_id='".(int)$area."'");
$row = $sql->fetchrow();
if ($row->active != 1) {
if (!($HTTP_SESSION_VARS['secpass' . $area])) {
$HTTP_SESSION_VARS['secpass' . $area] = $_GET['pass'];
}
$sql = $db->Query("SELECT pass,tmpl FROM " . PREFIX . "_areas WHERE area_id='".(int)$area."'");
$row = $sql->fetchrow();
if (($row->pass == "") || ($row->pass != $HTTP_SESSION_VARS['secpass' . $area])) {
$HTTP_SESSION_VARS['secpass' . $area] = "";
echo $row->tmpl;
exit();
}
}
if(AJAX) {
define('AJAX_DIR', BASEDIR.'/ajax/');
require_once(AJAX_DIR.'inc/ajax_init.php');
$tmpl = new Easy("templates/$THEME/");
$tmpl->assign('theme', $THEME);
$tmpl->assign('pref', $pref);
$tmpl->assign('lang', $lang);
if($show_start_div)
$tmpl->assign('show_start_div', 1);
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax']=='ajax') {
define('AJAX_REQUEST', true);
if(@include(AJAX_DIR.'request/'.$buffer.'.php')) {
exit;
}
}
}
else {
$tmpl = new Easy("templates/$THEME/");
$tmpl->assign('theme', $THEME);
$tmpl->assign('pref', $pref);
}
@include('inc/globals.php');
if(ISSHOP==1) {
if(!@include( BASEDIR . "/system/shop/shopinc.php"))
echo '<div><strong>Error:</strong> Shop could not be initialized.</div>';
}
if (!@include("system/$buffer.php"))
{
$EOUT = msg("error_once", "modulenotfound", str_replace("__URL__", "index.php", $lang['redirect']), "index.php");
$NOOUT = 1;
}
switch ($_REQUEST['p']) {
case "pic" :
case "gallerypic" : $template = fetchmaintemplate("27"); break;
case "misc" : $template = fetchmaintemplate("13"); break;
case "shopimage" : $template = fetchmaintemplate("55"); break;
case "userlist" : $template = fetchmaintemplate("14"); break;
case "manufacturer" : $template = fetchmaintemplate("22"); break;
case "tell" : $template = fetchmaintemplate("23"); break;
case "static" : $template = fetchmaintemplate("24"); break;
case "poll" : $template = fetchmaintemplate("25"); break;
case "faq" : $template = fetchmaintemplate("26"); break;
case "gallery" : $template = fetchmaintemplate("27"); break;
case "signup" :
case "register" : $template = fetchmaintemplate("28"); break;
case "pwlost" : $template = fetchmaintemplate("29"); break;
case "ignorelist" : $template = fetchmaintemplate("30"); break;
case "changedetails" : $template = fetchmaintemplate("31"); break;
case "changepw" : $template = fetchmaintemplate("32"); break;
case "pn" : $template = fetchmaintemplate("33"); break;
case "query" :
case "news" : $template = fetchmaintemplate("34"); break;
case "index" : $template = fetchmaintemplate("12"); break;
case "product": $template = fetchmaintemplate("36");break;
case "downloads": $template = fetchmaintemplate("40");break;
case "links": $template = fetchmaintemplate("43");break;
case "downloadfile": $template = fetchmaintemplate("42");break;
case "contact" : $template = fetchmaintemplate("45"); break;
case "articles" : $template = fetchmaintemplate("38"); break;
case "guestbook" : $template = fetchmaintemplate("47"); break;
case "calendar" : $template = fetchmaintemplate("50"); break;
case "shop" : $template = fetchmaintemplate("52"); break;
case "showforums" :
case "showforum" :
case "showtopic" :
case "newpost" :
case "addpost" :
case "move" :
case "deltopic" :
case "newcategory" :
case "newforum" :
case "forum";
case "newtopic" :
case "addpost" :
case "addtopic" : $template = fetchmaintemplate("35");
break;
default : $template = fetchmaintemplate("12");
}
if (!$template) $template = fetchmaintemplate("12");
$d = getdate(time());
$year = ($_REQUEST['easy_year'] != '') ? (int)$_REQUEST['easy_year'] : $d['year'];
$month = ($_REQUEST['easy_month'] != '') ? (int)$_REQUEST['easy_month'] : $d['mon'];
$cal = new EasyCalendar;
$tmpl->assign('simple_calendar', $cal->getMonthView($month, $year, 'calendar/calendar_small.tpl','1','small'));
if(ISSHOP==1)
{
$categs = array();
get_shop_categs_simple(0, '', $categs, $area);
$tmpl->assign('shopnavi', $categs);
}
if ($islogged == 1) {
$tmpl->assign("login", 1);
$tmpl->assign("name", $BENUTZER);
} else {
$tmpl->assign("login", 0);
$tmpl->assign("gast", $GROUPSINGLE);
}
if (permission("canpn")) {
$tmpl->assign('pn', 1);
} else {
$tmpl->assign('pn', 0);
}
if (permission("adminpanel")) {
$tmpl->assign('adminlink', 1);
}
switch ($_REQUEST['p']) {
case "index" :
case "" :
$printlink = "?area=$area&print=1";
break;
default :
$printlink = redir() . "&print=1";
}
$tmpl->assign('maxattachment', MAXATTACHMENT);
$tmpl->assign('disp_shortnews', $disp_shortnews);
$tmpl->assign('toggleimage_shortnews', $toggleimage_shortnews);
$tmpl->assign('toggletd_shortnews', $toggletd_shortnews);
$tmpl->assign('shortnews', $shortnews);
$tmpl->assign('homelink', "index.php?p=index&area=" . $area . "");
$tmpl->assign('forumlink', "index.php?area=" . $area . "&p=showforums");
$tmpl->assign('easyversion', KVERSION);
$tmpl->assign('redir', redir());
$tmpl->assign('titel', $pref['hpname']);
$tmpl->assign('aktuelleseite', $sname);
$tmpl->assign('index.php?', "index.php?area=$area&");
$tmpl->assign('area', $area);
$tmpl->assign('lang', $lang);
$tmpl->assign('document', getDocument());
$tmpl->assign('speedbar', speedbar($area));
$tmpl->assign('the_printlink', $printlink);
$tmpl->assign('telllink', "index.php?area=" . $area . "&p=tell&action=form");
$tmpl->register_function('printpanel', 'printpanel');
$languages = array();
$sql = $db->Query("SELECT area_id, lang FROM ".PREFIX."_areas GROUP BY lang");
while($row = $sql->fetchrow())
{
if(empty($row->lang))
$row->lang = $pref['lang'];
array_push($languages, $row);
}
$tmpl->assign('languages', $languages);
if ((isset($NOOUT) && $NOOUT == 1) || (isset($MISC) && $MISC == 1)) {
$tmpl->assign("content", $EOUT);
}
@setcookie ("real", 1);
$today = date("d-m-Y");
$sql = $db->Query("SELECT datum FROM " . PREFIX . "_sitestats WHERE datum='$today' LIMIT 1");
$isda = $sql->numrows();
if ($_SERVER['HTTP_REFERER'] != "") {
define("HOST", HTTPSSL . $HTTP_SERVER_VARS['HTTP_HOST']);
$host_1 = explode("//", HOST);
$host_1_1 = $host_1[1];
$host_1_1 = explode("/", $host_1_1);
$host_1_1 = $host_1_1[0];
$host_2 = explode("//", $_SERVER['HTTP_REFERER']);
$host_2_2 = $host_2[1];
$host_2_2 = explode("/", $host_2_2);
$host_2_2 = $host_2_2[0];
$referer = $_SERVER['HTTP_REFERER'];
$clientInfo = new Browser;
if ($host_1_1 != $host_2_2) {
$query_ref = "INSERT INTO " . PREFIX . "_referer (
id,
user_os,
user_ua,
user_referer,
datum
) VALUES (
'',
'" . $clientInfo->Platform . "',
'" . $clientInfo->Name . " " . $clientInfo->Version . "',
'$referer',
NOW()
)";
}
}
if ($isda<1) {
$sql = $db->Query("INSERT INTO " . PREFIX . "_sitestats (datum,hits,tag,monat,jahr) VALUES ('$today','1','" . date("d") . "','" . date("m") . "','" . date("Y") . "')");
if ($query_ref) $sql = $db->Query($query_ref);
}
if ( ($isda>0) && ($_COOKIE['real']==1) ) {
$sql = $db->Query("UPDATE " . PREFIX . "_sitestats SET hits=hits+1 WHERE datum='$today'");
if ($query_ref) $sql = $db->Query($query_ref);
}
if ( ($_COOKIE['real']==1) && ($_COOKIE['visited'] != $today) ) {
$sql = $db->Query("UPDATE " . PREFIX . "_sitestats SET visits=visits+1 WHERE datum='$today'");
setcookie ('visited', $today , time() + (3600 * 24));
}
if(AJAX && defined('AJAX_REQUEST') && AJAX_REQUEST) {
$prepage = $tmpl->fetch('container/empty.tpl');
}
elseif((isset($NOOUT) && $NOOUT == 1) || (isset($nometa) && $nometa == 1)) {
$tmpl->display('page/noheader.tpl');
}
elseif($_REQUEST['print'] == 1) {
printupdate();
$tmpl->assign('url', str_replace("&print=1", "", redir()));
$tmpl->assign('print', $lang['printpage']);
$prepage = $tmpl->fetch('page/print.tpl');
}
else {
$prepage = $tmpl->fetch($template);
}
if(MRWRITE==1){
if($_REQUEST['p'] != "showtopic" && $_REQUEST['p'] != "newpost" && $_REQUEST['p'] != "newtopic"){
if(file_exists('index_rewrite.php'))
include('index_rewrite.php');
}
}
$prepage = str_replace(array("index.php&print=1", "index.php&print=1"), "?print=1", $prepage);
$db->_timer = sprintf('%.2f', $db->_timer);
$_smarty_control_time = sprintf('%.2f', $_smarty_control_time);
$_end_time = sprintf('%.2f', microtime_diff($_global_start_time));
echo $prepage;
echo "\n<!-- {$_end_time} | {$db->_counter} | {$db->_timer} | {$_smarty_control_time} -->";
?>