iaminmd 寫:Sorry...新問題來了。
當我只有用[hide]隱藏內文、根本沒有附加檔案的時候,
隱藏附加檔案的說明文也會出現耶.....
代碼: 選擇全部
'--- 如果您是 *註冊會員*, 那麼您必須登入和回覆文章後, 才可下載附加檔案 ---';
抱歉! 沒有太多時間測試.
以下的修改, 提供您參考:
ps. 修改前提:
1. 延續前文的修改
2. 確定已經完成, 底下連結的文章修改 - 未登入說明訊息
http://phpbb-tw.net/phpbb/viewtopic.php?p=255061#255061
#
#--------[ OPEN ]----------------
#
viewtopic.php
#
#--------[ FIND ]----------------
#
代碼: 選擇全部
if ($valid == TRUE)
{
display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);
}
else
{
display_attachments_notice2();
}
#
#--------[ REPLACE WITH ]----------------
# ps. 還原安裝 attach 後的原貌
代碼: 選擇全部
display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);
#
#--------[ OPEN ]----------------
#
attach_mod/displaying.php
#
#--------[ FIND ]----------------
#
代碼: 選擇全部
function display_post_attachments($post_id, $switch_attachment)
{
global $attach_config, $is_auth;
#
#--------[ REPLACE WITH ]----------------
#
代碼: 選擇全部
function display_post_attachments($post_id, $switch_attachment)
{
global $attach_config, $is_auth, $valid;
#
#--------[ FIND ]----------------
#
代碼: 選擇全部
if ($is_auth['auth_download'] && $is_auth['auth_view'])
#
#--------[ REPLACE WITH ]----------------
#
代碼: 選擇全部
if ($is_auth['auth_download'] && $is_auth['auth_view'] && $valid == TRUE)
#
#--------[ FIND, DELETE ]----------------
# ps. 找到後, 刪除之
代碼: 選擇全部
function display_attachments_notice2()
{
global $template, $lang;
init_display_template('body', '{postrow.ATTACHMENTS}');
$template->assign_block_vars('postrow.attach', array());
$template->assign_block_vars('postrow.attach.attach_notice2', array(
NOTICE2 => $lang['Attach_Notice2']
));
}
#
#--------[ OPEN ]----------------
#
language/lang_chinese_traditional_taiwan/lang_main_attach.php
#
#--------[ FIND ]----------------
#
代碼: 選擇全部
$lang['Attach_Notice'] = '附加檔案: 您目前的權限無法檢視附加檔案';
#
#--------[ REPLACE WITH ]----------------
#
代碼: 選擇全部
$lang['Attach_Notice'] = '附加檔案: 您目前的權限無法檢視附加檔案<br />--- 如果您是 *註冊會員*, 那麼您必須登入和回覆文章後, 才可下載附加檔案 ---';
#
#--------[ OPEN ]----------------
#
# 自行替換subSilver為你所使用的風格名稱目錄
templates/subSilver/viewtopic_attach_body.tpl
#
#--------[ FIND ]----------------
#
代碼: 選擇全部
<!-- END attach -->
#
#--------[ FIND, DELETE ]----------------
# ps. 找到後, 刪除之
代碼: 選擇全部
<!-- BEGIN attach_notice2 -->
<br /><br />
<div align="center"><hr width="95%" /></div>
<table width="95%" border="1" cellpadding="2" cellspacing="0" class="attachtable" align="center">
<tr>
<td width="100%" class="attachheader" align="center"><b><span class="gen">{postrow.attach.attach_notice2.NOTICE2}</span></b></td>
</tr>
</table>
<!-- END attach_notice2 -->
#
#--------[ SAVE/CLOSE ALL FILES ]----------------
#
# EoM