count($lang_list)) $_SESSION["current_language"] = 0; //set default language //include a language file if (isset($lang_list[$_SESSION["current_language"]]) && file_exists("./languages/".$lang_list[$_SESSION["current_language"]]->filename)) include("./languages/".$lang_list[$_SESSION["current_language"]]->filename); //include current language file else { die("ERROR: Couldn't find language file!"); } //connect to the database db_connect(DB_HOST,DB_USER,DB_PASS) or die (db_error()); db_select_db(DB_NAME) or die (db_error()); //get currency ISO 3 code $currency_iso_3 = (defined('CONF_CURRENCY_ISO3')) ? CONF_CURRENCY_ISO3 : "USD" ; $smarty->assign("currency_iso_3", $currency_iso_3); //and different vars... if (isset($_GET["register"]) || isset($_POST["register"])) $register = isset($_GET["register"]) ? $_GET["register"] : $_POST["register"]; if (isset($_GET["update_details"]) || isset($_POST["update_details"])) $update_details = isset($_GET["update_details"]) ? $_GET["update_details"] : $_POST["update_details"]; if (isset($_GET["order"]) || isset($_POST["order"])) $order = isset($_GET["order"]) ? $_GET["order"] : $_POST["order"]; if (isset($_GET["check_order"]) || isset($_POST["check_order"])) $check_order = isset($_GET["check_order"]) ? $_GET["check_order"] : $_POST["check_order"]; if (isset($_GET["proceed_ordering"]) || isset($_POST["proceed_ordering"])) $proceed_ordering = isset($_GET["proceed_ordering"]) ? $_GET["proceed_ordering"] : $_POST["proceed_ordering"]; if (!isset($_SESSION["vote_completed"])) $_SESSION["vote_completed"] = array(); //checking for proper $offset init $offset = isset($_GET["offset"]) ? $_GET["offset"] : 0; //set Smarty include files dir $smarty->template_dir = $lang_list[$_SESSION["current_language"]]->template_path; $smarty_mail->template_dir = $lang_list[$_SESSION["current_language"]]->template_path."/mail"; //assign core Smarty variables $smarty->assign("lang_list", $lang_list); $smarty->assign("lang_list_count", count($lang_list)); if (isset($_SESSION["current_language"])) $smarty->assign("current_language", $_SESSION["current_language"]); // - following vars are used as hidden in the customer survey form if (isset($_GET["currency"])) $smarty->assign("currency", $_GET["currency"]); if (isset($_GET["user_details"])) $smarty->assign("user_details", $_GET["user_details"]); if (isset($_GET["aux_page"])) $smarty->assign("aux_page", $_GET["aux_page"]); if (isset($_GET["show_price"])) $smarty->assign("show_price", $_GET["show_price"]); if (isset($_GET["contact"])) $smarty->assign("contact", $_GET["contact"]); if (isset($_GET["post_service"])) $smarty->assign("post_service", $_GET["post_service"]); if (isset($_GET["ekspedirovanie"])) $smarty->assign("ekspedirovanie", $_GET["ekspedirovanie"]); if (isset($_GET["about"])) $smarty->assign("about", $_GET["about"]); if (isset($_GET["contacts"])) $smarty->assign("contacts", $_GET["contacts"]); if (isset($_GET["equipment"])) $smarty->assign("equipment", $_GET["equipment"]); if (isset($_GET["adv_search"])) $smarty->assign("adv_search", $_GET["adv_search"]); if (isset($_GET["search_query"])) $smarty->assign("search_query", $_GET["search_query"]); if (isset($register)) $smarty->assign("register", $register); if (isset($order)) $smarty->assign("order", $order); if (isset($check_order)) $smarty->assign("check_order", $check_order); //set defualt main_content template to homepage $smarty->assign("main_content_template", "home.tpl.html"); // includes all .php files from includes/ dir $includes_dir = opendir("./includes"); while ( ($inc_file = readdir($includes_dir)) != false ) if (strstr($inc_file,".php")) { include("./includes/$inc_file"); } // output: //security warnings! if (file_exists("./install.php")) { echo "
".WARNING_DELETE_INSTALL_PHP."
"; } if (file_exists("./forgot_password.php")) { echo "
".WARNING_DELETE_FORGOTPW_PHP."
"; } if (!is_writable("./products_pictures") || !is_writable("./templates_c")) { echo "
".WARNING_WRONG_CHMOD."
"; } //show administrative mode link if logged in as administrator include("./checklogin.php"); if (isset($_SESSION["log"]) && isset($_SESSION["pass"])) echo "
".ADMINISTRATE_LINK."

"; //show Smarty output $smarty->display($lang_list[$_SESSION["current_language"]]->template_path."index.tpl.html"); ?>