require_once 'smarty/libs/Smarty.class.php'; //使用smarty类
$smarty = new Smarty(); //初始化类
$smarty->template_dir = "smarty/templates/templates"; //设置模板目录
$smarty->compile_dir = "smarty/templates/templates_c"; //设置编译目录
$smarty->config_dir = "smarty/templates/config"; //配置文件目录
$smarty->cache_dir = "smarty/templates/cache"; //设定缓存目录
$smarty->caching = false; //设置缓存
$smarty->left_delimiter = "{"; //设置左边界
$smarty->right_delimiter = "}"; //设置右边界
$smarty->assign('title',$row['top']);//替换头变量
$smarty->assign('title',$row['content']);//替换中间变量
$smarty->assign('title',$row['floor']);//替换尾部变量
$smarty->display('index.html'); //输出
index.html 
{include file="top.htm"}      包含文件
      {content}
{include file="floor.htm"}      包含文件top.htm
{top}我汗~ 也不知道 你明白没?