dbhost,$CFG->dbuser,$CFG->dbpass,$CFG->dbname,$CFG->dbprefix); } catch (dbException $e) { //!!!hibak?ld?s e-mail c?mre!!! include('skins/database_connect.tpl'); die(); } // set up smarty engine include('smarty/config.inc'); // session start session_set_cookie_params(0,'/','.'.$CFG->domainroot); session_start (); // get _GET, _POST and _COOKIE vars $G=new PARAMS(); $P=new PARAMS("POST"); $C=new PARAMS("COOKIE"); $cms_error=''; $cms_notify=''; $submenu=array(); //check loggedin include('./loggedin.inc'); //is admin page? if ($C->adminpage==="true" or strpos($_SERVER["SCRIPT_NAME"],'admin.php')!==false) { require_admin('any'); define('IS_ADMIN_PAGE',true); } else define('IS_ADMIN_PAGE',false); $smarty->assign('IS_ADMIN_PAGE',IS_ADMIN_PAGE); $JSON=new JSON_WRAPPER(); //define module $MODULE=$G->getit("module",false,"POST,GET"); if ($MODULE=="") $MODULE="oldal"; //define target $TARGET=$G->getit("target","false","POST,GET"); //define action $ACTION=$G->getit("action","false","POST,GET"); if (IS_ADMIN_PAGE && $MODULE=='index' && $TARGET=='' && $ACTION=='') { $MODULE='oldal'; $TARGET='welcome_admin'; } $index_tpl_name=""; get_next_message(); $active_modules=array(); //load modules if (is_dir("modules/")) { if ($dh = opendir("modules/")) { while (($file = readdir($dh)) !== false) { if (substr($file,0,1)!=".") $active_modules[]=$file; } closedir($dh); } } //pre_index.inc foreach ( $active_modules as $module_name ) { if (IS_ADMIN_PAGE && is_file ( "modules/" . $module_name . "/pre_admin.inc" )) { include ("modules/" . $module_name . "/pre_admin.inc"); } if (is_file ( "modules/" . $module_name . "/pre_index.inc" )) { include ("modules/" . $module_name . "/pre_index.inc"); } } $smarty->assign('TARGET',$TARGET); //A f?oldal tpl-je. (Egy pre_index-b?l megv?ltoztathat?) if ($index_tpl_name == "") { if (IS_ADMIN_PAGE) $index_tpl_name = "admin_frame.tpl"; else $index_tpl_name="frame.tpl"; } //module.inc f?jlok import?l?sa az akt?v modulokb?l foreach ( $active_modules as $module_name ) { if (IS_ADMIN_PAGE && is_file ( "modules/" . $module_name . "/admin_module.inc" )) { include ( "modules/" . $module_name . "/admin_module.inc"); } if (is_file ( "modules/" . $module_name . "/module.inc" )) { include ( "modules/" . $module_name . "/module.inc"); } } $index_body = ""; //A megnyitott modul index.inc f?lj?nak import?l?sa. if (IS_ADMIN_PAGE) { if (in_array ( $MODULE, $active_modules ) && is_file ( 'modules/'.$MODULE.'/admin.inc' )) include ( 'modules/'.$MODULE.'/admin.inc'); } else { if (in_array ( $MODULE, $active_modules ) && is_file ( 'modules/'.$MODULE.'/index.inc' )) include ( 'modules/'.$MODULE.'/index.inc'); } //post_index.inc f?jlok import?l?sa az akt?v modulokb?l foreach ( $active_modules as $module_name ) { if (IS_ADMIN_PAGE && is_file ( "modules/" . $module_name . "/post_admin.inc" )) { include ( "modules/" . $module_name . "/post_admin.inc"); } if (is_file ( "modules/" . $module_name . "/post_index.inc" )) { include ( "modules/" . $module_name . "/post_index.inc"); } } $smarty->assign ( "body", $index_body ); $smarty->assign ( "scripts_dom_onload" , join("\n",$scripts_dom_onload)); $smarty->register_outputfilter ( "add_styles" ); $smarty->register_outputfilter ( "change_skin_path" ); $smarty->register_outputfilter ( "smarty_cms_errors" ); $smarty->register_outputfilter ( "smarty_cms_notify" ); if (isset($_COOKIE["language"])) { if ($_COOKIE["language"]=="en") $smarty->assign('right_box',$smarty->fetch('right_box_en.tpl')); else $smarty->assign('right_box',$smarty->fetch('right_box.tpl')); } else $smarty->assign('right_box',$smarty->fetch('right_box.tpl')); $smarty->assign('submenu',$submenu); if (isset($_COOKIE["language"]) && ($index_tpl_name=="frame.tpl" || $index_tpl_name=="frame_en.tpl")) { if ($_COOKIE["language"]=="en") { if($TARGET=='rolunk' || $TARGET=='kezelesek'|| $TARGET=='arak'|| $TARGET=='kapcsolat'|| $TARGET=='kerdesek_es_valaszok'|| $TARGET=='kerdesek_es_valaszok2'|| $TARGET=='ceges_ajanlatok') { $index_tpl_name="frame.tpl"; $smarty->assign('right_box',$smarty->fetch('right_box.tpl')); } else { $index_tpl_name="frame_en.tpl"; $smarty->assign('right_box',$smarty->fetch('right_box_en.tpl')); } } if ($_COOKIE["language"]=="hu") { if($TARGET=='about_us_' || $TARGET=='treatments'|| $TARGET=='prices'|| $TARGET=='contact'|| $TARGET=='faq'|| $TARGET=='faq2'|| $TARGET=='offer_for_companies') { $index_tpl_name="frame_en.tpl"; $smarty->assign('right_box',$smarty->fetch('right_box_en.tpl')); } else { $index_tpl_name="frame.tpl"; $smarty->assign('right_box',$smarty->fetch('right_box.tpl')); } } } $out = $smarty->fetch ( $index_tpl_name ); echo $out; //Adatb?zis bez?r?sa. $DB->close (); die(); ?>