列印

快速發新話題及快速回覆主題加入上傳附件

快速發新話題及快速回覆主題加入上傳附件

from: http://www.alan888.com/Discuz/thread-128566-1-1.html

快速發新話題及快速回覆主題加入 "上傳附件"
作  者: alan888
適用版本: Discuz! 6.0
修改文件: viewthread.php, forumdisplay.php, viewthread 模板, forumdisplay 模板, css 模板
新增文件: post_fastattach 模板
演  示: http://www.alan888.com/D6/

1. 修改 forumdisplay.php
複製內容到剪貼簿
代碼:
!empty($forum['allowpost']);
在下面加上
複製內容到剪貼簿
代碼:
$allowpostattach = !empty($forum['allowpostattach']) || (!$forum['postattachperm'] && $allowpostattach) || ($forum['postattachperm'] && forumperm($forum['postattachperm']));
$attachextensions = $forum['attachextensions'] ? $forum['attachextensions'] : $attachextensions;
$enctype = $allowpostattach ? 'enctype="multipart/form-data"' : '';
$maxattachsize_kb = $maxattachsize / 1000;
$maxprice = isset($extcredits[$creditstrans]) ? $maxprice : 0;
2. 修改 viewthread.php
複製內容到剪貼簿
代碼:
$forum['allowpost'];
在下面加上
複製內容到剪貼簿
代碼:
$allowpostattach = !empty($forum['allowpostattach']) || (!$forum['postattachperm'] && $allowpostattach) || ($forum['postattachperm'] && forumperm($forum['postattachperm']));
$attachextensions = $forum['attachextensions'] ? $forum['attachextensions'] : $attachextensions;
$enctype = $allowpostattach ? 'enctype="multipart/form-data"' : '';
$maxattachsize_kb = $maxattachsize / 1000;
$maxprice = isset($extcredits[$creditstrans]) ? $maxprice : 0;
3. 修改 css 模板
在文件最後加上下一段, 完成後往後台 "更新 css 文件緩存"
複製內容到剪貼簿
代碼:
/*----Fast Attach---*/
.fastattach {width:87%; padding: 4px 10px 4px 30px;}
.fastattach td {padding: 3px; border-bottom: 1px solid {COMMONBOXBORDER};}
4. 修改 forumdisplay 模板
複製內容到剪貼簿
代碼:
action="post.php?action=newthread&fid=$fid&extra=$extra&topicsubmit=yes"
在後面插入 (注意: 前面含半格空格)
複製內容到剪貼簿
代碼:
$enctype
複製內容到剪貼簿
代碼:
<p class="btns">
在上面加上
複製內容到剪貼簿
代碼:
<!--{if $allowpostattach}-->
{template post_fastattach}
<!--{/if}-->
5. 修改 viewthread 模板
複製內容到剪貼簿
代碼:
action="post.php?action=reply&amp;fid=$fid&amp;tid=$tid&amp;extra=$extra&amp;replysubmit=yes"
在後面插入 (注意: 前面含半格空格)
複製內容到剪貼簿
代碼:
$enctype
複製內容到剪貼簿
代碼:
<p class="btns">
在上面加上
複製內容到剪貼簿
代碼:
<!--{if $allowpostattach}-->
{template post_fastattach}
<!--{/if}-->
6. 下載附件 post_fastattach.rar 解壓後上載至 templates/default 目錄下, 然後到後台 "更新快取"

~完成~
附件: 您所在的用戶組無法下載或查看附件
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

請教1# Linux0911 的帖子

請教大人;若在下有一個(台灣智邦)付費空間了,如何結合上述的功能呢?
謝謝您回答
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

那就用外部空間的吧, 這個只是將內建的上傳檔案搬到快速發新話題和快速回覆主題上面方便使用而已

爬一下文吧~
Hack 安裝錯誤, 80% 來自粗心, 請專心安裝
Linux0911 打造您的個性論壇

本人現在忙於研究所, 沒多的時間管論壇, 有問題別發 pm 給我, 謝謝~
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

謝謝分享, try下先
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)