[教學]phpBB206 + attach239安裝

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
fyodor
星球普通子民
星球普通子民
文章: 6
註冊時間: 2004-03-12 02:45

[教學]phpBB206 + attach239安裝

文章 fyodor »

這篇文章主要內容是全新安裝的phpBB2.0.6, 外掛attach mod 2.3.9的步驟
注意....
phpBB的版本是2.0.6
attach_mod的版本是2.3.9
(如果你看到這篇文章時, 官方網站上的版本已經更新了
寄信給我, 我有備份 )
如果是其他版本的phpBB,第三步請不要直接把檔案傳上去\r
程式碼我貼在最後面...
容易搞錯的地方用中文說明加上PS
附贈很爛的翻譯

phpBB2的安裝我就不多說了,如果你需要中文patch也可以先裝上去\r
把phpBB2裝好之後, 直接進行attach mod的安裝


**************************
attach mod的安裝
**************************

0.
到attach mod 主站
下載attach mod 2.3.9
(這樣貼連結有沒有違規啊^^" )

1.
先在自己電腦裡解壓縮, attach_mod
oot裡全部的東西丟到phpBB2的資料夾下
如果有重複的檔案....直接覆蓋過去\r

2.
用瀏覽器開http://yourhostname/phpBB2/install/mod_table_inst.php

3.
把attach_mod\contrib裡全部的東西丟到phpBB2的資料夾下
如果有重複的檔案也是直接覆蓋

以上, 完成

--------------------------------------------------------
給要自己修改的人\r
要修改的部分如下

代碼: 選擇全部


# 
#-----[ 開啟檔案 ]--------------------------------------------- 
# 
common.php

#
#-----[ FIND ]---------------------------------------------
# around line 171
$board_config[$row['config_name']] = $row['config_value'];
}

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# After the closing brace
# PS.是在 { 之後
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
faq.php

# 
#-----[ FIND ]---------------------------------------------
# around line 59
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
attach_faq_include($lang_file);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
modcp.php

# 
#-----[ FIND ]---------------------------------------------
# around line 337
				remove_search_post($post_id_sql);

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
				delete_attachment(explode(', ', $post_id_sql));

# 
#-----[ FIND ]---------------------------------------------
# around line 1183
				'TOPIC_ID' => $topic_id,

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
				'TOPIC_ATTACHMENT_IMG' => topic_attachment_image($row['topic_attachment']),

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
posting.php

# 
#-----[ FIND ]---------------------------------------------
# around line 407
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
execute_posting_attachment_handling();

# 
#-----[ FIND ]---------------------------------------------
# around line 563
			update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $user_id);
		}

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# the Line have to be added AFTER the closing brace
# PS.是在 } 之後
		$attachment_mod['posting']->insert_attachment($post_id);

# 
#-----[ FIND ]---------------------------------------------
# around line 697
			'preview' => 'posting_preview.tpl')
		);

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# the Line have to be added AFTER the ');'
		$attachment_mod['posting']->preview_attachments();

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
privmsg.php

# 
#-----[ FIND ]---------------------------------------------
# around line 139
// ----------
// Start main

# 
#-----[ BEFORE, ADD ]-------------------------------------- 
# 
execute_privmsgs_attachment_handling($mode);

# 
#-----[ FIND ]---------------------------------------------
# around line 358
	//
	// Pick a folder, any folder, so long as it's one below ...

# 
#-----[ BEFORE, ADD ]-------------------------------------- 
# 
	$attachment_mod['pm']->duplicate_attachment_pm($privmsg['privmsgs_attachment'], $privmsg['privmsgs_id'], $privmsg_sent_id);

#
#-----[ FIND ]---------------------------------------------
# around line 498
	$user_id_to = $privmsg['user_id_2'];

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
	init_display_pm_attachments($privmsg['privmsgs_attachment']);

#
#-----[ FIND ]---------------------------------------------
# around line 750
			unset($delete_type);
		}

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# the Line have to be added AFTER the closing brace
# PS.在 } 之後喔~~別搞錯了
		$attachment_mod['pm']->delete_all_pm_attachments($mark_list);

