选择A或者B来安装,只要选择一个就可以了
A:按照每个会员来折叠的
安装方法:
1: 修改viewthread.php
查找:
- $postlist[$post['pid']] = $post;
复制代码
在上面加上:
- //wondful signature collapse for discuz 4.1.0 by lu5266
- if(!isset($_COOKIE['dpt_sign_collapse']) || strpos($_COOKIE['dpt_sign_collapse'], 'signature_'.$post['authorid'].' ') === FALSE) {
- $post['collapseimg'] = 'collapsed_no.gif';
- $post['signdisplay'] = '';
- } else {
- $post['collapseimg'] = 'collapsed_yes.gif';
- $post['signdisplay'] = ' none';
- } //end signature collapse
复制代码
2: 修改viewthread.htm
1):
查找:
- <!--{if $post['signature'] && !$post['anonymous']}--><br><br><br></td></tr><tr><td valign="bottom" $maxsigrows><img src="images/common/sigline.gif"><br>$post[signature]<!--{/if}-->
复制代码
替换为:
- <!--{if $post['signature'] && !$post['anonymous']}-->
- <br><br><br></td></tr><tr><td valign="bottom" $maxsigrows>
- <table>
- <tr><td><img src="images/common/sigline.gif" onclick="dpt_sign_collapse('-1',1);" ondblclick="dpt_sign_collapse('-2',1);" title="单击 隐藏 本页所有会员的签名
- 双击 展开 本页所有会员的签名
- 单击右边的图片 切换 该会员的签名状态(隐藏<==>展开)
- 所有的状态都会自动记录
- 即: 假如会员的签名状态是 隐藏 的,
- 那么在本站内他/她所有的贴里的签名都是隐藏的.
- ">
- <a href="###" onclick="dpt_sign_collapse('$post[authorid]',0);"><img name="signature_img_$post[authorid]" src="{IMGDIR}/$post[collapseimg]" border="0"></a>
- </td></tr>
- <tbody name="signature_$post[authorid]" style="display:$post[signdisplay]">
- <tr><td>$post[signature]</td></tr>
- </table>
- <!--{/if}-->
复制代码
2):在文件的最后加上:
- <script language="javascript">
- //wondful signature collapse for discuz 4.1.0
- //http://www.discuzplus.com
- //power by lu5266(www.5466.ik8.com)
- function write_cookie(cookie_name,style_display,sign_uid){
- collapsed = getcookie("dpt_sign_collapse");
- cookie_start = collapsed ? collapsed.indexOf(cookie_name) : -1;
- cookie_end = cookie_start + cookie_name.length + 1;
-
- if(style_display == "none" && sign_uid != "-1" || sign_uid == "-2") {
- if(cookie_start != -1) {
- collapsed = collapsed.substring(0, cookie_start) + collapsed.substring(cookie_end, collapsed.length);
- }
- }else{
- if(cookie_start == -1){
- collapsed = collapsed + cookie_name + " ";
- }
- }
- expires = new Date();
- expires.setTime(expires.getTime() + (collapsed ? 86400 * 1000 * 30 * 12 : -(86400 * 30 * 1000)));
- document.cookie = "dpt_sign_collapse=" + escape(collapsed) + "; expires=" + expires.toGMTString() + "; path=/";
- }
- function dpt_sign_collapse(sign_uid,hide_all){
-
- authorobj = document.getElementsByTagName("tbody");
- autimgobj = document.getElementsByTagName("img");
- for(var AI=0; AI < autimgobj.length; AI++){
- if(typeof(autimgobj[AI].name) != "undefined"){
- issign = hide_all ? (autimgobj[AI].name.indexOf('ignature_img_') > 0 ? 1 : 0 ) : (autimgobj[AI].name == 'signature_img_'+ sign_uid ? 1 : 0);
- if(issign){
- if((autimgobj[AI].src.toString().indexOf("_yes.gif") > 0 && sign_uid !="-1" ) || sign_uid =="-2" ){
- autimg_re = new RegExp("_yes\\.gif$");
- autimgobj[AI].src = autimgobj[AI].src.replace(autimg_re, '_no.gif');
- }else{
- autimg_re = new RegExp("_no\\.gif$");
- autimgobj[AI].src = autimgobj[AI].src.replace(autimg_re, '_yes.gif');
- }
- }
- }
- }
-
- for(AI=0; AI < authorobj.length; AI++){
-
- if(typeof(authorobj[AI].name) != "undefined"){
- issign = hide_all ? (authorobj[AI].name.indexOf('ignature_') > 0 ? 1 : 0) : (authorobj[AI].name == 'signature_'+ sign_uid ? 1 : 0);
- if(issign){
- write_cookie(authorobj[AI].name,authorobj[AI].style.display,sign_uid);
- authorobj[AI].style.display = authorobj[AI].style.display == "" || sign_uid =="-1" ? "none" : "";
- }
- }
- }
- }
- </script>
复制代码
=====================================================================
B:按照全论坛所有会员一起折叠
的安装方法:
1: 修改viewthread.php
查找:
- $postlist[$post['pid']] = $post;
复制代码
在上面加上:
- //wondful signature collapse for discuz 4.1.0 by lu5266
- if(isset($signaturestatus)) {
- switch($signaturestatus) {
- case 1: dsetcookie('signaturestatus', 1, 86400 * 365); break;
- case 0: dsetcookie('signaturestatus', 0, 86400 * 365); break;
- }
- }
- $post['signature1'] = $post['signature'] ? 1 : 0;
- if($signaturestatus || (!empty($_DCOOKIE['signaturestatus']) && !isset($signaturestatus))) {
- $post['collapseimg'] = 'collapsed_no.gif';
- $signaturestatus1 = 0;
- } else {
- $post['collapseimg'] = 'collapsed_yes.gif';
- $signaturestatus1 = 1;
- $post['signature'] = '';
- }//end signature collapse
复制代码
2: 修改viewthread.htm
查找:
- <!--{if $post['signature'] && !$post['anonymous']}--><br><br><br></td></tr><tr><td valign="bottom" $maxsigrows><img src="images/common/sigline.gif"><br>$post[signature]<!--{/if}-->
复制代码
替换为:
- <!--{if $post['signature1'] && !$post['anonymous']}-->
- <br><br><br></td></tr><tr><td valign="bottom" $maxsigrows>
- <img src="images/common/sigline.gif" >
- <a href="viewthread.php?tid=$tid&page=$page&extra=$extra&signaturestatus=$signaturestatus1"><img src="{IMGDIR}/$post[collapseimg]" border="0"></a>
- <br>$post[signature]
- <!--{/if}-->
复制代码
完工,Ok
[ 本帖最后由 lu5266 于 2006-6-7 17:55 编辑 ] |