DebugOn(); // $xajax->processRequest(); $default_dir = "modules"; //katalog do includowania if(!($dp = opendir($default_dir))) die("Nie mogę otworzyć folderu $default_dir"); while($file = readdir($dp)) if(preg_match('/\S+\.php/',$file) ) { $path = $default_dir.'/'.$file; @include_once "$path"; } closedir($dp); #include "licznik.php"; #utils_licznik('34','2'); auth (); $a_a = array(); //$a_a[10] = array("variable" => "","tpl" => "","fc" => "", "tekst" => ""); $r = mysql_query("select id, link_typ,nazwa".lg." as nazwa,id_tekst_kat, id_tekst,id_parent,site, aktywny,id_menu,url,mediabar from linki order by kolej ASC") or die(mysql_error()); while ($t = mysql_fetch_assoc($r)) { switch ($t['link_typ']) { case 1://komisje $a_a[$t['id_parent']][$t['id']] = array("tpl" => "komisje.tpl", "tekst" => $t['nazwa'], "variable" => "list", "fc" => "rady();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 2://wydzialy $a_a[$t['id_parent']][$t['id']] = array("tpl" => "wydzialy.tpl", "tekst" => $t['nazwa'], "variable" => "list", "fc" => "wydzialy(1);","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 4://prawo lokalne $a_a[$t['id_parent']][$t['id']] = array("tpl" => "prawo_lokalne.tpl", "tekst" => $t['nazwa'], "variable" => "list", "fc" => "prawo_lokalne();","prawa" => 0,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 5: //posiedzenia $a_a[$t['id_parent']][$t['id']] = array("tpl" => "posiedzenia.tpl", "tekst" => $t['nazwa'], "variable" => "list", "fc" => "posiedzenia();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 6: //univ $id_tekst = (isset($_GET['id']) ? $_GET['id'] : ($t['id_tekst'] == true ? $t['id_tekst'] : 0)); $a_a[$t['id_parent']][$t['id']] = array("variable" => "news", "tpl" => "news.tpl","pokaz" => $t['site'], "fc" => "news('".$t['id_tekst_kat']."','".$id_tekst."');", "tekst" => $t['nazwa'],"prawa" => ($id_tekst == true ? "0" : "1"),"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 7: //galeria $a_a[$t['id_parent']][$t['id']] = array("tpl" => "galeria.tpl", "tekst" => $t['nazwa'],"prawa" => 0,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 9: // kontakt // $a_a[$t['id_parent']][$t['id']] = array("tpl" => "kontakt.tpl", "tekst" => $t['nazwa'],"prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent']); $id_tekst = (isset($_GET['id']) ? $_GET['id'] : ($t['id_tekst'] == true ? $t['id_tekst'] : 0)); $a_a[$t['id_parent']][$t['id']] = array("variable" => "news", "tpl" => "kontakt.tpl","pokaz" => $t['site'], "fc" => "news('".$t['id_tekst_kat']."','".$id_tekst."');", "tekst" => $t['nazwa'],"prawa" => ($id_tekst == true ? "0" : "1"),"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; # case 8://ankiety # $a_a[$t['id_parent']][$t['id']] = array("tpl" => "ankiety.tpl", "tekst" => $t['nazwa'], "variable" => "ankiety", "fc" => "ankiety();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent']); # break; # case 10: //kartki # $a_a[$t['id_parent']][$t['id']] = array("tpl" => "kartki.tpl", "tekst" => $t['nazwa'],"prawa" => 0,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent']); # break; case 11://jednostki $a_a[$t['id_parent']][$t['id']] = array("tpl" => "jednostki.tpl", "tekst" => $t['nazwa'], "variable" => "list", "fc" => "wydzialy(2);","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 12://stowarzyszenia $a_a[$t['id_parent']][$t['id']] = array("tpl" => "stowarzyszenia.tpl", "tekst" => $t['nazwa'], "variable" => "list", "fc" => "wydzialy(3);","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 13: //ksiega gosci $a_a[$t['id_parent']][$t['id']] = array("tpl" => "ksiega.tpl", "tekst" => $t['nazwa'], "variable" => "ks", "fc" => "ksiega_gosci();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 14://parabola czasu $a_a[$t['id_parent']][$t['id']] = array("tpl" => "parabola_czasu.tpl", "tekst" => $t['nazwa'], "prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 15://tapety $a_a[$t['id_parent']][$t['id']] = array("tpl" => "tapety.tpl", "tekst" => $t['nazwa'],"prawa" => 0,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; # case 18: // linkownia # $a_a[$t['id_parent']][$t['id']] = array("tpl" => "linki.tpl", "tekst" => $t['nazwa'], "variable" => "linki", "fc" => "linki();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent']); # break; case 16:// $a_a[$t['id_parent']][$t['id']] = array("tpl" => "mapa_serwisu.tpl", "tekst" => $t['nazwa'], "variable" => "menu", "fc" => "menu();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 17:// $a_a[$t['id_parent']][$t['id']] = array("tpl" => "imprezy.tpl", "tekst" => $t['nazwa'],"variable" => "imp", "fc" => "imprezy();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; case 18:// $a_a[$t['id_parent']][$t['id']] = array("tpl" => "media/media.tpl", "tekst" => $t['nazwa'],"variable" => "media","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); require_once( 'media2.class.php' ); break; break; case 20:// subskrypcja $a_a[$t['id_parent']][$t['id']] = array("tpl" => "sub.tpl", "tekst" => $t['nazwa'], "variable" => "sub", "fc" => 'sub();',"prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "id_menu" => $t['id_menu'], "pozycja_podmenu" => $t['pozycja_podmenu'], "mediabar" => $t['mediabar']); break; /* case 21: // media tmp new $a_a[$t['id_parent']][$t['id']] = array("tpl" => "media/media.tpl", "tekst" => $t['nazwa'],"variable" => "media","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent']); require_once( 'media2.class.php' ); break; */ case 22://ankiety $a_a[$t['id_parent']][$t['id']] = array("tpl" => "ankiety.tpl", "tekst" => $t['nazwa'], "variable" => "ankiety", "fc" => "ankiety2();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu']); break; case 36://startpage $a_a[$t['id_parent']][$t['id']] = array("tpl" => "startpage.tpl", "tekst" => $t['nazwa'], "variable" => "startpage", "fc" => "startpage();","prawa" => 1,"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; default: $a_a[$t['id_parent']][$t['id']] = array("tekst" => $t['nazwa'],"pokaz" => $t['site'],"aktywny" => $t['aktywny'],"url" => $t['url'], "id_menu" => $t['id_menu'], "id_parent" => $t['id_parent'], "mediabar" => $t['mediabar']); break; } } $par2 = array(); foreach($a_a as $tmp_par => $tmp) { if (!$a_get) $a_get = (array_key_exists($_GET['a'],$tmp) ? $_GET['a'] : false); $par2[] = $tmp_par; } if (!$QUERY_STRING) { $a_get = 31; $_GET['a'] = 31; } else { if (!$a_get) { $a_get = 31; $_GET['a'] = 31; } } $gmina = new Smarty; $gmina->assign( 'lg', lg ); // $gmina->assign( 'par', $par2 ); foreach($a_a as $parent => $p) { if (!$par) $par = ((array_key_exists($a_get,$a_a) == true or array_key_exists($a_get,$p) == true) ? $parent : 0); } $menu = array(); //menu jednopoziomowe #foreach($a_a[$par] as $id => $mn) { # $menu[] = array("id" =>$id, "nazwa" => $mn['tekst']); #} $i=0; foreach($a_a[0] as $par_ => $mn) { if ($mn['pokaz'] == true) { if ($_GET['a'] == $par_) { $link_active = 1; } else { $link_active = 0; } // if (file_exists("images/buttons/$par_.gif")) { $menu_img = 1; } // else { $menu_img = 0; } $tmp = array("id" => $par_, "nazwa" =>$mn['tekst'],"url" =>$mn['url'],"klik" => $mn['aktywny'], "menu_img" => $menu_img, "link_active" => $link_active, "id_menu" => $mn['id_menu'] ); $menu_img = 0; if (is_array($a_a[$par_])) { foreach($a_a[$par_] as $par2 => $mn2) { if ((int)$par2 == (int)$a_get or $par_ == $a_get) { $id_top_nag = $i; } if ($mn2['pokaz'] == true) { if ($_GET['a'] == $par2) { $link_active = 1; } else { $link_active = 0; } $tmp['dzialy'][] = array("id" => $par2, "nazwa" => $mn2['tekst'],"url" =>$mn2['url'],"klik" => $mn2['aktywny'], "link_active" => $link_active, "id_menu" => $mn2['id_menu'], "id_parent" => $mn2['id_parent'] ); /* // podmenu aktywnego menu print "
id: ". $par2. " parent: ". $mn2['id_parent']. " a_get: ".$a_get; if ($a_get == $par_ || $par_ == $mn2['id_parent']) { $menuSub[] = array("id" => $par2, "nazwa" => $mn2['tekst'],"url" =>$mn2['url'],"klik" => $mn2['aktywny'], "link_active" => $link_active, "id_menu" => $mn2['id_menu'], "id_parent" => $mn2['id_parent'] ); } */ } } } $menu[] = $tmp; $i++; } } #$gmina -> assign('id_top_nag',$id_top_nag); $gmina -> assign('menu',$menu); # obrazki menu #$r = mysql_query("select id, link_typ,nazwa".lg." as nazwa,id_tekst_kat, id_tekst,id_parent,site, aktywny from linki order by kolej ASC") or die(mysql_error()); #while ($t = mysql_fetch_assoc($r)) { #} #else $gmina -> assign('menu',$menu[$id_top_nag]); //menu \\ if ($_GET['debug'] == true) $gmina -> debugging = true; $gmina -> assign('a_get',$a_get); #$gmina -> assign('menu_img', $menu_img); #$gmina -> assign('losowa_ankieta',losowa_ankieta()); #$gmina -> assign('losowa_fotka',losowa_fotka()); //prawa strona # $gmina -> assign('prawa',($a_a[$par][$a_get]['prawa'] == true ? 1 : 0)); # if ($a_a[$par][$a_get]['prawa']) { # $index = (count($prawa_cfg[$a_get]) ? $a_get : "def"); # foreach($prawa_cfg[$index] as $tmp) { # $tmp_[] = array("kat" => dane_kat($tmp),"dane" => news($tmp,0,1)); # } # $gmina -> assign('prawa_dane',$tmp_); # } //\\ //wywoalnie funkcji z $a_a jezeli zawiera sie on w jakims parencie //die($a_a[$par][$a_get]['fc']); if ($a_get && function_exists(substr($a_a[$par][$a_get]['fc'],0,strpos($a_a[$par][$a_get]['fc'],"(")))) { $tmp = '$return = '.$a_a[$par][$a_get]['fc']; eval ($tmp); $gmina -> assign($a_a[$par][$a_get]['variable'],$return); } if ($a_get) { if ($a_a[$par][$a_get]['tpl']) $gmina -> assign("tpl", $a_a[$par][$a_get]['tpl']); if ($a_a[$par][$a_get]['tekst']) $gmina -> assign("naglowek",array("nazwa" => $a_a[$par][$a_get]['tekst'],"id" => $id_top_nag)); } //jezeli $par = $a_get; if (function_exists(substr($a_a[0][$a_get]['fc'],0,strpos($a_a[0][$a_get]['fc'],"(")))){ $tmp = '$return = '.$a_a[0][$a_get]['fc']; eval ($tmp); $gmina -> assign($a_a[0][$a_get]['variable'],$return); if ($a_a[0][$a_get]['tpl']) $gmina -> assign("tpl", $a_a[0][$a_get]['tpl']); if ($a_a[0][$a_get]['tekst']) $gmina -> assign("naglowek",array("nazwa" => $a_a[0][$a_get]['tekst'])); } #$curr_date = date // do podmenu z danej grupy only list($active_parent, $active_parent_name, $id_menu, $mediabar) = mysql_fetch_row(mysql_query("SELECT linki.id_parent,p.nazwa".lg." as nazwa,linki.id_menu,p.mediabar FROM linki LEFT JOIN linki as p ON p.id = linki.id_parent WHERE linki.id='$a_get'")); // print mysql_error(); if (!$active_parent) { $active_parent = $a_get; list($mediabar) = mysql_fetch_row(mysql_query("SELECT mediabar FROM linki WHERE id='".$active_parent."'")); } $gmina -> assign('active_parent',$active_parent); // $gmina -> assign('prawa_strona', rekord('3')); // $gmina -> assign('mapa_dzialy', rekord('4')); if( $active_parent ) { $gmina->assign( "parent", $active_parent_name ); } // PODMENU DLA MENU AKTYWNEGO /*$menuSubTmp = mysql_query("SELECT id, link_typ,nazwa".lg." as nazwa,id_tekst_kat, id_tekst,id_parent,site as link_active, aktywny as klik ,id_menu,url FROM linki WHERE id_parent='".$active_parent."' ORDER BY kolej"); $menuSub = array(); while ($menuSubRows = mysql_fetch_assoc($menuSubTmp)) { $menuSub[] = $menuSubRows; } $gmina -> assign ('menuSub', $menuSub); */ if ($mediabar == '1' && !$_GET['id'] && !$_GET['id_zdarzenie']) $gmina -> assign('media', "1"); /* $gmina->assign("id_menu_active", $id_menu); */ #$gmina->assign( "licznik",$ile ); // zdjecie w lewym rogu /* if (file_exists("images/left1_".$a_get.".jpg")) { $img_left1 = "left1_".$a_get.".jpg"; } else { $img_left1 = "left1.jpg"; } $gmina -> assign('img_left1', $img_left1); */ //$xajax->processRequests(); //$gmina -> assign ('xajaxjs', $xajax->getJavascript() ); //banery //$gmina -> assign('banery', banery($a_get,$active_parent)); //$gmina -> assign('do_pobrania', pliki_do_pobrania('10')); //$gmina -> assign('startpage', startpage()); //$gmina->assign('licznik', $ile); $gmina -> display('index.tpl'); ?>