#
#-----[ FIND ]---------------------------------------------
# around line 1292
		if ( $mode != 'edit' )
		{
			//
			// Add to the users new pm counter
			//

# 
#-----[ BEFORE, ADD ]--------------------------------------- 
# The Line have to be added BEFORE 'if ( $mode != 'edit' )'
		$attachment_mod['pm']->insert_attachment_pm($privmsg_id);

#
#-----[ FIND ]---------------------------------------------
# around line 1593
			"preview" => 'privmsgs_preview.tpl')
		);

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# The Line have to be added AFTER the ');'
		$attachment_mod['pm']->preview_attachments();

#
#-----[ FIND ]---------------------------------------------
# around line 2133
			'DATE' => $msg_date,

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
			'PRIVMSG_ATTACHMENTS_IMG' => privmsgs_attachment_image($privmsg_id),

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
viewforum.php

# 
#-----[ FIND ]---------------------------------------------
# around line 370
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
attach_build_auth_levels($is_auth, $s_auth_can);

# 
#-----[ FIND ]---------------------------------------------
# around line 648
			'NEWEST_POST_IMG' => $newest_post_img, 

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
			'TOPIC_ATTACHMENT_IMG' => topic_attachment_image($topic_rowset[$i]['topic_attachment']),

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
viewtopic.php

# 
#-----[ FIND ]---------------------------------------------
# around line 146
		AND f.forum_id = t.forum_id
		$order_sql";

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
attach_setup_viewtopic_auth($order_sql, $sql);

# 
#-----[ FIND ]---------------------------------------------
# around line 580
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
attach_build_auth_levels($is_auth, $s_auth_can);

# 
#-----[ FIND ]---------------------------------------------
# around line 810
//
// Update the topic view counter

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
init_display_post_attachments($forum_topic_data['topic_attachment']);

# 
#-----[ FIND ]---------------------------------------------
# around line 1205
		'U_POST_ID' => $postrow[$i]['post_id'])
	);

# 
#-----[ AFTER, ADD ]---------------------------------------
# The Line have to be added AFTER the ');'
	display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
admin/admin_forumauth.php

# 
#-----[ FIND ]---------------------------------------------
# around line 72
$forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN);

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
attach_setup_forum_auth($simple_auth_ary, $forum_auth_fields, $field_names);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
admin/admin_forums.php

# 
#-----[ FIND ]---------------------------------------------
# around line 52
//
// Mode setting

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
$forum_auth_ary['auth_attachments'] = AUTH_REG;
$forum_auth_ary['auth_download'] = AUTH_REG;

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
admin/admin_groups.php

# 
#-----[ FIND ]---------------------------------------------
# around line 58
if ( isset($HTTP_POST_VARS['edit']) || isset($HTTP_POST_VARS['new']) )

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
attachment_quota_settings('group', $HTTP_POST_VARS['group_update'], $mode);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
admin/admin_ug_auth.php

# 
#-----[ FIND ]---------------------------------------------
# around line 89
// ---------------
// Start Functions

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
attach_setup_usergroup_auth($forum_auth_fields, $auth_field_match, $field_names);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
admin/admin_users.php

# 
#-----[ FIND ]---------------------------------------------
# around line 62
	//
	// Ok, the profile has been modified and submitted, let's update

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
	attachment_quota_settings('user', $HTTP_POST_VARS['submit'], $mode);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
includes/auth.php

# 
#-----[ FIND ]---------------------------------------------
# around line 105
		case AUTH_ATTACH:
			break;

		default:
			break;
	}

# 
#-----[ AFTER, ADD ]---------------------------------------
# the Line have to be added AFTER the closing brace
# PS 在 } 之後喔~~~~~
	attach_setup_basic_auth($type, $auth_fields, $a_sql);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
includes/functions.php

# 
#-----[ FIND ]---------------------------------------------
# around line 255
	//
	// Set up style
	//

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
	include_attach_lang();

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
includes/functions_admin.php

# 
#-----[ FIND ]---------------------------------------------
# around line 146
					message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
				}
			}

# 
#-----[ AFTER, ADD ]---------------------------------------
# After the last closing brace, before the break;
# PS 在 } 之後, break之前喔~~~~~
			attachment_sync_topic($id);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
includes/prune.php

# 
\n#-----[ FIND ]---------------------------------------------
# around line 113
			remove_search_post($sql_post);

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
			prune_attachments($sql_post);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
includes/topic_review.php

# 
#-----[ FIND ]---------------------------------------------
# around line 43
			WHERE t.topic_id = $topic_id
				AND f.forum_id = t.forum_id";

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
		$tmp = '';
		attach_setup_viewtopic_auth($tmp, $sql);

