本帖最后由 shenmao1989 于 2010-12-15 21:52 编辑
感兴趣就到原帖地址查看吧,这边排版效果不是很好
http://www.feeqi.com/?p=355001
先看效果吧:
目的就是使用户能够不用刷新就能获得帖子更新。
第一步:修改模板文件forumdisplay,htm
1、在文件开头添加ajax请求的判断
如图:
2、在文件结尾加上else
{template header_ajax}
| $thread['icon'] | {$pluginhooks[forumdisplay_thread][$key]} {lang thread_moved}: $thread[sortid] $thread[typeid] - [{lang readperm} $thread[readperm]] - [{lang thread_reward}{$extcredits[$creditstransextra[2]][title]} $thread[price] {$extcredits[$creditstransextra[2]][unit]}] - [{lang price} {$extcredits[$creditstransextra[1]][title]} $thread[price] {$extcredits[$creditstransextra[1]][unit]}] - [{lang reward_solved}] $thread[multipage] | {lang anonymous} $thread[dateline] | $thread[replies]/$thread[views] | $thread[lastposter]{lang anonymous} |
---|
{template footer_ajax}
如图:
3、增加模板调用forumdisplay_ajax
{template forumdisplay_ajax}