lear_all_cache();//清除所有快取
//smarty.php
//使用smarty模板建立html檔案
//Rossy.cn@gmial.com
//2007-07-27 11:15
require_onmartce("classes/S
require_onmartce("classes/S
martce("classy. .php"); //smarty檔
require_once("config.php"); //設定檔
require_once("mysql_class.php"); //資料庫連線檔案
$smarty = new Smarty();
$ smarty->template_dir = "templates";
$smarty->compile_dir ="templates_c";
$smarty->left_delimiter = "$smarty->right_delimiter ="}>"$smarty->right_delimiter ="}>"; "3"; // 每頁的記錄數
$Db = new Mysql;
$query = $Db->Query("Select * FROM Tablea orDER BYId DESC");
$tatol = $Db->FetchCount($ query );
$pages = ceil($tatol / $page_count);
for ($j=1;$j $showpages.="
for ($i = 0;$i{
$pages>1)
{
$indexpath ="user_".($i+1).".htm"; //檔案名稱
a>".$showpages."
}
else
文件名
$showpagestr= "";
}
$sql = "Select * FROM TableaorDER BY ID DESC LIMIT $ or die ("無效查詢");
if(($Db->FetchCount($query)) $Admin ="資料庫沒有此資料";
query)) {
$Admin[] =array('Id'=>$rs['Id'],'Name'=>$rs['Name'],'Nick'= >$rs['使用者名稱' ],'類型'=>$rs['類型'],'電子郵件'=>$rs['電子郵件']);
}
}
= "系統",'AdminName'=>'ybfqlyq','AdminType'=>'管理員','Type'=>'1'));
$smarty- >分配('Admin',$Admin);
$smarty->分配('Page_Str',$showpagestr);
$temp =$smarty->fetch('test.tpl', null, null, false );//範本檔案
showpagestr = "";
$fp=fopen($indexpath,'w');
fwrite($fp,$temp) ordie('創建失敗') ;
}
$Db->Close(cho);建立htm檔案成功";
?>
test.tpl檔案程式碼:
href="templates/css.css" type=text/cssrel= stylesheet>