需要安装JQ库 → JQuery安装,已经安装可以忽略。
1、打开默认模板,新建一个模板,名称:
[CSS] 纯文本查看 复制代码 aa_zyhome_pmajax
内容:
[CSS] 纯文本查看 复制代码 <html>
<head>
<title>PM预读</title>
</head>
<body>
<div id="pm_ajax">
<ul style="padding:10px;border:#cacaca 1px solid;" class='bankuaizhuti'>第{echo $page}页消息</ul>
<ul class="pm_list">
{eval $range = array('', '{lang pm_today}', '{lang pm_yesterday}', '{lang pm_before_yesterday}');}
<!--{loop $pmlist $key $pm}-->
<li id="pm_$pm[pmid]" class="s_clear {echo swapclass('colplural')}">
<!--{if $filter == 'privatepm'}-->
<a{if $pm[msgfromurl]} href="$pm[msgfromurl]"{/if} target="_blank" class="avatar">{echo discuz_uc_avatar($pm[touid], 'small');}</a>
<!--{else}-->
<a class="avatar">{echo discuz_uc_avatar($pm[touid], 'small');}</a>
<!--{/if}-->
<p class="cite">
<!--{if $pm[msgfrom]}--><cite><a{if $pm[msgfromurl]} href="$pm[msgfromurl]"{/if} target="_blank">$pm[msgfrom]</a></cite><!--{/if}-->
<!--{if $range[$pm[daterange]]}-->$range[$pm[daterange]] $pm[time]<!--{else}-->$pm[date] $pm[time]<!--{/if}-->
<!--{if $pm[new] && $filter != 'announcepm'}--> <img src="{IMGDIR}/notice_newpm.gif" alt="NEW" /><!--{/if}-->
</p>
<div class="summary">
<!--{if $filter != 'announcepm'}-->
<!--{if $pm[touid]}-->
$pm[message]</div>
<p class="more"><a href="pm.php?uid=$pm[touid]&filter=$filter{if !empty($search)}#pm_$pm[pmid]{else}&daterange=$pm[daterange]#new{/if}" class="to">{lang pm_view}</a></p>
<span class="action">
<input name="uid[]" class="checkbox" type="checkbox" value="$pm[touid]" />
<a href="pm.php?action=del&uid=$pm[touid]&filter=$filter" id="pmd_$pm[pmid]" onclick="deletepm(this, $pm[pmid]);return false;" class="delete" title="{lang delete}">{lang delete}</a>
</span>
<!--{else}-->
<a href="pm.php?pmid=$pm[pmid]&filter=$filter">$pm[message]</a>
</div>
<span class="action">
<input name="pmid[]" class="checkbox" type="checkbox" value="$pm[pmid]" />
<a href="pm.php?action=del&pmid=$pm[pmid]&filter=$filter" id="pmd_$pm[pmid]" onclick="deletepm(this, $pm[pmid]);return false;" class="delete" title="{lang delete}">{lang delete}</a>
</span>
<!--{/if}-->
<!--{else}-->
<a href="pm.php?pmid=$pm[pmid]&filter=$filter">$pm[message]</a></div>
<!--{/if}-->
</li>
<!--{/loop}-->
<li id='ajax_btn' class='s_clear {echo swapclass('colplural')}'>
<a href='javascript:void 0' onclick='forumyudu()'>预读下一页内容</a>
</li>
</ul>
</div>
<script src="http://zyhome.66rt.com/templates/out/yudu_pm1.htm"></script>
</body>
</html>
2、打开pm模板,在最上面添加:
[CSS] 纯文本查看 复制代码 <!--{if cutstr($_SERVER[QUERY_STRING],8)=="ajax=yes ..."}-->
{template aa_zyhome_pmajax}
<!--{else}-->
接着在最下面添加:
[CSS] 纯文本查看 复制代码 <!--{/if}-->
然后再找第一个(注意:是第一个)
[CSS] 纯文本查看 复制代码 <!--{/loop}-->
在上面添加:
[CSS] 纯文本查看 复制代码 <!-------------预读短消息-------------->
<!--{if $page<$maxpage}-->
<li id='ajax_btn' class='s_clear {echo swapclass('colplural')}'>
<a href='javascript:void 0' onclick='forumyudu()'>预读下一页内容</a>
</li>
<script>
var zypage=$page;
var zymaxpage=$maxpage;
var zypmfilter="$filter";
</script>
<script src="http://zyhome.66rt.com/templates/out/yudu_pm1.htm"></script>
<!--{/if}-->
|