Jasne, że się da
Wykonujesz zapytanie mysql
Kod:
ALTER TABLE `phpbb_users`
ADD `send_pm_email` TINYINT( 1 ) DEFAULT '1' NOT NULL;
includes/usercp_register.phpZnajdź
Kod:
$popup_pm = ( isset($HTTP_POST_VARS['popup_pm']) ) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
dodaj po
Kod:
$send_pm_email = ( isset($HTTP_POST_VARS['send_pm_email']) ) ? ( ($HTTP_POST_VARS['send_pm_email']) ? TRUE : 0 ) : 0;
Znajdź
Kod:
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" ......
Znajdź, w linii
Kod:
user_popup_pm = $popup_pm,
dodaj po
Kod:
send_pm_email = $send_pm_email,
Znajdź
Kod:
$popup_pm = $userdata['user_popup_pm'];
dodaj po
Kod:
$send_pm_email = $userdata['send_pm_email'];
Znajdź
Kod:
'POPUP_PM_YES' => ( $popup_pm ) ? 'checked="checked"' : '',
'POPUP_PM_NO' => ( !$popup_pm ) ? 'checked="checked"' : '',
dodaj po
Kod:
'L_SEND_PM_EMAIL' => $lang['send_pm_email'],
'L_SEND_PM_EMAIL_EXPLAIN' => $lang['send_pm_email_explain'],
'SEND_PM_EMAIL_YES' => ( $send_pm_email ) ? 'checked="checked"' : '',
'SEND_PM_EMAIL_NO' => ( !$send_pm_email ) ? 'checked="checked"' : '',
templates/Twój_styl/profile_add_body.tplZnajdź
Kod:
<tr>
<td class="row1"><span class="gen">{L_POPUP_ON_PRIVMSG}:</span><br /><span class="gensmall">{L_POPUP_ON_PRIVMSG_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="popup_pm" value="1" {POPUP_PM_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="popup_pm" value="0" {POPUP_PM_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
dodaj przed
Kod:
<tr>
<td class="row2"><span class="gen">{L_SEND_PM_EMAIL}:</span><br />
<span class="gensmall">{L_SEND_PM_EMAIL_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="send_pm_email" value="1" {SEND_PM_EMAIL_YES} />
<span class="genmed">{L_YES}</span>
<input type="radio" name="send_pm_email" value="0" {SEND_PM_EMIAL_NO} />
<span class="genmed">{L_NO}</span></td>
</tr>
language/lang_polish/lang_main.phpZnajdź
Kod:
//
// That's all, Folks!
dodaj przed
Kod:
$lang['send_pm_email'] = 'Powiadamiaj o pochwałach i ostrzeżeniach';
$lang['send_pm_email_explain'] = 'Je¶li chesz otzymywać e-maila z powiadomieniem o pochwale lub ostrzeżeniu zaznacz tak';
plusminus.phpZnajdź
Kod:
$sql='SELECT username FROM '.USERS_TABLE.' WHERE user_id='.$id;
zamień na
Kod:
$sql='SELECT username, user_level, user_email, user_lang, send_pm_email FROM '.USERS_TABLE.' WHERE user_id='.$id;
Znajdź
Kod:
$nick=$row['username'];
dodaj po
Kod:
$user_level=$row['user_level'];
$user_email = $row['user_email'];
$user_lang = $row['user_lang'];
$send_pm_email = $row['send_pm_email'];
Znajdź
Kod:
$message=sprintf($lang['Plusminus_user_has_been_banned'],$nick);
dodaj przed
Kod:
if ($send_pm_email == 1)
{
//SEND MAIL
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($user_email);
$email_headers = "To: \"".$nick."\" <".$user_email. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$emailer->use_template("pm_ban",(file_exists($phpbb_root_path . "language/lang_" . $user_lang . "/email/pm_ban.tpl"))?$user_lang : "");
$emailer->set_subject($lang['you_are_baned']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'USERNAME' => $nick,
'USER_BANED' => $userdata['username'],
'SITENAME' => $board_config['sitename'],
'EMAIL_SIG' => $board_config['board_email_sig']));
$emailer->send();
$emailer->reset();
//SEND MAIL
}
Znajdź
Kod:
$message=sprintf($lang['Plusminus_user_has_been_unbanned'],$nick);
dodaj przed
Kod:
if ($send_pm_email == 1)
{
//SEND MAIL
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($user_email);
$email_headers = "To: \"".$nick."\" <".$user_email. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$emailer->use_template("pm_unban",(file_exists($phpbb_root_path . "language/lang_" . $user_lang . "/email/pm_unban.tpl"))?$user_lang : "");
$emailer->set_subject($lang['you_are_unbaned']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'USERNAME' => $nick,
'SITENAME' => $board_config['sitename'],
'EMAIL_SIG' => $board_config['board_email_sig']));
$emailer->send();
$emailer->reset();
//SEND MAIL
}
Znajdź
Kod:
$message=sprintf($lang['Plusminus_user_has_been_disallowed'],$nick);
dodaj przed
Kod:
if ($send_pm_email == 1)
{
//SEND MAIL
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($user_email);
$email_headers = "To: \"".$nick."\" <".$user_email. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$emailer->use_template("pm_disallow",(file_exists($phpbb_root_path . "language/lang_" . $user_lang . "/email/pm_disallow.tpl"))?$user_lang : "");
$emailer->set_subject($lang['you_are_disallow']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'USERNAME' => $nick,
'USER_DISALLOWED' => $userdata['username'],
'SITENAME' => $board_config['sitename'],
'EMAIL_SIG' => $board_config['board_email_sig']));
$emailer->send();
$emailer->reset();
//SEND MAIL
}
Znajdź
Kod:
$message=sprintf($lang['Plusminus_user_has_been_allowed'],$nick);
dodaj przed
Kod:
if ($send_pm_email == 1)
{
//SEND MAIL
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($user_email);
$email_headers = "To: \"".$nick."\" <".$user_email. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$emailer->use_template("pm_allow",(file_exists($phpbb_root_path . "language/lang_" . $user_lang . "/email/pm_allow.tpl"))?$user_lang : "");
$emailer->set_subject($lang['you_are_allow']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'USERNAME' => $nick,
'SITENAME' => $board_config['sitename'],
'EMAIL_SIG' => $board_config['board_email_sig']));
$emailer->send();
$emailer->reset();
//SEND MAIL
}
Znajdź
Kod:
$reason=str_replace("\'", "''",$_POST['reason']);
dodaj po
Kod:
if ($type == 'plus')
{
if ($send_pm_email == 1)
{
//SEND MAIL
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path'])). '/viewtopic.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($user_email);
$email_headers = "To: \"".$username."\" <".$user_email. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$emailer->use_template("pm_plus",(file_exists($phpbb_root_path . "language/lang_" . $user_lang . "/email/pm_plus.tpl"))?$user_lang : "");
$emailer->set_subject($lang['add_plus']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'POST_URL' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "=$post_id#$post_id",
'USERNAME' => $nick,
'REASON' => $reason,
'FROM_USER' => $userdata['username'],
'SITENAME' => $board_config['sitename'],
'EMAIL_SIG' => $board_config['board_email_sig']));
$emailer->send();
$emailer->reset();
//SEND MAIL
}
}
if ($type == 'minus')
{
if ($send_pm_email == 1)
{
//SEND MAIL
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path'])). '/viewtopic.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->email_address($user_email);
$email_headers = "To: \"".$username."\" <".$user_email. ">\r\n";
$email_headers .= "From: \"".$board_config['sitename']."\" <".$board_config['board_email'].">\r\n";
$emailer->use_template("pm_minus",(file_exists($phpbb_root_path . "language/lang_" . $user_lang . "/email/pm_minus.tpl"))?$user_lang : "");
$emailer->set_subject($lang['add_minus']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'POST_URL' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "=$post_id#$post_id",
'USERNAME' => $nick,
'REASON' => $reason,
'FROM_USER' => $userdata['username'],
'SITENAME' => $board_config['sitename'],
'EMAIL_SIG' => $board_config['board_email_sig']));
$emailer->send();
$emailer->reset();
//SEND MAIL
}
}
Jeszcze
Kod:
copy pm_ban.tpl to /language/lang_polish/email/pm_ban.tpl
copy pm_unban.tpl to /language/lang_polish/email/pm_unban.tpl
copy pm_disallow.tpl to /language/lang_polish/email/pm_disallow.tpl
copy pm_allow.tpl to /language/lang_polish/email/pm_allow.tpl
copy pm_plus.tpl to /language/lang_polish/email/pm_plus.tpl
copy pm_minus.tpl to /language/lang_polish/email/pm_minus.tpl
Uffff....
HF
Autor postu otrzymał pochwałę
[url=http://www.link-vault.com/?ss=13287][color=#D70000][b]Wymiana linkami[/b][/color][/url]
[url=http://forum.wpc.net.pl]Warcraft Players Community[/url]