//ini_set('session.use_cookies',1); //ini_set('session.use_trans_sid',0); session_save_path("/home/users/web/b2340/myd.robertmx/cgi-bin/tmp"); session_start(); include('includes/db.php'); include('includes/api.php'); $lang=substr($_SESSION['lang'],0,2); if($_GET['stan'])$_SESSION['stan']=$_GET['stan']; mysql_query('delete from `'.prefix().'ogloszenia` where `waznosc` < \''.now().'\''); if($lang)$index=open_template('index.html'); else $index=open_template('wstep.html'); $sep=' -> '; switch($_GET['p']){ case 'dict': $sciezka = $sep.''._P_DICT.''; $index=replace_in_template('podstrony',include 'includes/pages/dict.php',$index); break; case 'print': echo include 'includes/pages/print.php';break; case 'save': echo include 'includes/pages/ann.php';break; case 'content': $kategoria = mysql_fetch_array(mysql_query('select * from `'.prefix().'dzialy` where `id` = '.intval($_GET['n']))); $sciezka = $sep.''.$kategoria['nazwa'].''; $index=replace_in_template('podstrony',include 'includes/pages/content.php',$index);break; case 'admin': $sciezka = $sep.''._P_ADMIN.''; $index=replace_in_template('podstrony',include 'admin.php',$index); break; case 'cat': $kat=mysql_fetch_array(mysql_query('select * from `'.prefix().'ogloszenia_kategorie` where `id` ='.intval($_GET['catid']))); $sciezka = $sep.''.$kat['nazwa'].''; $index=replace_in_template('podstrony',include 'includes/pages/cat.php',$index); break; case 'ann': $kat=mysql_fetch_array(mysql_query('select * from `'.prefix().'ogloszenia` where `id` ='.intval($_GET['annid']))); $sciezka = $sep.''.$kat['tytul'].''; $index=replace_in_template('podstrony',include 'includes/pages/ann.php',$index); break; case 'answer': $kat=mysql_fetch_array(mysql_query('select * from `'.prefix().'ogloszenia` where `id` ='.intval($_GET['annid']))); $sciezka = $sep.''._A_TITLE.$kat['tytul'].''; $index=replace_in_template('podstrony',include 'includes/pages/answer.php',$index); break; case 'addann': $sciezka = $sep.''._P_ADDANN.''; $index=replace_in_template('podstrony',include 'includes/pages/addann.php',$index); break; case 'ankieta': $sciezka = $sep.''._P_POLL.''; $index=replace_in_template('podstrony',include 'includes/pages/ankieta.php',$index); break; case 'search': $index=replace_in_template('search_string_value',htmlentities(stripslashes($_REQUEST['search_str'])),$index); $index=replace_in_template('selected_lang_all',($_REQUEST['search_lang']==0?' selected="selected"':''),$index); $index=replace_in_template('selected_lang_pl',($_REQUEST['search_lang']=='pl'?' selected="selected"':''),$index); $index=replace_in_template('selected_lang_en',($_REQUEST['search_lang']=='en'?' selected="selected"':''),$index); $index=replace_in_template('selected_lang_bl',($_REQUEST['search_lang']=='bl'?' selected="selected"':''),$index); $index=replace_in_template('selected_checkbox',($_REQUEST['search_picture']=='on'?' checked="checked"':''),$index); $sciezka = $sep.''._RESULTS.''; $index=replace_in_template('podstrony',include 'includes/pages/search.php',$index); break; default: if($lang){ $template=open_template('main.html'); $cats=mysql_query('select * from `'.prefix().'ogloszenia` where aktywne=1 and (jezyk=\''.$lang.'\' or jezyk=\'bl\') '.state_query().' order by data desc limit 10'); $catst=''; $i=0; $num=mysql_num_rows($cats); while(($cat=mysql_fetch_array($cats))!==false){ $catt = open_template('ogloszenie.html'); $catt = replace_ann($catt,$cat); if($i==$num-1)$catt = str_replace('
','',$catt); $catst.=display_template($catt); $i++; } $template=replace_in_template('ogloszenia','