说明:
对于Smilies多的人来说,就有使用价值,少的话,就不必要做麻烦事了.
一般Smilies多的话,用户基本上不会打开一个页面来找自己要的Smilies,我只是说一般.
所以弄了个比较人性话的Smilies 分页
无须打开新页面而实现Smilies翻页.
转贴的话,请一不小心的留个演示地址^_^
文件列表:
./templates/default/post_sminsert.htm (新贴,新回复,编辑)
./templates/default/viewthread.htm (快速回复)
./templates/default/forumdisplay.htm (快速发贴)
./templates/default/pm_send.htm (pm)
./getsmilies.php (本插件增加的)
修改方法:(修改自己认为要修改的就可以了,不必全部哦)
1: pm_send.htm ,forumdisplay.htm , viewthread.htm
post_sminsert.htm(这个文件有一点点不一样,类似的)
找- $smilies
- <!--{if $moresmilies}-->
- <tr>
- <td colspan="$smcols" align="right" class="bold"><br><a href="#" onclick="opensmiliewindow(200, 500);return false">{lang post_smilies_more} ››</a></td>
- </tr>
- <!--{/if}-->
复制代码 替换为:- <tr><td >
- <span id="smiliesdisplay" align="center"><table cellpadding="3" cellspacing="0" width="80%" border="0" align="center" >$smilies</table></span>
- </td></tr>
- <!--{if $moresmilies}-->
- <tr><td colspan="$smcols" align="center"><br>
- <!--{eval $maxpage = ceil(count($_DCACHE['smilies_display'])/($smcols * 4)); $midpage = ceil($maxpage/2);}-->
- <div align="center" class="bold"><span id="curpage" >1/$maxpage</span>
- <a href="###" onclick="getsmilie(1)" title="第一页">首</a>
- <a href="###" onclick="getsmilie('back')" title="上一页">上</a>
- <a href="###" onclick="getsmilie($midpage)" title="中间页">中</a>
- <a href="###" onclick="getsmilie('next')" title="下一页">下</a>
- <a href="###" onclick="getsmilie($maxpage)" title="最后一页">末</a></div>
- </td></tr>
- <div><iframe name="smiframe" id = "smiframe" width="0" height="0"></iframe></div>
- <script language="javascript">
- //GetSmilie by lu5266
- var currentpage = 1;
- var nextpage = 0 ;
- var maxpage= parseInt('$maxpage');
- function getsmilie(method) {
- $('smiliesdisplay').innerHTML = '{lang xml_http_loading}';
- if(method == 'next') {
- nextpage = currentpage + 1;
- nextpage = maxpage > nextpage ? nextpage : maxpage;
- currentpage = nextpage;
- }else if(method == 'back'){
- nextpage = currentpage - 1;
- nextpage = nextpage > 0 ? nextpage : 1;
- currentpage = nextpage;
- }else{
- method = parseInt(method);
- nextpage = currentpage = method;
- }
- window.frames["smiframe"].location = 'getsmilies.php?formhash={FORMHASH}&page=' + nextpage;
- $('curpage').innerHTML = '<font color="red">' + currentpage + '</font>/$maxpage';
- }
- function smirsp(rspText) {
- $('smiliesdisplay').innerHTML = '<table cellpadding="3" cellspacing="0" width="80%" border="0" align="center" >'+rspText + '</table>';
- }
- </script>
- <!--{/if}-->
复制代码 2: 下附件,传到跟目录.
3: 看贴回帖,完成
[ 本帖最后由 lu5266 于 2006-10-12 20:28 编辑 ] |