|
  
- UID
- 10001
- 帖子
- 2706
- 精华
- 23
- 积分
- 196747
- 威望
- 13726
- 金钱
- 167827
- 性别
- 男
- 来自
- 山东邹城
- 在线时间
- 318 小时
- 注册时间
- 2008-2-20
- 最后登录
- 2009-7-2
           
|
1#
发表于 2008-5-17 11:57
| 只看该作者
发帖子的时候就能看到,还是发个演示图吧:
1、attachment.php
找到- dheader('location:'.$ftp['attachurl'].'/'.$attach['attachment']);
复制代码 替换为-
- $attach['attachment'] = !preg_match('/^(https?|ftp):\/\//', $attach['attachment']) ? $ftp['attachurl'].'/'.$attach['attachment'] : $attach['attachment'];
- dheader('location:'.$attach['attachment']);
复制代码 再找- function getremotefile($file) {
- global $authkey, $ftp, $attachdir;
- @set_time_limit(0);
复制代码 在下面加入-
- $file = !preg_match('/^(https?|ftp):\/\//', $file) ? $ftp['attachurl'].'/'.$file : $file;
复制代码 2、include/editpost.inc.php
找到- // debug: update thread caches ?
复制代码 在上面加入-
- if(is_array($ftpattachurl)) {
- $urlexists = FALSE;
- foreach($ftpattachurl as $key => $url) {
- if($url) {
- $urlexists = TRUE;
- $name = basename($url);
- $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, price, filename, description, filetype, filesize, attachment, downloads, isimage, uid, thumb, remote)
- VALUES ('$tid', '$pid', '$timestamp', '$ftpattachperm[$key]', '$ftpattachprice[$key]', '$name', '$ftpattachdesc[$key]', '', '0', '$url', '0', '0', '$discuz_uid', '0', '1')");
- }
- }
- if($urlexists) {
- $db->query("UPDATE {$tablepre}posts SET attachment='1' WHERE pid='$pid'", 'UNBUFFERED');
- $db->query("UPDATE {$tablepre}threads SET attachment='1' WHERE tid='$tid'", 'UNBUFFERED');
- }
- }
复制代码 3、include/newreply.inc.php
找到- updatecredits($discuz_uid, $postattachcredits, count($attachments));
- }
复制代码 在下面加入-
- if(is_array($ftpattachurl)) {
- $urlexists = FALSE;
- foreach($ftpattachurl as $key => $url) {
- if($url) {
- $urlexists = TRUE;
- $name = basename($url);
- $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, price, filename, description, filetype, filesize, attachment, downloads, isimage, uid, thumb, remote)
- VALUES ('$tid', '$pid', '$timestamp', '$ftpattachperm[$key]', '$ftpattachprice[$key]', '$name', '$ftpattachdesc[$key]', '', '0', '$url', '0', '0', '$discuz_uid', '0', '1')");
- }
- }
- if($urlexists) {
- $db->query("UPDATE {$tablepre}posts SET attachment='1' WHERE pid='$pid'", 'UNBUFFERED');
- $db->query("UPDATE {$tablepre}threads SET attachment='1' WHERE tid='$tid'", 'UNBUFFERED');
- }
- }
复制代码 4、include/newthread.inc.php
找到- updatecredits($discuz_uid, $postattachcredits, count($attachments));
- }
复制代码 在下面加入-
- if(is_array($ftpattachurl)) {
- $urlexists = FALSE;
- foreach($ftpattachurl as $key => $url) {
- if($url) {
- $urlexists = TRUE;
- $name = basename($url);
- $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, price, filename, description, filetype, filesize, attachment, downloads, isimage, uid, thumb, remote)
- VALUES ('$tid', '$pid', '$timestamp', '$ftpattachperm[$key]', '$ftpattachprice[$key]', '$name', '$ftpattachdesc[$key]', '', '0', '$url', '0', '0', '$discuz_uid', '0', '1')");
- }
- }
- if($urlexists) {
- $db->query("UPDATE {$tablepre}posts SET attachment='1' WHERE pid='$pid'", 'UNBUFFERED');
- $db->query("UPDATE {$tablepre}threads SET attachment='1' WHERE tid='$tid'", 'UNBUFFERED');
- }
- }
复制代码 5、模板目录中的post_editor.htm
找到- <th>{lang attachment_new}</th>
复制代码 在下面加入找到- <th>
- <input type="file" name="attach[]" />
- <span id="localfile[]"></span>
- <input type="hidden" name="localid[]" />
- </th>
复制代码 在下面加入- <td class="nums"><input type="text" name="ftpattachurl[]" /></td>
复制代码
|
附件: 您所在的用户组无法下载或查看附件
--------------------------------------------------
◎中忆技术联盟◎ http://bbs.zyeo.net
QQ技术群
一:3605386 二:3406860 三:30188651
解卡手册地址 http://zyeo.net/sim/help |
|