史萊姆論壇

返回   史萊姆論壇 > 專業主討論區 > 論壇程式討論區
忘記密碼?
論壇說明

歡迎您來到『史萊姆論壇』 ^___^

您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的!

請點擊這裡:『註冊成為我們的一份子!』

Google 提供的廣告


發文 回覆
 
主題工具 顯示模式
舊 2005-06-21, 03:05 PM   #1
貝斯特 帥哥
長老會員
 
貝斯特 的頭像
榮譽勳章
UID - 90669
在線等級: 級別:1 | 在線時長:11小時 | 升級還需:1小時
註冊日期: 2003-08-06
住址: The Gates of Hell
文章: 1758
現金: 15064 金幣
資產: 5185909 金幣
Cool 在快速回覆中上傳附件

這個套件修改後可以在快速回覆中管理或上傳附件,
修改也很簡單,只需幾分鐘的時間就可以完成了,效果請看附件的圖片。

###### 安裝資訊 ######
需修改的檔案: 1
需修改的模板: 1
需新增的模板: 2
(套件修改時間: 2-5 分鐘)
##################

編輯檔案 showthread.php

###### 搜尋: ######

PHP代碼:
'bbcodecache',



##### 在下面加上: ######

PHP代碼:
'attachmentcache',



###### 搜尋: ######

PHP代碼:
'showthread_quickreply',



##### 在下面加上: ######

PHP代碼:
'showthread_attachment',
'showthread_attachmentbit',



##### 搜尋: ######

PHP代碼:
// *********************************************************************************
// build quick reply if appropriate
if ($SHOWQUICKREPLY)



在上面加上:

PHP代碼:
// get attachment options
require_once('./includes/functions_file.php');
$attachtypes = unserialize($datastore['attachmentcache']);
$inimaxattach = fetch_max_attachment_size();

$maxattachsize = vb_number_format($inimaxattach, 1, true);
$attachcount = 0;
if ($forumperms & CANPOSTATTACHMENT AND $bbuserinfo['userid'])
{
if (!$posthash OR !$poststarttime)
{
$poststarttime = TIMENOW;
$posthash = md5($poststarttime . $bbuserinfo['userid'] . $bbuserinfo['salt']);
}
else
{
$currentattaches = $DB_site->query("
SELECT filename, filesize
FROM " . TABLE_PREFIX . "attachment
WHERE posthash = '" . addslashes($newpost['posthash']) . "'
AND userid = $bbuserinfo[userid]
");

while ($attach = $DB_site->fetch_array($currentattaches))
{
$attach['extension'] = strtolower(file_extension($attach['filename']));
$attach['filename'] = htmlspecialchars_uni($attach['filename']);
$attach['filesize'] = vb_number_format($attach['filesize'], 1, true);
$show['attachmentlist'] = true;
eval('$attachments .= "' . fetch_template('showthread_attachmentbit') . '";');
}
}
$attachurl = "f=$foruminfo[forumid]";
eval('$showthread_attachmentoption = "' . fetch_template('showthread_attachment') . '";');
}
else
{
$showthread_attachmentoption = '';
}



---------------------------------------------------


########## 模板編輯 ############

編輯 showthread_quickreply 模板

##### 搜尋 #####

HTML代碼:
<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" />$vbphrase[quote_message_in_reply]</label> </div> </fieldset> </td> </tr>

##### 在下面加上 #####

HTML代碼:
<!--- showthread quickreply attachement ---> <tr> <td align="$stylevar[left]">
$showthread_attachmentoption
</td> </tr> <!--- showthread quickreply attachement --->

#-----------------------

##### 搜尋 #####

HTML代碼:
<input type="submit" class="button" value="$vbphrase[post_quick_reply]" accesskey="s" title="(Alt + S)" name="sbutton" tabindex="2" onclick="this.form.clickedelm.value=this.value" />

##### 在上面加上 #####

HTML代碼:
<input type="hidden" name="posthash" value="$posthash" /> <input type="hidden" name="poststarttime" value="$poststarttime" />

########## 新增模板 ############

1. showthread_attachment

HTML代碼:
<fieldset class="fieldset"> <legend>$vbphrase[attach_files]</legend> <div style="padding:$stylevar[formspacer]px"> <div style="margin-bottom:$stylevar[formspacer]px"> <div>$vbphrase[valid_file_extensions]: $attachtypes[extensions]</div> </div> <div style="margin-bottom:$stylevar[formspacer]px" id="attachlist"> <if condition="$show['attachmentlist']">
$attachments
</if> </div> <div> <script type="text/javascript"> <!--
document.write('<input type="button" class="button" tabindex="1" style="font-weight:normal" value="$vbphrase[manage_attachments]" title="$vbphrase[add_edit_files_attached]" onclick="manageattachments(\'newattachment.php?$session[sessionurl]$attachurl&amp;poststarttime=$poststarttime&amp;posthash=$posthash\', 480, 480, \'$postid\')" />');
//--> </script> <noscript> <a href="newattachment.php?$session[sessionurl]$attachurl&amp;poststarttime=$poststarttime&amp;posthash=$posthash" target="manageattach" title="$vbphrase[add_edit_files_attached]" tabindex="1"><strong>$vbphrase[manage_attachments]</strong></a> </noscript> </div> </div> </fieldset>

2. showthread_attachmentbit

HTML代碼:
<div style="margin:2px"><img class="inlineimg" src="$stylevar[imgdir_attach]/$attach[extension].gif" alt="$attach[filename]" border="0" /> <a href="attachment.php?$session[sessionurl]attachmentid=$attach[attachmentid]&amp;stc=1" target="_blank">$attach[filename]</a> ($attach[filesize])</div>

###### 套件修改完成 #######
__________________

給自己看也給所有需要這些話鼓勵的人看!

認真不一定會得到美好的結果,但是不認真就一定沒有

想要有什麼結果,就秉持你的雙手
放手去做
總比什麼都沒付出最後失敗了才嘆氣來的好吧
沒努力的人.沒有資格說放棄
努力過的人.更要有勇氣繼續努力下去
貝斯特 目前離線  
送花文章: 1, 收花文章: 38 篇, 收花: 123 次
回覆時引用此帖
發文 回覆



發表規則
不可以發文
不可以回覆主題
不可以上傳附加檔案
不可以編輯您的文章

論壇啟用 BB 語法
論壇啟用 表情符號
論壇啟用 [IMG] 語法
論壇禁用 HTML 語法
Trackbacks are 禁用
Pingbacks are 禁用
Refbacks are 禁用


所有時間均為台北時間。現在的時間是 07:29 AM


Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2025, Jelsoft Enterprises Ltd.


Search Engine Friendly URLs by vBSEO 3.6.1