# 
#-----[ FIND ]---------------------------------------------
# around line 119
	//
	// Okay, let's do the loop, yeah come on baby let's do the loop
	// and it goes like this ...

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
	init_display_review_attachments($is_auth);

# 
#-----[ FIND ]---------------------------------------------
# around line 202
				'L_MINI_POST_ALT' => $mini_post_alt)
			);

# 
#-----[ AFTER, ADD ]---------------------------------------
# the Line have to be added AFTER the ');'
			display_review_attachments($row['post_id'], $row['post_attachment'], $is_auth);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
includes/usercp_viewprofile.php

# 
#-----[ FIND ]---------------------------------------------
# around line 169
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
display_upload_attach_box_limits($profiledata['user_id']);

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/modcp_body.tpl

#
#-----[ FIND ]---------------------------------------------
# around line 27 
	  <td class="row1"> <span class="topictitle">{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span></td>


#-----[ 在剛剛找到的那一行裡 FIND ]---------------------------------------------
# around line 27 (directly in that line)
{topicrow.TOPIC_TYPE}

# 
#-----[ 不要換行,直接在 前面 增加 ]---------------------------------------
# 
{topicrow.TOPIC_ATTACHMENT_IMG}

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/posting_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 258
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

# 
#-----[ 取代成 ]---------------------------------------
# PS. 是取代~~~!! 
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>

# 
#-----[ FIND ]---------------------------------------------
# around line 462
	{POLLBOX} 

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
	{ATTACHBOX}

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/posting_preview.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 13
					<span class="postbody">{MESSAGE}</span>

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
					<!-- BEGIN postrow -->
					{ATTACHMENTS}
					<!-- END postrow -->

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/posting_topic_review.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 26
				<td colspan="2"><span class="postbody">{postrow.MESSAGE}</span></td>

# 
#-----[ 在剛找到的那一行裡,再尋找 ]---------------------------------------------
# around line 26 (directly in that line)
{postrow.MESSAGE}</span>

# 
#-----[ 不要換行,直接在 後面 增加 ]---------------------------------------
# 
{postrow.ATTACHMENTS}

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/privmsgs_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 15
<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
  <tr> 

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
	<td align="right"> 
	  <!-- BEGIN switch_box_size_notice -->
	  <table width="175" cellspacing="1" cellpadding="2" border="0" class="bodyline">
		<tr> 
		  <td colspan="3" width="175" class="row1" nowrap="nowrap"><span class="gensmall">{ATTACH_BOX_SIZE_STATUS}</span></td>
		</tr>
		<tr> 
		  <td colspan="3" width="175" class="row2">
			<table cellspacing="0" cellpadding="1" border="0">
			  <tr> 
				<td bgcolor="{T_TD_COLOR2}"><img src="templates/subSilver/images/spacer.gif" width="{ATTACHBOX_LIMIT_IMG_WIDTH}" height="8" alt="{ATTACH_LIMIT_PERCENT}" /></td>
			  </tr>
			</table>
		  </td>
		</tr>
		<tr> 
		  <td width="33%" class="row1"><span class="gensmall">0%</span></td>
		  <td width="34%" align="center" class="row1"><span class="gensmall">50%</span></td>
		  <td width="33%" align="right" class="row1"><span class="gensmall">100%</span></td>
		</tr>
	  </table>
	  <!-- END switch_box_size_notice -->
	</td>

# 
#-----[ FIND ]---------------------------------------------
# around line 106
	  <td width="55%" valign="middle" class="{listrow.ROW_CLASS}"><span class="topictitle"> <a href="{listrow.U_READ}" class="topictitle">{listrow.SUBJECT}</a></span></td>

# 
#-----[ 在剛找到的那一行裡,再尋找 ]---------------------------------------------
# around line 106 (directly in that line)
<span class="topictitle"> <a href="{listrow.U_READ}" class="topictitle">{listrow.SUBJECT}\r

# 
#-----[ 不要換行,直接在 前面 增加 ]---------------------------------------
# 
{listrow.PRIVMSG_ATTACHMENTS_IMG}

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/privmsgs_preview.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 23
	<td valign="top" colspan="2" class="row1"><span class="postbody">{MESSAGE}</span></td>

# 
#-----[ 取代成 ]---------------------------------------
# PS. 是取代~~~!! 
#
	<td valign="top" colspan="2" class="row1"><span class="postbody">{MESSAGE}</span>
	<!-- BEGIN postrow -->
	{ATTACHMENTS}
	<!-- END postrow -->
	</td>

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/privmsgs_read_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 47
	  <td valign="top" colspan="3" class="row1"><span class="postbody">{MESSAGE}</span></td>

# 
#-----[ 取代成 ]---------------------------------------
# PS. 是取代~~~!! 
#
	  <td valign="top" colspan="3" class="row1"><span class="postbody">{MESSAGE}</span>
<!-- BEGIN postrow -->
	{ATTACHMENTS}
<!-- END postrow -->
	  </td>

# 
#-----[ FIND ]---------------------------------------------
# around line 74
		<input type="submit" name="delete" value="{L_DELETE_MSG}" class="liteoption" />

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
<!-- BEGIN switch_attachments -->
		  
		<input type="submit" name="pm_delete_attach" value="{L_DELETE_ATTACHMENTS}" class="liteoption" />
<!-- END switch_attachments -->

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/profile_view_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 41
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
<!-- BEGIN switch_upload_limits -->
		<tr> 
			<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_UPLOAD_QUOTA}:</span></td>
			<td> 
				<table width="175" cellspacing="1" cellpadding="2" border="0" class="bodyline">
				<tr> 
					<td colspan="3" width="100%" class="row2">
						<table cellspacing="0" cellpadding="1" border="0">
						<tr> 
							<td bgcolor="{T_TD_COLOR2}"><img src="templates/subSilver/images/spacer.gif" width="{UPLOAD_LIMIT_IMG_WIDTH}" height="8" alt="{UPLOAD_LIMIT_PERCENT}" /></td>
						</tr>
						</table>
					</td>
				</tr>
				<tr> 
					<td width="33%" class="row1"><span class="gensmall">0%</span></td>
					<td width="34%" align="center" class="row1"><span class="gensmall">50%</span></td>
					<td width="33%" align="right" class="row1"><span class="gensmall">100%</span></td>
				</tr>
				</table>
				<b><span class="genmed">[{UPLOADED} / {QUOTA} / {PERCENT_FULL}]</span> </b><br />
				<span class="genmed"><a href="{U_UACP}" class="genmed">{L_UACP}</a></span></td>
			</td>
		</tr>
