Функция за прикачване на файлове
#################################################################
## Име на мода: File Attachment Mod v2
## Превод на мода: koko92_national
## Описание:
## Този мод дава възможност за прикачване на файлове км форума ви.
## Тази версия е тествана и работи под phpBB 2.0.23.
## Версия: 2.4.5
##
## Ниво на инсталация: Средно
## Време за инсталация: 20 минути
## Файлове за промяна:
## common.php,
## faq.php,
## modcp.php,
## posting.php,
## privmsg.php,
## viewforum.php,
## viewtopic.php,
## admin/admin_forumauth.php,
## admin/admin_ug_auth.php,
## admin/admin_forums.php,
## admin/admin_groups.php,
## admin/admin_users.php,
## includes/auth.php,
## includes/functions.php,
## includes/functions_admin.php,
## includes/prune.php,
## includes/topic_review.php,
## includes/usercp_viewprofile.php,
## templates/subSilver/modcp_body.tpl,
## templates/subSilver/posting_body.tpl,
## templates/subSilver/posting_preview.tpl,
## templates/subSilver/posting_topic_review.tpl,
## templates/subSilver/privmsgs_body.tpl,
## templates/subSilver/privmsgs_preview.tpl,
## templates/subSilver/privmsgs_read_body.tpl,
## templates/subSilver/profile_view_body.tpl,
## templates/subSilver/viewforum_body.tpl,
## templates/subSilver/viewtopic_body.tpl,
## templates/subSilver/admin/group_edit_body.tpl,
## templates/subSilver/admin/user_edit_body.tpl
##
## Добавени файлове: Много
## Лиценз: GNU General Public License v2
##############################################################
## Преди да редактирате файловете моля направете Back-up на файловете,
## които ще редактирате.
##############################################################
#
# Тук започва инсталацията и моля спазвайте внимателно стъпките!!!
#
Изтеглете файловете от ТУК
#
# Стъпка 1: Качете всички нови файлове
#

#
# Стъпка 2: Инсталирайте базата данни на форума
#

#
# Стъпка 3: Нека редактираме нужните файлове:
#


#
#-----[ Отвори ]---------------------------------------------
#
common.php

#
#-----[ Намери ]---------------------------------------------
#
$board_config[$row['config_name'> = $row['config_value'];
}

#
#-----[ След това добави ]--------------------------------------
#
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);

#
#-----[ Отвори ]---------------------------------------------
#
faq.php

#
#-----[ Намери ]---------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);

#
#-----[ След това добави ]---------------------------------------
#
attach_faq_include($lang_file);

#
#-----[ Отвори ]---------------------------------------------
#
modcp.php

#
#-----[ Намери ]---------------------------------------------
#
remove_search_post($post_id_sql);

#
#-----[ След това добави ]---------------------------------------
#
delete_attachment(explode(', ', $post_id_sql));

#
#-----[ Намери ]---------------------------------------------
#
'TOPIC_ID' => $topic_id,

#
#-----[ След това добави ]---------------------------------------
#
'TOPIC_ATTACHMENT_IMG' => topic_attachment_image($row['topic_attachment']),

#
#-----[ Отвори ]---------------------------------------------
#
posting.php

#
#-----[ Намери ]---------------------------------------------
#
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );

#
#-----[ След това добави ]---------------------------------------
#
execute_posting_attachment_handling();

#
#-----[ Намери ]---------------------------------------------
#
update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $user_id);
}

#
#-----[ След това добави ]---------------------------------------
#
$attachment_mod['posting']->insert_attachment($post_id);

#
#-----[ Намери ]---------------------------------------------
#
'preview' => 'posting_preview.tpl')
);

#
#-----[ След това добави ]---------------------------------------
#
$attachment_mod['posting']->preview_attachments();

#
#-----[ Отвори ]---------------------------------------------
#
privmsg.php

#
#-----[ Намери ]---------------------------------------------
#
// ----------
// Start main

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]--------------------------------------
#
execute_privmsgs_attachment_handling($mode);

