index.php
while($temp = mysql_fetch_array($result)){
$temp[content] = olrb($temp[content]);//函数名忘了怎么拼 把文本的换行换成HTML的换行 实际情况应该是UBB替换
$row[] = $temp;
}
$tpl->assign("row",$row); // 把数组传递给SMARTY
index.htm
<{section name=news loop=$row}> // loop=$row 传递过来数组的名称就是assign第1个参数
<tr>
<td>$row[news].title</td> // name=news 这里相当于for循环的$i 调用值是$smarty.section.news.index
<td>$row[news].content</td>
<td>$row[news].date|dateformat:"%H:%M:%S","无日期资料"</td> 如果date是UNIX时间戳 第2个参数是默认
</tr>
<{/section}>
while($temp = mysql_fetch_array($result)){
$temp[content] = olrb($temp[content]);//函数名忘了怎么拼 把文本的换行换成HTML的换行 实际情况应该是UBB替换
$row[] = $temp;
}
$tpl->assign("row",$row); // 把数组传递给SMARTY
index.htm
<{section name=news loop=$row}> // loop=$row 传递过来数组的名称就是assign第1个参数
<tr>
<td>$row[news].title</td> // name=news 这里相当于for循环的$i 调用值是$smarty.section.news.index
<td>$row[news].content</td>
<td>$row[news].date|dateformat:"%H:%M:%S","无日期资料"</td> 如果date是UNIX时间戳 第2个参数是默认
</tr>
<{/section}>
现在不能理解smarty的工作模式5555~~
刚刚了解了大概又不知道怎么输出数据库里的数据
这样下去我完了!!。。
偏偏我又没有分数问的问题也没人回答5555~~
怎么样才能搞到分数啊
在smarty中用foreach或者section 把这个数组循环显示出来。