<!-- END switch_upload_limits -->

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/viewforum_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 26
	  <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />

# 
#-----[ 在剛找到的那一行裡,再尋找 ]---------------------------------------------
# around line 26 (directly in that line)
{topicrow.NEWEST_POST_IMG}

# 
#-----[ 不要換行,直接在 後面 增加 ]---------------------------------------
# 
{topicrow.TOPIC_ATTACHMENT_IMG}

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/viewtopic_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 39
				<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>

# 
#-----[ 在剛找到的那一行裡,再尋找 ]---------------------------------------------
# around line 39 (directly in that line)
{postrow.SIGNATURE}

# 
#-----[ 不要換行,直接在 前面 增加 ]---------------------------------------
# 
</span>{postrow.ATTACHMENTS}<span class="postbody">

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/admin/group_edit_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 48
	<!-- END group_edit -->

# 
#-----[ BEFORE, ADD ]---------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_UPLOAD_QUOTA}</span></td>
	  <td class="row2">{S_SELECT_UPLOAD_QUOTA}</td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_PM_QUOTA}</span></td>
	  <td class="row2">{S_SELECT_PM_QUOTA}</td>
	</tr>

# 
#-----[ 開啟檔案 ]---------------------------------------------
# 
templates/subSilver/admin/user_edit_body.tpl

# 
#-----[ FIND ]---------------------------------------------
# around line 267
	  <td class="row1" colspan="2"><span class="gensmall">{L_SPECIAL_EXPLAIN}</span></td>
	</tr>

# 
#-----[ AFTER, ADD ]---------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_UPLOAD_QUOTA}</span></td>
	  <td class="row2">{S_SELECT_UPLOAD_QUOTA}</td>
	</tr>
	<tr> 
	  <td class="row1"><span class="gen">{L_PM_QUOTA}</span></td>
	  <td class="row2">{S_SELECT_PM_QUOTA}</td>
	</tr>

# 
主題已鎖定

回到「非官方認證外掛」