discuz ajax返回html,为discuz帖子列表页面增加ajax更新

943465bc9b08547e087cce7b4d49def5.png本帖最后由 shenmao1989 于 2010-12-15 21:52 编辑

感兴趣就到原帖地址查看吧,这边排版效果不是很好

http://www.feeqi.com/?p=355001

先看效果吧:

thread-1997854-1-1.html

目的就是使用户能够不用刷新就能获得帖子更新。

第一步:修改模板文件forumdisplay,htm

1、在文件开头添加ajax请求的判断

如图:

thread-1997854-1-1.html

2、在文件结尾加上else

{template header_ajax}

                                folder_lock.gif

                                $threadsticky[3-$thread[displayorder]]

                                folder_%24thread%5Bfolder%5D.gif

                            {lang thread_poll}

                            {lang thread_trade}

                            {lang thread_reward}class="solved" />

                            {lang thread_activity}

                            {lang thread_debate}

$thread['icon']

{$pluginhooks[forumdisplay_thread][$key]}

{lang thread_moved}:

{lang thread_moved}:

$thread[sortid] $thread[typeid]

$thread[subject]

- [{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}]

                                {lang attach_img}

                                {lang attachment}

                                    {lang thread_recommend}

                                    $thread[heatlevel] {lang heats}

                                    {lang thread_digest} $thread[digest]

                                    {lang rate_credit_add}

$thread[multipage]

$thread[author]

{lang anonymous}

{lang anonymous}

$thread[dateline]

$thread[replies]/$thread[views]

$thread[lastposter]{lang anonymous}

$thread[lastpost]

{template footer_ajax}

如图:

thread-1997854-1-1.html

3、增加模板调用forumdisplay_ajax

{template forumdisplay_ajax}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值