assign("lng",$lng); if(isset($_GET['code'])) $code = $_GET['code']; if(isset($_GET['id']) && is_numeric($_GET['id'])) $id = $_GET['id']; elseif(!$code) { header ('Location: index.php'); exit(0); } $smarty->assign("id",$id); $smarty->assign("section","custom"); $cp = new custom_pages(); if($code) { $content = $cp->getContentByCode($code); $id = $cp->getIdByCode($code); } else $content = $cp->getContent($id); $title = $cp->getTitle($id); $smarty->assign('content', $content); $smarty->assign('title', $title); $db->close(); if($db->error!='') { $db_error = $db->getError(); $smarty->assign('db_error',$db_error); } $smarty->display('content.html'); close(); ?>