重發主題 XD
就是,在上傳檔案的時候,它不是有一個文字方塊可以讓使用者直接輸入路徑+檔名,旁邊還有
個按鈕可以讓使用者瀏覽檔案,選擇所要上傳的檔案。
就是那一組,smf 1.1 rc1裡預設是一組而已,是想說看能不能一次顯示個十組。
在smf 1.1 rc1 附件檔上傳的部份,預設可以讓使用者選擇檔案上傳,只有一組text+button
在看了Themes下之default裡的Post.template.php,感覺上應該是這裡:
// Is the user allowed to post any additional ones? If so give them the boxes to do it!
if ($context['can_post_attachment'])
{
echo '
<tr id="postAttachment2">
<td align="right" valign="top">
<b>', $txt['smf119'], ':</b>
</td>
<td class="smalltext">
<input type="file" size="48" name="attachment[]" />';
// Show more boxes only if they aren't approaching their limit.
if ($context['num_allowed_attachments'] > 1)
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var allowed_attachments = ', $context['num_allowed_attachments'], ' - 1;
function addAttachment()
{
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");
setOuterHTML(document.getElementById("moreAttachments"), \'<br /><input type="file" size="48" name="attachment[]" /><span id="moreAttachments"></span>\');
allowed_attachments = allowed_attachments - 1;
return true;
}
// ]]></script>
<span id="moreAttachments"></span> <a href="javascript:addAttachment(); void(0);">(', $txt['more_attachments'], ')</a><br />
<noscript><input type="file" size="48" name="attachment[]" /><br /></noscript>';
else
echo '
<br />';
// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
if (!empty($modSettings['attachmentCheckExtensions']))
echo '
', $txt['smf120'], ': ', $context['allowed_extensions'], '<br />';
echo '
', $txt['smf121'], ': ', $modSettings['attachmentSizeLimit'], ' ' . $txt['smf211'], !empty($modSettings['attachmentNumPerPostLimit']) ? ', ' . $txt['maxAttachPerPost'] . ': ' . $modSettings['attachmentNumPerPostLimit'] : '', '
</td>
</tr>';
}
像是<input type 那行在控制一次可以讓使用者上傳的檔案數量(以不按增加附檔案來說),
不過不知道如何修改,多增加幾行上去試,也是顯示一組。還是說,需要修改的地方不只是這
行而已?
從
// Show more boxes only if they aren't approaching their limit.
到
// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
之間的程式碼,感覺上像是在做上傳檔案(text+button為一組)總數的檢查。
是否可以指導一下 Orz...........