插件名称:防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
查找
- <!--{if $allowpostattach && $multiattach}-->
- <tr>
- <td colspan=2 class="header">{lang attachment} : </td>
- </tr>
- <!--{loop $multiattach $temp}-->
- <tr>
- <td bgcolor="{ALTBG1}">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
- <td bgcolor="{ALTBG2}" class="smalltxt">
- <!--{if $allowsetattachperm}-->{lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5"> <!--{/if}-->
- <input type="file" name="attach[]" size="40">
- <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}: $attachextensions<!--{/if}--></td>
- </tr>
- <!--{/loop}-->
- <!--{/if}-->
复制代码
替换为
- <!--{if $allowpostattach && $multiattach}-->
- {template post_attachments}
- <!--{/if}-->
复制代码
三、
post_newreply.htm
查找
- <!--{if $allowpostattach}-->
- <tr>
- <td colspan=2 class="header">{lang attachment} : </td>
- </tr>
- <!--{loop $multiattach $temp}-->
- <tr>
- <td bgcolor="{ALTBG1}">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
- <td bgcolor="{ALTBG2}" class="smalltxt">
- <!--{if $allowsetattachperm}-->{lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5"> <!--{/if}-->
- <input type="file" name="attach[]" size="40">
- <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}:$attachextensions<!--{/if}--></td>
- </tr>
- <!--{/loop}-->
- <!--{/if}-->
复制代码
替换为
- <!--{if $allowpostattach}-->
- {template post_attachments}
- <!--{/if}-->
复制代码
四、
post_editpost.htm
查找
- <tr>
- <td colspan="2" class="header">{lang post_editattach}</td>
- </tr>
- <!--{if $postinfo['aid']}-->
- <tr>
- <td bgcolor="{ALTBG1}" valign="top">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
- <td bgcolor="{ALTBG2}" class="smalltxt"><b>{lang curr_attachment}</b><br>
- <!--{loop $postinfo[attach_list] $vkey $attach}-->
- <!--{echo $vkey+1 }--> : {lang delete}<input type="checkbox" name="deleteaids[]" value="$attach[aid]" >
- <!--{if $allowsetattachperm}--> {lang require}{lang credit_title} <input type="text" name="origattachperm[{$attach[aid]}]" value="$attach[creditsrequire]" size="5">
- <!--{/if}-->
- $attach[attachicon] <a href="attachment.php?aid=$attach[aid]&checkid=$attach[checkid]&download=1" target="_blank">$attach[filename]</a> ($attach['dateline'], $attach[attachsize]) <br>
- <!--{/loop}-->
- <hr size="1" noshadow color={BORDERCOLOR}>
- <span class="bold">{lang attachment_add}</span><br>
- <!--{loop $multiattach $temp}-->
- <!--{if $allowsetattachperm}--> {lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5" > <!--{/if}-->
- <input type="file" name="attach[]">
- <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}: $attachextensions<!--{/if}--><br>
- <!--{/loop}-->
- </td></tr>
- <!--{else}-->
- <!--{loop $multiattach $temp}-->
- <tr>
- <td bgcolor="{ALTBG1}">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
- <td bgcolor="{ALTBG2}" class="smalltxt"><input type="hidden" name="attachedit" value="new">
- <!--{if $allowsetattachperm}--> {lang require} {lang credit_title} <input type="text" name="attachperm[]" value="0" size="5"> <!--{/if}-->
- <input type="file" name="attach[]" size="40">
- <!--{if $attachextensions}--><br><br>{lang attachment_allow_exts}: $attachextensions<!--{/if}-->
- </td></tr>
- <!--{/loop}-->
- <!--{/if}-->
复制代码
替换为
- <!--{if $postinfo['aid']}-->
- <tr>
- <td colspan="2" class="header">{lang curr_attachment}</td>
- </tr>
- <tr>
- <td bgcolor="{ALTBG1}" valign="top">{lang attachment} <span class="smalltxt">({lang lower_than} $maxattachsize_kb kb)</span>:</td>
- <td bgcolor="{ALTBG2}" class="smalltxt">
- <!--{loop $postinfo[attach_list] $vkey $attach}-->
- <!--{echo $vkey+1 }--> : {lang delete}<input type="checkbox" name="deleteaids[]" value="$attach[aid]" >
- <!--{if $allowsetattachperm}--> {lang require}{lang credit_title} <input type="text" name="origattachperm[{$attach[aid]}]" value="$attach[creditsrequire]" size="5">
- <!--{/if}-->
- $attach[attachicon] <a href="attachment.php?aid=$attach[aid]&checkid=$attach[checkid]&download=1" target="_blank">$attach[filename]</a> ($attach['dateline'], $attach[attachsize]) <br>
- <!--{/loop}-->
- </td></tr>
- {template post_attachments}
- <!--{else}-->
- {template post_attachments}
- <!--{/if}-->
复制代码
往下查找并删除(此应为模板的一个bug)
(无附件描述)post_attachments.rar,完成无附件说明修改,如果要安装有文字说明的,往下继续
以下为添加文字说明的升级
请参考
http://www.ejew.org/bbs/viewthread.php?tid=7455 进行完整的修改,跳过对*.htm(除viewthread.htm)文件的修改,因本插件已做了修改
其中我上面修改的post_editpost.htm替换部分找
- ($attach['dateline'], $attach[attachsize])
复制代码
后面再加加
- {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再找
- if ($saveaid) {
- 。。。。中间内容省略,自己找匹配
- if ($del_aids) {
复制代码
改为
- if ($saveaid) {
- if ($allowsetattachperm && $att[creditsrequire] != $origattachperm["$att[aid]"]|| $att[attachtext] != $origattachtext["$att[aid]"]){
- $att[creditsrequire] = $origattachperm["$att[aid]"];
- $att[attachtext] = $origattachtext["$att[aid]"];
- $db->query("UPDATE $table_attachments set
- creditsrequire='$att[creditsrequire]',attachtext='$att[attachtext]' WHERE aid='$att[aid]'", 'UNBUFFERED');
- }
- $post_attaches_count ++;
- }
- }
- if ($del_aids) {
复制代码
post_editpost.htm找
- ($attach['dateline'], $attach[attachsize])
复制代码
后面加
- {lang attach_text}:<input type="text" name="origattachtext[{$attach[aid]}]" value="$attach[attachtext]" size="15">
复制代码
viewthread.htm
找到
- $attach[downloads]<!--{/if}--> )
复制代码
后面添加
- <!--{if $attach[attachtext]}--><BR>{lang attach_text}:$attach[attachtext]<!--{/if}-->
复制代码
上传附件2,完成附件说明的修改
[ 本帖最后由 ejew 于 2005-10-11 13:45 编辑 ] |