sql_query("select * from data where lang_id=$lid and offline=0 and subject<>'' order by sort,date desc"); while ($row=$db->sql_fetchrow($res)) { $sitedata[id][$row[id]]=$row; $sitedata[parent][$row[parent_id]][$row[id]]=$row; $sitedata[parent_foldername][$row[parent_id]][$row[foldername]]=$row; $sitedata[gr][$row[parent_id]][$row[group]][$row[id]]=$row; if ($row[parent_id]==0 && $row[usefile]=='home' ) {$homepp=$row[id];} } $pp=0;$mainid=0; $mainid2=0;$mainid3; $idmas=Array(); $mas=split("/",$_SERVER["REQUEST_URI"]); if (is_array($mas)) { foreach ($mas as $kk=>$ff) { $row=$sitedata[parent_foldername][$pp][$ff]; if ($row[for_login_users]==1) {$for_login_users=1;} if ($faculty[data_id]==$row[parent_id]) {$faculty_subid=$row[id];} if ($faculty_subid==$row[parent_id]) {$faculty_subid2=$row[id];} if ($department[data_id]==$row[parent_id]) {$department_subid=$row[id];} if ($department_subid==$row[parent_id]) {$department_subid2=$row[id];} if ($sitedata[parent_foldername][$pp][$ff]) { $pp=$sitedata[parent_foldername][$pp][$ff][id]; $idmas[]=$pp; } elseif ($sitedata[id][$pp][folder]==2 && $sitedata[id][$ff]) { $pp=$ff; $idmas[]=$ff; $id2=$ff; } } } $mainid=$idmas[0]; $mainid2=$idmas[1]; $mainid3=$idmas[2]; if ($pp==0) { $pp=$homepp; $mainid=$pp; } $id=$pp; $usefile=$sitedata[id][$pp][usefile]; $menuname=$sitedata[id][$pp][subject]; $row=$sitedata[id][$pp]; if ($lang=='ge') {$monthmas=$monthmas_ge;$weekdaymas=$weekdaymas_ge;} $langmas[en]=str_replace("/$lang/","/en/",$_SERVER["REQUEST_URI"]); $langmas[ge]=str_replace("/$lang/","/ge/",$_SERVER["REQUEST_URI"]); $langmas[en]=ereg_replace("\/".$lang."$","/en",$langmas[en]); $langmas[ge]=ereg_replace("\/".$lang."$","/ge",$langmas[ge]); $menu1loop=getmenuloop7($lid,$id,1,2); $menu2loop=getmenuloop7($lid,$id,2,3); $bottom_text=get_text_by_group($lid,201); $left_text=get_text_by_group($lid,205); //$image_folder = $_SERVER['DOCUMENT_ROOT'].'/i'; if ($usefile && file_exists("mods/".$usefile.".php")){} else {$usefile='home';} require "mods/".$usefile.".php"; $smarty=install_smarty(); $smarty->assign('lang',$lang); $smarty->assign('id',$id); $smarty->assign('usefile',$usefile); $smarty->assign('mainid',$mainid); //$smarty->assign('image_folder',$image_folder); $smarty->assign('menu1loop',$menu1loop); $smarty->assign('menu2loop',$menu2loop); $smarty->assign('left_text',$left_text); $smarty->assign('bottom_text',$bottom_text); $smarty->assign('out',$out); $smarty->assign('q',str_replace("'","",$_GET["q"])); print $smarty->fetch("index.tpl.php"); ?>