#
#-----[ Намери ]---------------------------------------------
#
//
// Pick a folder, any folder, so long as it's one below ...

#
#-----[ ПРЕДИ ТОВА ДОБАВОИ ]--------------------------------------
#
$attachment_mod['pm']->duplicate_attachment_pm($privmsg['privmsgs_attachment'], $privmsg['privmsgs_id'], $privmsg_sent_id);

#
#-----[ Намери ]---------------------------------------------
#
$user_id_to = $privmsg['user_id_2'];

#
#-----[ След това добави ]---------------------------------------
#
init_display_pm_attachments($privmsg['privmsgs_attachment']);

#
#-----[ Намери ]---------------------------------------------
#
$mark_list[] = $row['privmsgs_id'];
}

unset($delete_type);

#
#-----[ След това добави ]---------------------------------------
#
$attachment_mod['pm']->delete_all_pm_attachments($mark_list);

#
#-----[ Намери ]---------------------------------------------
#
if ( $mode != 'edit' )
{
//
// Add to the users new pm counter
//

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
$attachment_mod['pm']->insert_attachment_pm($privmsg_id);

#
#-----[ Намери ]---------------------------------------------
#
"preview" => 'privmsgs_preview.tpl')
);

#
#-----[ След това добави ]---------------------------------------
#
$attachment_mod['pm']->preview_attachments();

#
#-----[ Намери ]---------------------------------------------
#
'DATE' => $msg_date,

#
#-----[ След това добави ]---------------------------------------
#
'PRIVMSG_ATTACHMENTS_IMG' => privmsgs_attachment_image($privmsg_id),

#
#-----[ Отвори ]---------------------------------------------
#
viewforum.php

#
#-----[ Намери ]---------------------------------------------
#
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';

#
#-----[ След това добави ]---------------------------------------
#
attach_build_auth_levels($is_auth, $s_auth_can);

#
#-----[ Намери ]---------------------------------------------
#
'NEWEST_POST_IMG' => $newest_post_img,

#
#-----[ След това добави ]---------------------------------------
#
'TOPIC_ATTACHMENT_IMG' => topic_attachment_image($topic_rowset[$i]['topic_attachment']),

#
#-----[ Отвори ]---------------------------------------------
#
viewtopic.php

#
#-----[ Намери ]---------------------------------------------
#
AND f.forum_id = t.forum_id
$order_sql";

#
#-----[ След това добави ]---------------------------------------
#
attach_setup_viewtopic_auth($order_sql, $sql);

#
#-----[ Намери ]---------------------------------------------
#
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';

#
#-----[ След това добави ]---------------------------------------
#
attach_build_auth_levels($is_auth, $s_auth_can);

#
#-----[ Намери ]---------------------------------------------
#
//
// Update the topic view counter

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
init_display_post_attachments($forum_topic_data['topic_attachment']);

#
#-----[ Намери ]---------------------------------------------
#
'U_POST_ID' => $postrow[$i]['post_id'])
);

#
#-----[ След това добави ]---------------------------------------
#
display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);

#
#-----[ Отвори ]---------------------------------------------
#
admin/admin_forumauth.php

#
#-----[ Намери ]---------------------------------------------
#
$forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN);

#
#-----[ След това добави ]---------------------------------------
#
attach_setup_forum_auth($simple_auth_ary, $forum_auth_fields, $field_names);

#
#-----[ Отвори ]---------------------------------------------
#
admin/admin_forums.php

#
#-----[ НамериD ]---------------------------------------------
#
//
// Mode setting

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
$forum_auth_ary['auth_attachments'] = AUTH_REG;
$forum_auth_ary['auth_download'] = AUTH_REG;

#
#-----[ Отвори ]---------------------------------------------
#
admin/admin_groups.php

