$item) $_POST[$keys] = addslashes($item); require_once('libs/Smarty.class.php'); $smarty = new Smarty; $smarty->template_dir = 'style/'.$_CONFIG['style'] .'/'; $smarty->compile_dir = 'temp/templates_c/'; $smarty->config_dir = 'temp/configs/'; $smarty->cache_dir = 'temp/cache/'; //połaczenie z mysql @$sql_conn = mysql_connect($db['host'], $db['user'], $db['pass'])or die('DB Error');mysql_select_db($db['name']);unset($db); //////////////////////////////////////// //$a=$_GET['a']; include('module/function.php'); include('module/useronline.php'); include('module/menu.php'); include('files/banners.php'); //$antiflood=$_CONFIG['antiflood']; if ($_GET['a']=='reg'){include ('module/register.php');} if ($_GET['a']=='login'){include ('module/login.php');} if ($_GET['a']=='losepass'){include ('module/losepass.php');} if ($_GET['a']=='logout'){include ('module/logout.php');} if ($_GET['a']=='profil'){include ('module/profil.php');} if ($_GET['a']=='sitemap'){include ('module/sitemap.php');} if ($_GET['a']=='sitemap1'){include ('module/sitemap1.php');} if ($_GET['a']=='pm'){include ('module/pm.php');} if ($_GET['a']=='infopage'){include ('module/infopage.php');} if ($_GET['a']=='mod'){include ('module/moderator.php');} if ($_GET['a']=='commentsedit'){include('module/comments_edit.php');} //if ($user_type>=9){ //global moderator //$type_activ=0; //wszystkie posty //} if ($_GET['a']=='premium'){include ('module/premium.php');} if ($_GET['a']=='search'){include ('module/search.php');} if ($_GET['a']=='u'){include ('module/u.php');} //użytkownik jego profil np. www.panicz.pl/oliwia if(($_GET['a']=='')&(($_GET['com']=='')||($_GET['com']=='0'))){$_GET['com']=$_CONFIG['com']; } if ($_GET['com']){ include ('components/'.$_GET['com'].'/lang/'.$_CONFIG['lang'].'/index.php'); include ('components/'.$_GET['com'].'/config.php'); include ('components/'.$_GET['com'].'/function.php'); include ('components/'.$_GET['com'].'/index.php'); $components_links=components_links($user_type,$user_id); //przyciski danego komponentu } //aktywacja konta przez email if ($_GET['a']=='activ'){ $tpl='msg'; if ($_CONFIG['activ']=='0') { $key=safe_mini_text($_GET['b'],'20'); $q = "UPDATE `{$prefix2}users` SET `type`='1' WHERE `keyid`='$key' AND `type`='0'"; $res = mysql_query($q); if($res) { //konto aktywowano $msg= array('txt'=>$L['activ1'],'style'=>$style,'goto'=>'index.php'); } } else { //aktywacja zamknięta $msg= array('txt'=>$L['activ2'],'style'=>$style,'goto'=>'index.php'); } $smarty->assign('msg', $msg); } /* //login if ($_GET['a']=='login'){ $tpl='login'; $_CONFIG['site_title']=$_CONFIG['site_name'].' - '.$L['login']; if ($user_type>'0') { $tpl='msg'; $msg= array('txt'=>$L['user'].': '.$user_nick.'','style'=>$style,'goto'=>'index.php'); } else { if ($_GET['b']=='') { $msg= array('spamkey'=>code_key($key_spam), 'goto'=>'index.php'); } } //$smarty->assign('dane', $dane); if ($_GET['b']=='save'){ $tpl='msg'; $date=time(); // $key_=$_POST['title']; $nick=safe_mini_text($_POST['nick'],'16'); $pass=safe_mini_text($_POST['pass'],'16'); $key=safe_mini_text($_POST['key'],'20'); //$key=$_POST['key']; // $mail=$_POST['mail']; if (decode_key($key,$_CONFIG['sesiontime'])==TRUE){ $query = "SELECT * FROM `{$prefix2}users` WHERE nick='$nick' AND `type`>'0'"; $result = mysql_query($query); $ile = mysql_num_rows($result); if ($ile>0){ while($r = mysql_fetch_assoc($result)) { $pass=md5($key_user.'-'.$pass); if (($pass==$r['pass'])&($nick==$r['nick'])&($nick!='')&($_POST['pass']!='')) { $msg= array('txt'=>$L['welcome'].': '.$nick,'style'=>$style,'goto'=>'index.php'); $id=$r['id']; $type=$r['type']; $premium=$r['premium']; $czas=time(); $key=md5('i'.$r['nick'].'s'.$czas.'r'); $ip=$_SERVER['REMOTE_ADDR']; mysql_query("INSERT INTO `{$prefix2}useronline` VALUES('$nick','$ip','$czas','$type','$key','$id','$spam','$premium')"); $q = "UPDATE `{$prefix}users` SET `lastlogin`='$czas' WHERE `id`='$id'"; $res = mysql_query($q); $_SESSION['nick']=$key; if (($_CONFIG['autologin']=='1')&($_POST['txt']=='ON')) { $cookie=$nick.','.md5($nick.'-'.$pass).','; setcookie("login", $cookie, time()+1000000); } } else { unset($_SESSION['nick']); session_destroy(); $msg= array('txt'=>$L['err'],'style'=>$style,'goto'=>'index.php'); break; } } } else {$msg= array('txt'=>$L['err'],'style'=>$style,'goto'=>'index.php'); session_destroy();} } else {$msg= array('txt'=>$L['timeout'],'style'=>$style,'goto'=>'index.php'); session_destroy();} } $smarty->assign('msg', $msg); } //koniec logowanie */ //menu include ('module/menublok.php'); //koniec menu // ustalamy napis w tagu if($_GET['page']>0){$idik=' '.$idik.$_GET['page'];} if(($_CONFIG['menu_title'])&($_CONFIG['site_title'])){$_CONFIG['site_title']=$_CONFIG['menu_title'].$idik;} if(($_CONFIG['menu_title'])&($_CONFIG['post_title'])){$_CONFIG['site_title']=$_CONFIG['post_title'];} //$user_links= user_links($user_type,$user_id, $user_nick); //include ('module/ad.php'); //////////////////banner if ($_CONFIG['menu_left']!=1){$_CONFIG['menu_c']=$_CONFIG['menu_c']+$_CONFIG['menu_l'];} if ($_CONFIG['menu_right']!=1){$_CONFIG['menu_c']=$_CONFIG['menu_c']+$_CONFIG['menu_r'];} //$index=array(); //...tutaj zapytania i kod odpiweidzlany za includowanie odpwiedniego pliku oraz assigny) if(empty($tpl)){$tpl='smarty';} $index= array('id'=>$r['id'], 'pages'=>page($_GET['page'],$ile,$_CONFIG['limit']), 'javascript'=>$javascript, 'tpl'=>$tpl.'.tpl', 'msg'=>$msg, 'style'=>$_CONFIG['style'], 'banner1'=>$banner[1], 'banner2'=>$banner[2], 'banner3'=>$banner[3], 'menu'=>$menu, 'text'=>$r['text'], //'menu_c'=>$_CONFIG['menu_c'], //'menu_left'=>$menu_left, // 'menu_right'=>$menu_right, 'user_links'=>user_links($user_type,$user_id,$user_nick), 'components_links'=>$components_links, //'site_description'=>$site_description, //'site_keywords'=>$site_keywords, //'site_title'=>$site_title, 'site_url'=>$site_url); $my_cache_id = ''.$_GET['page'].','.$_GET['ih'].','.$_GET['idcat'].','.$_GET['o'].','.$_GET['id'].','.$_GET['b'].''; //if(!$smarty->is_cached('index.tpl',$my_cache_id)) { //} $smarty->assign('l', $L); //lang $smarty->assign('c', $_CONFIG); $smarty->assign('index', $index); $smarty->display('index.tpl',$my_cache_id); mysql_close($sql_conn); //if ($smarty->is_cached('index.tpl', $my_cache_id) == TRUE){ // print "yes"; //} else if ($smarty->is_cached('index.tpl', $my_cache_id) == FALSE){ // print "no"; //} echo $_COOKIE['login']; $na_koncu = podaj_czas(); echo $na_koncu - $na_poczatku; ?>