- 论坛徽章:
- 0
|
<?php
include("./inc/db_connect.php");
require "./smarty/libs/Smarty.class.php";
$query_news="select id,type,title,tm from news where type=1 order by istop desc,id desc limit 16";//读取文章列表
$res_news=mysql_query($query_news);
$list=array();
while($rs=mysql_fetch_array($res_news)){
$list[]=$rs;
}
$smarty = new Smarty;
$smarty->;template_dir ="./smarty/templates/";
$smarty->;compile_dir="./smarty/templates_c/";
$smarty->;config_dir ="./smarty/configs/";
$smarty->;cache_dir="./smarty/cache/";
$smarty->;caching = true;
$smarty->;left_delimiter = "{";
$smarty->;right_delimiter = "}";
$smarty->;assign("total",$list);
$smarty->;display("example.tpl");
?>; {section name=notes loop=$total}
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666">;
<tr bgcolor="#FFFFFF">;
<td width="14%">;{$total[notes].title}</td>;
<td width="36%">;{$total[notes].tm}</td>;
</tr>;
</table>;
{/section}
问题已经解决了 可以显示成功了 |
|