#
#-----[ Намери ]---------------------------------------------
#
if ( isset($HTTP_POST_VARS['edit']) || isset($HTTP_POST_VARS['new']) )

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
attachment_quota_settings('group', $HTTP_POST_VARS['group_update'], $mode);

#
#-----[ Отвори ]---------------------------------------------
#
admin/admin_ug_auth.php

#
#-----[ Намери ]---------------------------------------------
#
// ---------------
// Start Functions

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
attach_setup_usergroup_auth($forum_auth_fields, $auth_field_match, $field_names);

#
#-----[ Отвори ]---------------------------------------------
#
admin/admin_users.php

#
#-----[ Намери ]---------------------------------------------
#
//
// Ok, the profile has been modified and submitted, let's update

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
attachment_quota_settings('user', $HTTP_POST_VARS['submit'], $mode);

#
#-----[ Отвори ]---------------------------------------------
#
includes/auth.php

#
#-----[ Намери ]---------------------------------------------
#
case AUTH_ATTACH:
break;

default:
break;
}

#
#-----[ След това добави ]---------------------------------------
#
attach_setup_basic_auth($type, $auth_fields, $a_sql);

#
#-----[ Отвори ]---------------------------------------------
#
includes/functions.php

#
#-----[ Намери ]---------------------------------------------
#
//
// Set up style

#
#-----[ Преди това добави ]---------------------------------------
#
include_attach_lang();

#
#-----[ Отвори ]---------------------------------------------
#
includes/functions_admin.php

#
#-----[ Намери ]---------------------------------------------
#
}
break;
}

return true;

#
#-----[ Преди това добави ]---------------------------------------
#
attachment_sync_topic($id);

#
#-----[ Отвори ]---------------------------------------------
#
includes/prune.php

#
#-----[ Намери ]---------------------------------------------
#
remove_search_post($sql_post);

#
#-----[ След това добави ]---------------------------------------
#
prune_attachments($sql_post);

#
#-----[ Отвори ]---------------------------------------------
#
includes/topic_review.php

#
#-----[ Намери ]---------------------------------------------
#
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id";

#
#-----[ След това добави ]---------------------------------------
#
$tmp = '';
attach_setup_viewtopic_auth($tmp, $sql);

#
#-----[ Намери ]---------------------------------------------
#
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
init_display_review_attachments($is_auth);

#
#-----[ Намери ]---------------------------------------------
#
'L_MINI_POST_ALT' => $mini_post_alt)
);

#
#-----[ След това добави ]---------------------------------------
#
display_review_attachments($row['post_id'], $row['post_attachment'], $is_auth);

#
#-----[ Отвори ]---------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ Намери ]---------------------------------------------
#
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

#
#-----[ След това добави ]---------------------------------------
#
display_upload_attach_box_limits($profiledata['user_id']);

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/modcp_body.tpl

#
#-----[ Намери ]---------------------------------------------
#
<td class="row1"> <span class="topictitle">{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span></td>

#
#-----[ В реда намери ]---------------------------------------------
# around line 27 (directly in that line)
{topicrow.TOPIC_TYPE}

#
#-----[ В реда преди него добави ]---------------------------------------
#
{topicrow.TOPIC_ATTACHMENT_IMG}

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ Намери ]---------------------------------------------
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

#
#-----[ Замести с ]---------------------------------------
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>

#
#-----[ Намери ]---------------------------------------------
#
{POLLBOX}

#
#-----[ ПРЕДИ ТОВА ДОБАВИ ]---------------------------------------
#
{ATTACHBOX}

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/posting_preview.tpl

#
#-----[ Намери ]---------------------------------------------
#
<span class="postbody">{MESSAGE}</span>

#
#-----[ След това добави ]---------------------------------------
#
<!-- BEGIN postrow -->
{ATTACHMENTS}
<!-- END postrow -->

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/posting_topic_review.tpl

#
#-----[ Намери ]---------------------------------------------
#
<td colspan="2"><span class="postbody">{postrow.MESSAGE}</span></td>

