<?php require_once('inc/smarty.inc.php'); require_once('include/config.php'); ob_start(); $title = "title"; $description = "description"; $keywords = "keywords"; $outfilename = "test.html"; $smarty->assign("TITLE", $title); $smarty->assign("DESCRIPTION", $description); $smarty->assign("KEYWORDS", $keywords); $smarty->assign("CSSPATH", "/css"); $smarty->assign("TPL_LEFT", TPL_LEFT); $smarty->assign("TPL_RIGHT", TPL_RIGHT); $smarty->assign("TPL_TOP", TPL_TOP); $smarty->assign("TPL_FOOTER", TPL_FOOTER); $smarty->assign("TPL_CENTER", TPL_CATEGORY); $smarty->display(TPL_MAIN); // TPL_MAIN 等常量在 include/config.php 中已经被定义 $str = ob_get_contents(); $fp = @fopen($outfilename, 'w'); if (!$fp) { Show_Error_Message( ERROR_WRITE_FILE ); } fwrite($fp, $str); fclose($fp); ob_end_clean(); ?> |
<html> <head> <{config_load file="global.conf"}> <title><{$TITLE}></title> <meta name="description" content="<{$DESCRIPTION}>"> <meta name="keywords" content="<{$KEYWORDS}>"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="<{$CSSPATH}>/style.css" type="text/css"> </HEAD> <body> <table width="<{#TABLE_WIDTH#}>" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td colspan="3"> <{include file="$TPL_TOP"}> </td> </tr> <tr> <td width="<{#TABLE_LEFT_WIDTH#}>" align="left" valign="top"> <{include file="$TPL_LEFT"}> </td> <td width="<{#TABLE_CENTER_WIDTH#}>" align="center" valign="top"> <{include file="$TPL_CENTER"}> </td> <td width="<{#TABLE_RIGHT_WIDTH#}>" align="right" valign="top"> <{include file="$TPL_RIGHT"}> </td> </tr> <tr> <td colspan="3"> <{include file="$TPL_FOOTER"}> </td> </tr> </table> </body> </html> |
欢迎光临 编程开发论坛 (http://bbs.lihuasoft.net/) | Powered by Discuz! 6.0.0 |