изменения и добавления следующего характера:
Код: Выделить всё
---------------------------------------------------------
***ВЫПОЛНИТЬ ЗАПРОС SQL**********************************
***(если нужно, заменить префикс "phpbb_" на свой)*******
ALTER TABLE phpbb_users ADD user_chess_addpm tinyint(1) NOT NULL DEFAULT '1';
---------------------------------------------------------
***ОТКРЫТЬ***********************************************
chess\includes\chess_posting.php
***НАЙТИ*************************************************
***(первая строка может отсутствовать********************
include($phpbb_root_path . 'adr/includes/adr_functions_communicate.'.$phpEx);
$subject = $lang['Topic_Chess'];
$dest = ($chess_info['chess_p1_id'] == $userdata['user_id'] ? $chess_info['chess_p2_id'] : $chess_info['chess_p1_id']);
$message = sprintf("Ваш ход");
adr_send_pm ($dest , $subject , $message );
***ЗАМЕНИТЬ НА*******************************************
$user_pm = ($chess_info['chess_p1_id'] == $userdata['user_id'] ? $chess_info['chess_p2_id'] : $chess_info['chess_p1_id']);
$sql = "SELECT user_chess_addpm FROM " . USERS_TABLE . " WHERE user_id = $user_pm LIMIT 1";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Непонятный облом", '', __LINE__, __FILE__, $sql);
}
$tempp = $db->sql_fetchrow($result);
$chess_addpm = $tempp['user_chess_addpm'];
if ($chess_addpm)
{
include($phpbb_root_path . 'adr/includes/adr_functions_communicate.'.$phpEx); // УДАЛИТЬ ЭТУ СТРОКУ, ЕСЛИ НЕ УСТАНОВЛЕН МОД ADR
$subject = $lang['Topic_Chess'];
$dest = $user_pm;
$message = sprintf("Ваш соперник по шахматам сделал свой ход. (Вы можете отключить сообщения шахматного раздела в своём профиле)");
adr_send_pm ($dest , $subject , $message );
}
---------------------------------------------------------
***ОТКРЫТЬ***********************************************
includes\usercp_register.php
***НАЙТИ*************************************************
$popup_pm = ( isset($HTTP_POST_VARS['popup_pm']) ) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
***ПЕРЕД, ДОБАВИТЬ***************************************
//
// *** added by Zlodey (for Chess) ***
$chessaddpm = ( isset($HTTP_POST_VARS['chessaddpm']) ) ? ( ($HTTP_POST_VARS['chessaddpm']) ? TRUE : 0 ) : TRUE;
// *** added by Zlodey (for Chess) ***
//
***НАЙТИ*************************************************
***(строка SET может быть иной в зависимости от установленных модов)
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
WHERE user_id = $user_id";
***В СТРОКЕ НАЙТИ ***************************************
user_notify_pm = $notifypm
***ПОСЛЕ, ДОБАВИТЬ***************************************
, user_chess_addpm = $chessaddpm
***НАЙТИ*************************************************
***(строки могут несколько отличаться в зависимости от установленных модов)
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
***В 1й СТРОКЕ НАЙТИ ************************************
user_notify_pm
***ПОСЛЕ, ДОБАВИТЬ***************************************
, user_chess_addpm
***В 2й СТРОКЕ НАЙТИ ************************************
$notifypm
***ПОСЛЕ, ДОБАВИТЬ***************************************
, $chessaddpm
***НАЙТИ*************************************************
$notifypm = $userdata['user_notify_pm'];
***ПОСЛЕ, ДОБАВИТЬ***************************************
//
// *** added by Zlodey (for Chess) ***
$chessaddpm = $userdata['user_chess_addpm'];
// *** added by Zlodey (for Chess) ***
//
***НАЙТИ*************************************************
'NOTIFY_PM_NO' => ( !$notifypm ) ? 'checked="checked"' : '',
***ПОСЛЕ, ДОБАВИТЬ***************************************
//
// *** added by Zlodey (for Chess) ***
'CHESS_PM_GLOBAL_YES' => ( $chessaddpm ) ? 'checked="checked"' : '',
'CHESS_PM_GLOBAL_NO' => ( !$chessaddpm ) ? 'checked="checked"' : '',
// *** added by Zlodey (for Chess) ***
//
---------------------------------------------------------
***ОТКРЫТЬ***********************************************
templates\subSilver\profile_add_body.tpl
***НАЙТИ*************************************************
<tr>
<td class="row1"><span class="gen">{L_HIDE_USER}:</span></td>
***ПЕРЕД, ДОБАВИТЬ***************************************
<!-- *** added by Zlodey (for Chess) *** -->
<tr>
<td class="row1"><span class="gen">Использовать систему уведомлений о ходе через ЛС?</span><br />
<span class="gensmall">Если соперник по шахматам сделает ход - вам будет выслано ЛС</span></td>
<td class="row2">
<input type="radio" name="chessaddpm" value="1" {CHESS_PM_GLOBAL_YES} />
<span class="gen">Да</span>
<input type="radio" name="chessaddpm" value="0" {CHESS_PM_GLOBAL_NO} />
<span class="gen">Нет </span><span class="gensmall"> (настройки шахматного раздела)</span></td>
</tr>
<!-- *** added by Zlodey (for Chess) *** -->
arhi или еще кто, отпишитесь по поводу возможности отключения уведомлений через ЛС, работает ли
а то вдруг я чего упустил в выложенном коде :-D
P.S. архив с дополнениями и инструкцией обновлен