#
#-----[ В реда намери ]---------------------------------------------
#
{postrow.MESSAGE}</span>

#
#-----[ В реда след това добави ]---------------------------------------
#
{postrow.ATTACHMENTS}

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/privmsgs_body.tpl

#
#-----[ Намери ]---------------------------------------------
#
<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
<tr>

#
#-----[ След това добави ]---------------------------------------
#
<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>

#
#-----[ Намери ]---------------------------------------------
#
<td width="55%" valign="middle" class="{listrow.ROW_CLASS}"><span class="topictitle"> <a href="{listrow.U_READ}" class="topictitle">{listrow.SUBJECT}</a></span></td>

#
#-----[ В реда намери ]---------------------------------------------
#
<span class="topictitle"> <a href="{listrow.U_READ}" class="topictitle">{listrow.SUBJECT}

#
#-----[ В реда преди това добави ]---------------------------------------
#
{listrow.PRIVMSG_ATTACHMENTS_IMG}

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/privmsgs_preview.tpl

#
#-----[ Намери ]---------------------------------------------
#
<td valign="top" colspan="2" class="row1"><span class="postbody">{MESSAGE}</span></td>

#
#-----[ Замести с ]---------------------------------------
#
<td valign="top" colspan="2" class="row1"><span class="postbody">{MESSAGE}</span>
<!-- BEGIN postrow -->
{ATTACHMENTS}
<!-- END postrow -->
</td>

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/privmsgs_read_body.tpl

#
#-----[ Намери ]---------------------------------------------
#
<td valign="top" colspan="3" class="row1"><span class="postbody">{MESSAGE}</span></td>

#
#-----[ Замести с ]---------------------------------------
#
<td valign="top" colspan="3" class="row1"><span class="postbody">{MESSAGE}</span>
<!-- BEGIN postrow -->
{ATTACHMENTS}
<!-- END postrow -->
</td>

#
#-----[ Намери ]---------------------------------------------
#
<input type="submit" name="delete" value="{L_DELETE_MSG}" class="liteoption" />

#
#-----[ След това добави ]---------------------------------------
#
<!-- 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

#
#-----[ Намери ]---------------------------------------------
#
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>

#
#-----[ След това добави ]---------------------------------------
#
<!-- 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

#
#-----[ Намери ]---------------------------------------------
#
<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 />

#
#-----[ В реда намери ]---------------------------------------------
#
{topicrow.NEWEST_POST_IMG}

#
#-----[ В реда след това добави ]---------------------------------------
#
{topicrow.TOPIC_ATTACHMENT_IMG}

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ Намери ]---------------------------------------------
#
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>

#
#-----[ В реда намери ]---------------------------------------------
#
{postrow.SIGNATURE}

#
#-----[ В реда преди това добави ]---------------------------------------
#
</span>{postrow.ATTACHMENTS}<span class="postbody">

#
#-----[ Отвори ]---------------------------------------------
#
templates/subSilver/admin/group_edit_body.tpl

#
#-----[ Намери ]---------------------------------------------
#
<!-- END group_edit -->

#
#-----[ Преди това добави ]---------------------------------------
#
<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

#
#-----[ Намери ]---------------------------------------------
#
<td class="row1" colspan="2"><span class="gensmall">{L_SPECIAL_EXPLAIN}</span></td>
</tr>

#
#-----[ След това добави ]---------------------------------------
#
<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>

#
#-----[ Запишете и затворете всички файлове ]------------------------------------------
#

#-----[ EoM ]------------------------------------------

След като приключите с редактирането отворете следнито: http://форума.ви/install_attach/install.php
http://форума.ви/install_attach/update_to_latest.php

Демо засега нямам. Скоро ще дам. Успех!!



/ Трябва да сте регистриран за да напишете коментар /
От: SeFo
11:52 22-08-2010
линка за фаиловете не ти работи :shock:
От: koko92_national
14:32 22-08-2010
Оправих линка. Извинявам се :)
1