URL[1]); $var_0 = isset($GLOBALS['objHome']->URL[0]) ? $GLOBALS['objHome']->URL[0] : ''; $var_1 = isset($GLOBALS['objHome']->URL[1]) ? $GLOBALS['objHome']->URL[1] : ''; //mod $var_2 = isset($GLOBALS['objHome']->URL[2]) ? $GLOBALS['objHome']->URL[2] : ''; $var_3 = isset($GLOBALS['objHome']->URL[3]) ? $GLOBALS['objHome']->URL[3] : ''; $var_4 = isset($GLOBALS['objHome']->URL[4]) ? $GLOBALS['objHome']->URL[4] : ''; $var_5 = isset($GLOBALS['objHome']->URL[5]) ? $GLOBALS['objHome']->URL[5] : ''; $var_6 = isset($GLOBALS['objHome']->URL[6]) ? $GLOBALS['objHome']->URL[6] : ''; $smarty = new Smarty; $smarty->compile_check = true; // kiem tra xem template da co thay doi gi khong, neu co, nap du lieu moi $smarty->caching = false; // bat ham caching extract($DB_SETTINGS); //Make connection $dsn = "mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST/$MYSQL_DB"; $db = DB::connect($dsn); if (DB::isError($db)) { die ($db->getMessage()); } $db->query("SET NAMES 'utf8'"); require_once(APPPATH . "libs/functions.php"); require_once(APPPATH . "languages/lang_".$_SESSION["slang"].".php"); if(isset($template) && $template != "") $_SESSION['s_template'] = $template; else $_SESSION['s_template'] = "loiphu"; define("_ACTION_URL", _INDEX_FILE . "index.php?mod=" . $_GET["mod"]); define('MOD_HOME', PATH_PREFIX); define('MY_MOD_HOME', PATH_PREFIX); define('resources', $_SESSION['s_template']); define('FRONTEND_RESOURCES', PATH_PREFIX . 'templates/' . resources . '/'); if(! defined('LANGUAGE_ID') ) define('LANGUAGE_ID', $language); if(! defined('CultureInfoName') ) define('CultureInfoName', $LANGUAGE_NAME); $smarty->assign('stemplate',$smarty->template_dir."/".$_SESSION['s_template']); $smarty->assign('modules',_MODULES_DIR); $mod = getQueryStringFilter(PROJECT_QUERY_STRING); $cid = getQueryCatIdFilter($_GET['cid']); $id = getQueryIdFilter($_GET["id"]); $plusHtml = ''; $smarty->assign('plusHtml',$plusHtml); if($Status==1) $smarty->display($_SESSION['s_template'].'/shutdown.html'); else { $sSQL = "SELECT * FROM $table_setting WHERE language=".LANGUAGE_ID; $re_header = $GLOBALS['db']->query($sSQL); if($row_header = $re_header->fetchRow(DB_FETCHMODE_ASSOC)) { $meta_title = stripslashes($row_header['Titlepage']); $meta_description = stripslashes($row_header['Description']); $smarty->assign("Domainname",stripslashes($row_header['domainname'])); $smarty->assign("Slogan",stripslashes($row_header['Slogan'])); //$smarty->assign("Keyword",stripslashes($row_header['Keyword'])); $smarty->assign("Footerpage",stripslashes($row_header['Footerpage'])); $Status = $row_header["iStatus"]; $smarty->assign("Shutdown",nl2br(stripslashes($row_header['Shutdown']))); } $arrayController = get_frontend_controller(); //var_dump($arrayController[$mod]); switch($arrayController[$mod]) { case "infos": break; case "news": list($meta_title,$Titlename,$meta_description) = get_list_value($table_news_type, "meta_title,TypeName,meta_description", "iStatus=1 and idType=$cid and language=".LANGUAGE_ID); if(count($meta_title)>0){ $meta_title=!$meta_title[0]?stripslashes($Titlename[0]):stripslashes($meta_title[0]); $meta_description=stripslashes($meta_description[0]); }else if($cid==0){ $meta_title = 'Tin tức & khuyến mãi - '.stripslashes($row_header['Titlepage']); $meta_description = ""; } break; break; case "detailnews": $sql="select * from $table_news where IDnews=$id and language=".LANGUAGE_ID; $rs = $GLOBALS["db"]->query($sql); if($row = $rs->fetchRow(DB_FETCHMODE_ASSOC)) { $meta_title=!$row["meta_title"]?stripslashes($row["Titlename"]):stripslashes($row["meta_title"]); $meta_description=stripslashes($row["meta_description"]); } break; case "contact": $meta_title = 'Liên hệ - '.stripslashes($row_header['Titlepage']); $meta_description = ""; break; case "services": $meta_title = 'Dịch vụ - '.stripslashes($row_header['Titlepage']); $meta_description = ""; break; case "detailservice": $TABLE_NAME = $table_services; $WHERE =" where IDService=". $id." and language=".LANGUAGE_ID; $strSQL="select * from ".$TABLE_NAME.$WHERE; $rs = $GLOBALS["db"]->query($strSQL); if (DB::isError($rs)) die ($rs->getMessage()); unset($strSQL); if($row = $rs->fetchRow(DB_FETCHMODE_ASSOC)) { $meta_title=!$row["meta_title"]?stripslashes($row["Titlename"]):stripslashes($row["meta_title"]); $meta_description=stripslashes($row["meta_description"]); } break; case "products": if($cid > 0){ list($meta_title,$Titlename,$meta_description) = get_value($table_category, "meta_title,Titlename,meta_description", "iStatus=1 and IDCategory=$cid and language=".LANGUAGE_ID); $meta_title = ($meta_title==""?stripslashes($Titlename):stripslashes($meta_title)); $meta_description = stripslashes($meta_description); }else{ $meta_title = 'Sản phẩm - '.stripslashes($row_header['Titlepage']); $meta_description = ''; } break; case "detailpro": $TABLE_NAME = $table_products; $WHERE =" where IDProduct=". intval($id)." and language=".LANGUAGE_ID; $strSQL="select * from ".$TABLE_NAME.$WHERE; $rs = $GLOBALS["db"]->query($strSQL); if (DB::isError($rs)) die ($rs->getMessage()); unset($strSQL); if($row = $rs->fetchRow(DB_FETCHMODE_ASSOC)) { $meta_title=!$row["meta_title"]?stripslashes($row["ProductName"]):stripslashes($row["meta_title"]); $meta_description=stripslashes($row["meta_description"]); } break; default: } $smarty->assign("Titlepage", $meta_title); $smarty->assign("Description", $meta_description); $smarty->display(resources.'/index.html'); } ?>