Мод – Снимка в профила
Здравейте .
Видях че във форума беше пусната тема точно за този мод и реших да го добавя (Източник : phpBBhacks.com) Ето и инструкциите за него …
#
# Първо копираме всички файлове в тяхните директории;
#
# Ето ги и тях:
# /profilephoto_mod.php
# /mod_table_inst.php (Изтрийте ги след инсталация)
#
# /templates/Вашият Темплейт/profile_photo_box.tpl
#
# /language/Вашият Език/lang_profilephoto.php
#
Сега искаме да добавиме таблиците във БД. Използваме съставения инсталатор mod_table_inst.php (http://www.твоят сайт.ком/папката на форума/mod_table_inst.php)
След като сме инсталирали БД и сложили файловете по местата им следват промените във файловете на форума . Моля следвайте инструкциите внимателно за да не се допускат излишни грешки...!!!!!!
#
# Промяна по файловете на форума
#
#
#-----[ Отваряме ]---------------------------------------------
#
./profile.php
#
#-----[ Намираме следния ред ]---------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ След него добавяме ]---------------------------------------
#
include($phpbb_root_path . 'profilephoto_mod.'.$phpEx);
#
#-----[ в същия файл намираме ]---------------------------------------------
#
// End page specific functions
// ---------------------------
#
#-----[ След него добавяме ]---------------------------------------
#
$profilephoto_mod->execute_mod();
#
#-----[ Отваряме ]---------------------------------------------
#
./admin/admin_board.php
#
#-----[ Намираме ]---------------------------------------------
#
$template->set_filenames(array(
"body" => "admin/board_config_body.tpl")
);
#
#-----[ След него добавяме ]---------------------------------------
#
//
// Profile Photo Mod
//
if ( !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_profilephoto.'.$phpEx) )
{
include($phpbb_root_path . 'language/lang_english/lang_profilephoto.'.$phpEx);
}
else
{
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_profilephoto.' . $phpEx);
}
$photo_remote_yes = ( $new['allow_photo_remote'] ) ? 'checked="checked"' : '';
$photo_remote_no = ( !$new['allow_photo_remote'] ) ? 'checked="checked"' : '';
$photo_upload_yes = ( $new['allow_photo_upload'] ) ? 'checked="checked"' : '';
$photo_upload_no = ( !$new['allow_photo_upload'] ) ? 'checked="checked"' : '';
$template->assign_vars(array(
'L_PROFLE_PHOTO_SETTINGS' => $lang['Profile_photo_settings'],
'L_ALLOW_PHOTO_REMOTE' => $lang['Allow_photo_remote'],
'L_ALLOW_PHOTO_REMOTE_EXPLAIN' => $lang['Allow_photo_remote_explain'],
'L_ALLOW_PHOTO_UPLOAD' => $lang['Allow_photo_upload'],
'L_PHOTO_MAX_FILESIZE' => $lang['Photo_max_filesize'],
'L_PHOTO_MAX_FILESIZE_EXPLAIN' => $lang['Photo_max_filesize_explain'],
'L_MAX_PHOTO_SIZE' => $lang['Max_photo_size'],
'L_PHOTO_STORAGE_PATH' => $lang['Photo_storage_path'],
'L_PHOTO_STORAGE_PATH_EXPLAIN' => $lang['Photo_storage_path_explain'],
'PHOTO_REMOTE_YES' => $photo_remote_yes,
'PHOTO_REMOTE_NO' => $photo_remote_no,
'PHOTO_UPLOAD_YES' => $photo_upload_yes,
'PHOTO_UPLOAD_NO' => $photo_upload_no,
'PHOTO_FILESIZE' => $new['photo_filesize'],
'PHOTO_MAX_HEIGHT' => $new['photo_max_height'],
'PHOTO_MAX_WIDTH' => $new['photo_max_width'],
'PHOTO_PATH' => $new['photo_path'])
);
#
#-----[ Отваряме ]---------------------------------------------
#
./includes/usercp_register.php
#
#-----[ Намираме ]---------------------------------------------
#
$error = FALSE;
#
#-----[ Заместваме със ]-------------------------------------
#
// $error = FALSE;
#
#-----[ В същия файл намираме ]---------------------------------------------
#
message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ След него добавяме ]---------------------------------------
#
$profilephoto_mod->photo_insert($mode);
#
#-----[ Отваряме ]---------------------------------------------
#
./templates/subSilver/profile_add_body.tpl
#
#-----[ Намираме ]---------------------------------------------
#
<input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" />
#
#-----[ Заменяме със ]-------------------------------------
#
<!--<input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" />-->
#
#-----[В Същия Файл Намираме ]---------------------------------------------
#
<!-- END switch_avatar_block -->
#
#-----[ След него добавяме ]---------------------------------------
#
{PHOTO_BOX}
#
#-----[ Отваряме ]---------------------------------------------
#
./templates/subSilver/profile_view_body.tpl
#
#-----[ Намираме ]---------------------------------------------
#
//--></script><noscript>{ICQ_IMG}</noscript></td>
</tr>
</table>
</td>
</tr>
#
#-----[ След него добавяме ]---------------------------------------
#
<tr>
<td class="catLeft" align="center" width="40%" height="28" colspan="2"><b><span class="gen">{L_PHOTO}</span></b></td>
<tr>
<td align="center" colspan="2" class="row1">{PHOTO_IMG}</td>
</tr>
#
#-----[ Отваряме ]---------------------------------------------
#
./templates/subSilver/admin/board_config_body.tpl
#
#-----[ Намираме ]---------------------------------------------
#
<td class="row2"><input type="text" size="20" maxlength="255" name="avatar_gallery_path" value="{AVATAR_GALLERY_PATH}" /></td>
</tr>
#
#-----[ След него добавяме ]---------------------------------------
#
<tr>
<th class="thHead" colspan="2">{L_PROFLE_PHOTO_SETTINGS}</th>
</tr>
<tr>
<td class="row1">{L_ALLOW_PHOTO_REMOTE} <br /><span class="gensmall">{L_ALLOW_PHOTO_REMOTE_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="allow_photo_remote" value="1" {PHOTO_REMOTE_YES} /> {L_YES} <input type="radio" name="allow_photo_remote" value="0" {PHOTO_REMOTE_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_ALLOW_PHOTO_UPLOAD}</td>
<td class="row2"><input type="radio" name="allow_photo_upload" value="1" {PHOTO_UPLOAD_YES} /> {L_YES} <input type="radio" name="allow_photo_upload" value="0" {PHOTO_UPLOAD_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_PHOTO_MAX_FILESIZE}<br /><span class="gensmall">{L_PHOTO_MAX_FILESIZE_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="4" maxlength="10" name="photo_filesize" value="{PHOTO_FILESIZE}" /> Bytes</td>
</tr>
<tr>
<td class="row1">{L_MAX_PHOTO_SIZE} <br />
<span class="gensmall">{L_MAX_AVATAR_SIZE_EXPLAIN}</span>
</td>
<td class="row2"><input type="text" size="3" maxlength="4" name="photo_max_height" value="{PHOTO_MAX_HEIGHT}" /> x <input type="text" size="3" maxlength="4" name="photo_max_width" value="{PHOTO_MAX_WIDTH}"></td>
</tr>
<tr>
<td class="row1">{L_PHOTO_STORAGE_PATH} <br /><span class="gensmall">{L_PHOTO_STORAGE_PATH_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="20" maxlength="255" name="photo_path" value="{PHOTO_PATH}" /></td>
</tr>
#
#-----[ Запазваме и затваряме всички файлове ]------------------------------------------
#
Трябва да създадете папка за снимките (Подобно на папката за аватарите) и слагаме CHMOD
за нея 777 за да може да ъплоудваме снимките. Директорията трябва да бъде следната 'images/photos'.
# EoM
Урока е преведен специално за Web-Tourist.Net.



