Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

防D4附件显示 D2.5sp1 by ejew(更新07260500)

[复制链接]
ejew 发表于 2005-6-30 05:27:22 | 显示全部楼层 |阅读模式
插件名称:防D4附件显示 D25sp1 by ejew
作  者:ejew . 伊佳E网 (http://www.ejew.org)
适  用:D2.5Sp1/D2.5应该也可以
安装程度:简易
上传模板:1个
安装需求:本插件以D2.5SP1正式版050401为基础修改
作者网站:http://www.ejew.org
演  示:http://www.ejew.org/bbs/viewthread.php?tid=8097
更新07260500
更新:鉴于大多数朋友需要集成附件文字说明,已做增加!
安装过本插件的朋友请往本帖最下对文字说明增加的修改说明,否则请继续



一、
上传附件post_attachments.htm于你的风格模板区

如果选择
二、
post_newthread.htm

查找

  1. <!--{if $allowpostattach && $multiattach}-->
  2.         <tr>
  3.         <td colspan=2 class="header">{lang attachment}  : </td>
  4.         </tr>
  5.         <!--{loop $multiattach $temp}-->
  6.         <tr>
  7.         <td bgcolor="{ALTBG1}">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
  8.         <td bgcolor="{ALTBG2}" class="smalltxt">
  9.         <!--{if $allowsetattachperm}-->{lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5">&nbsp;<!--{/if}-->
  10.         <input type="file" name="attach[]" size="40">
  11.         <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}: $attachextensions<!--{/if}--></td>
  12.         </tr>
  13.         <!--{/loop}-->
  14. <!--{/if}-->
复制代码


替换为

  1. <!--{if $allowpostattach && $multiattach}-->
  2.         {template post_attachments}
  3. <!--{/if}-->
复制代码


三、
post_newreply.htm

查找
  1. <!--{if $allowpostattach}-->
  2.         <tr>
  3.         <td colspan=2 class="header">{lang attachment}  : </td>
  4.         </tr>
  5.         <!--{loop $multiattach $temp}-->
  6.         <tr>
  7.         <td bgcolor="{ALTBG1}">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
  8.         <td bgcolor="{ALTBG2}" class="smalltxt">
  9.         <!--{if $allowsetattachperm}-->{lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5">&nbsp;<!--{/if}-->
  10.         <input type="file" name="attach[]" size="40">
  11.         <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}:$attachextensions<!--{/if}--></td>
  12.         </tr>
  13.         <!--{/loop}-->
  14. <!--{/if}-->
复制代码


替换为

  1. <!--{if $allowpostattach}-->
  2.         {template post_attachments}
  3. <!--{/if}-->
复制代码



四、
post_editpost.htm

查找
  1. <tr>
  2. <td colspan="2" class="header">{lang post_editattach}</td>
  3. </tr>
  4.         <!--{if $postinfo['aid']}-->
  5.                 <tr>
  6.                 <td bgcolor="{ALTBG1}" valign="top">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
  7.                 <td bgcolor="{ALTBG2}" class="smalltxt"><b>{lang curr_attachment}</b><br>
  8.                 <!--{loop $postinfo[attach_list] $vkey $attach}-->
  9.                         &nbsp;<!--{echo $vkey+1 }--> : {lang delete}<input type="checkbox" name="deleteaids[]" value="$attach[aid]" >
  10.                         <!--{if $allowsetattachperm}-->&nbsp;{lang require}{lang credit_title} <input type="text" name="origattachperm[{$attach[aid]}]" value="$attach[creditsrequire]" size="5">
  11.                         <!--{/if}-->
  12.                         &nbsp;&nbsp; $attach[attachicon] &nbsp;<a href="attachment.php?aid=$attach[aid]&checkid=$attach[checkid]&download=1" target="_blank">$attach[filename]</a>  ($attach['dateline'],&nbsp;$attach[attachsize])&nbsp;&nbsp;<br>
  13.                 <!--{/loop}-->
  14.                 <hr size="1" noshadow color={BORDERCOLOR}>
  15.                 <span class="bold">{lang attachment_add}</span><br>
  16.                 <!--{loop $multiattach $temp}-->
  17.                         <!--{if $allowsetattachperm}-->&nbsp;{lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5" >&nbsp;<!--{/if}-->
  18.                         <input type="file" name="attach[]">
  19.                         <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}: $attachextensions<!--{/if}--><br>
  20.                 <!--{/loop}-->
  21.                         </td></tr>
  22.         <!--{else}-->
  23.                 <!--{loop $multiattach $temp}-->
  24.                 <tr>
  25.                 <td bgcolor="{ALTBG1}">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
  26.                 <td bgcolor="{ALTBG2}" class="smalltxt"><input type="hidden" name="attachedit" value="new">
  27.                 <!--{if $allowsetattachperm}-->&nbsp;{lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5">&nbsp;<!--{/if}-->
  28.                 <input type="file" name="attach[]" size="40">
  29.                 <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}: $attachextensions<!--{/if}-->
  30.                 </td></tr>
  31.                 <!--{/loop}-->
  32.         <!--{/if}-->
复制代码


替换为

  1.         <!--{if $postinfo['aid']}-->
  2. <tr>
  3. <td colspan="2" class="header">{lang curr_attachment}</td>
  4. </tr>
  5.                 <tr>
  6.                 <td bgcolor="{ALTBG1}" valign="top">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
  7.                 <td bgcolor="{ALTBG2}" class="smalltxt">
  8.                 <!--{loop $postinfo[attach_list] $vkey $attach}-->
  9.                         &nbsp;<!--{echo $vkey+1 }--> : {lang delete}<input type="checkbox" name="deleteaids[]" value="$attach[aid]" >
  10.                         <!--{if $allowsetattachperm}-->&nbsp;{lang require}{lang credit_title} <input type="text" name="origattachperm[{$attach[aid]}]" value="$attach[creditsrequire]" size="5">
  11.                         <!--{/if}-->
  12.                         &nbsp;&nbsp; $attach[attachicon] &nbsp;<a href="attachment.php?aid=$attach[aid]&checkid=$attach[checkid]&download=1" target="_blank">$attach[filename]</a>  ($attach['dateline'],&nbsp;$attach[attachsize])&nbsp;&nbsp;<br>
  13.                 <!--{/loop}-->
  14. </td></tr>

  15. {template post_attachments}

  16.         <!--{else}-->
  17. {template post_attachments}
  18.         <!--{/if}-->
复制代码


往下查找并删除(此应为模板的一个bug) 
  1. </table></table>
复制代码

(无附件描述)post_attachments.rar,完成无附件说明修改,如果要安装有文字说明的,往下继续



以下为添加文字说明的升级

请参考
http://www.ejew.org/bbs/viewthread.php?tid=7455 进行完整的修改,跳过对*.htm(除viewthread.htm)文件的修改,因本插件已做了修改

其中我上面修改的post_editpost.htm替换部分找
  1. ($attach['dateline'],&nbsp;$attach[attachsize])&nbsp;&nbsp;
复制代码

后面再加加
  1. {lang attach_text}:<input type="text" name="origattachtext[{$attach[aid]}]" value="$attach[attachtext]" size="15">
复制代码

上传附件2,完成附件说明的修改

也可以参考
http://old.freediscuz.net/old/viewthread.php?tid=40283
修改时跳过模板文件*.htm修改

其中editpost.php再找

  1. if ($saveaid) {
  2. 。。。。中间内容省略,自己找匹配
  3. if ($del_aids) {
复制代码


改为

  1.                                 if ($saveaid) {
  2. if ($allowsetattachperm && $att[creditsrequire] != $origattachperm["$att[aid]"]|| $att[attachtext] != $origattachtext["$att[aid]"]){
  3.                                                 $att[creditsrequire] = $origattachperm["$att[aid]"];
  4.                                                 $att[attachtext] = $origattachtext["$att[aid]"];
  5.                                                 $db->query("UPDATE $table_attachments set

  6. creditsrequire='$att[creditsrequire]',attachtext='$att[attachtext]' WHERE aid='$att[aid]'", 'UNBUFFERED');
  7.                                         }
  8.                                         $post_attaches_count ++;
  9.                                 }
  10.                         }
  11.                         if ($del_aids) {
复制代码

post_editpost.htm找
  1. ($attach['dateline'],&nbsp;$attach[attachsize])&nbsp;&nbsp;
复制代码

后面加
  1. {lang attach_text}:<input type="text" name="origattachtext[{$attach[aid]}]" value="$attach[attachtext]" size="15">
复制代码



viewthread.htm
找到

  1. $attach[downloads]<!--{/if}--> )
复制代码

后面添加

  1. <!--{if $attach[attachtext]}--><BR>{lang attach_text}:$attach[attachtext]<!--{/if}-->
复制代码


上传附件2,完成附件说明的修改

[ 本帖最后由 ejew 于 2005-10-11 13:45 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
苦涩咖啡 发表于 2005-6-30 08:02:43 | 显示全部楼层
我试试,谢谢
回复

使用道具 举报

苦涩咖啡 发表于 2005-6-30 08:30:04 | 显示全部楼层
发现一个问题
发表新帖的时候没有问题
但在编辑帖子的时候,你连续点,就回出现网页上有错误
回复的时候也是一样有这个小错误

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

 楼主| ejew 发表于 2005-6-30 11:20:04 | 显示全部楼层

回复 #3 苦涩咖啡 的帖子

我经过很多次本地测试,都没问题
回复

使用道具 举报

playhl 发表于 2005-6-30 12:06:20 | 显示全部楼层
最好在1楼给个演示图……
我看到三楼才知道是干啥的……
回复

使用道具 举报

烧刀子 发表于 2005-6-30 14:51:38 | 显示全部楼层
这个算是修改很权的了,以前有一个,不过只是修改了一个摸班
回复

使用道具 举报

loop 发表于 2005-7-1 02:58:12 | 显示全部楼层
好像这个完整些,试试
回复

使用道具 举报

neet 发表于 2005-7-1 10:11:35 | 显示全部楼层
==看
回复

使用道具 举报

FreeDZ 发表于 2005-7-1 10:37:11 | 显示全部楼层
观望一下.
回复

使用道具 举报

lj80117 发表于 2005-7-1 10:46:45 | 显示全部楼层
看看再说
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-22 01:35 , Processed in 0.104575 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表