mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Added global PM disable + modded emailer to allow lang select + re-added back box limits my dumbness removed recently
git-svn-id: file:///svn/phpbb/trunk@1305 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
75fadebad1
commit
d1fd694282
7 changed files with 83 additions and 15 deletions
|
@ -62,36 +62,53 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$style_select = style_select($new['default_style'], 'default_style', "../templates");
|
$style_select = style_select($new['default_style'], 'default_style', "../templates");
|
||||||
|
|
||||||
$admin_style_select = style_select($new['default_admin_style'], 'default_admin_style', "../templates");
|
$admin_style_select = style_select($new['default_admin_style'], 'default_admin_style', "../templates");
|
||||||
|
|
||||||
$lang_select = language_select($new['default_lang'], 'default_lang', "../language");
|
$lang_select = language_select($new['default_lang'], 'default_lang', "../language");
|
||||||
|
|
||||||
$timezone_select = tz_select($new['board_timezone'], 'board_timezone');
|
$timezone_select = tz_select($new['board_timezone'], 'board_timezone');
|
||||||
|
|
||||||
$html_tags = $new['allow_html_tags'];
|
$html_tags = $new['allow_html_tags'];
|
||||||
|
|
||||||
$override_user_style_yes = ( $new['override_user_style'] ) ? "checked=\"checked\"" : "";
|
$override_user_style_yes = ( $new['override_user_style'] ) ? "checked=\"checked\"" : "";
|
||||||
$override_user_style_no = ( !$new['override_user_style'] ) ? "checked=\"checked\"" : "";
|
$override_user_style_no = ( !$new['override_user_style'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : "";
|
$html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : "";
|
||||||
$html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : "";
|
$html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
|
$bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
|
||||||
$bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
|
$bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
|
$activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
|
||||||
$activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
|
$activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
|
||||||
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
|
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$gzip_yes = ( $new['gzip_compress'] ) ? "checked=\"checked\"" : "";
|
$gzip_yes = ( $new['gzip_compress'] ) ? "checked=\"checked\"" : "";
|
||||||
$gzip_no = ( !$new['gzip_compress'] ) ? "checked=\"checked\"" : "";
|
$gzip_no = ( !$new['gzip_compress'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
|
$privmsg_on = ( !$new['privmsg_disable'] ) ? "checked=\"checked\"" : "";
|
||||||
|
$privmsg_off = ( $new['privmsg_disable'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
|
$prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
|
||||||
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";
|
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$smile_yes = ( $new['allow_smilies'] ) ? "checked=\"checked\"" : "";
|
$smile_yes = ( $new['allow_smilies'] ) ? "checked=\"checked\"" : "";
|
||||||
$smile_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : "";
|
$smile_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$sig_yes = ( $new['allow_sig'] ) ? "checked=\"checked\"" : "";
|
$sig_yes = ( $new['allow_sig'] ) ? "checked=\"checked\"" : "";
|
||||||
$sig_no = ( !$new['allow_sig'] ) ? "checked=\"checked\"" : "";
|
$sig_no = ( !$new['allow_sig'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$namechange_yes = ( $new['allow_namechange'] ) ? "checked=\"checked\"" : "";
|
$namechange_yes = ( $new['allow_namechange'] ) ? "checked=\"checked\"" : "";
|
||||||
$namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";
|
$namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$avatars_local_yes = ( $new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";
|
$avatars_local_yes = ( $new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";
|
||||||
$avatars_local_no = ( !$new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";
|
$avatars_local_no = ( !$new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";
|
||||||
$avatars_remote_yes = ( $new['allow_avatar_remote'] ) ? "checked=\"checked\"" : "";
|
$avatars_remote_yes = ( $new['allow_avatar_remote'] ) ? "checked=\"checked\"" : "";
|
||||||
$avatars_remote_no = ( !$new['allow_avatar_remote'] ) ? "checked=\"checked\"" : "";
|
$avatars_remote_no = ( !$new['allow_avatar_remote'] ) ? "checked=\"checked\"" : "";
|
||||||
$avatars_upload_yes = ( $new['allow_avatar_upload'] ) ? "checked=\"checked\"" : "";
|
$avatars_upload_yes = ( $new['allow_avatar_upload'] ) ? "checked=\"checked\"" : "";
|
||||||
$avatars_upload_no = ( !$new['allow_avatar_upload'] ) ? "checked=\"checked\"" : "";
|
$avatars_upload_no = ( !$new['allow_avatar_upload'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
$smtp_yes = ( $new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
|
$smtp_yes = ( $new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
|
||||||
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
|
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
|
||||||
|
|
||||||
|
@ -110,6 +127,13 @@ $template->assign_vars(array(
|
||||||
"L_SITE_NAME" => $lang['Site_name'],
|
"L_SITE_NAME" => $lang['Site_name'],
|
||||||
"L_SITE_DESCRIPTION" => $lang['Site_desc'],
|
"L_SITE_DESCRIPTION" => $lang['Site_desc'],
|
||||||
"L_ACCT_ACTIVATION" => $lang['Acct_activation'],
|
"L_ACCT_ACTIVATION" => $lang['Acct_activation'],
|
||||||
|
"L_PRIVATE_MESSAGING" => $lang['Private_Messaging'],
|
||||||
|
"L_INBOX_LIMIT" => $lang['Inbox_limits'],
|
||||||
|
"L_SENTBOX_LIMIT" => $lang['Sentbox_limits'],
|
||||||
|
"L_SAVEBOX_LIMIT" => $lang['Savebox_limits'],
|
||||||
|
"L_DISABLE_PRIVATE_MESSAGING" => $lang['Disable_privmsg'],
|
||||||
|
"L_ENABLED" => $lang['Enabled'],
|
||||||
|
"L_DISABLED" => $lang['Disabled'],
|
||||||
|
|
||||||
"SITENAME" => $new['sitename'],
|
"SITENAME" => $new['sitename'],
|
||||||
"SITE_DESCRIPTION" => $new['site_desc'],
|
"SITE_DESCRIPTION" => $new['site_desc'],
|
||||||
|
@ -130,6 +154,11 @@ $template->assign_vars(array(
|
||||||
"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
|
"L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
|
||||||
"DEFAULT_DATEFORMAT" => $new['default_dateformat'],
|
"DEFAULT_DATEFORMAT" => $new['default_dateformat'],
|
||||||
"TIMEZONE_SELECT" => $timezone_select,
|
"TIMEZONE_SELECT" => $timezone_select,
|
||||||
|
"S_PRIVMSG_ENABLED" => $privmsg_on,
|
||||||
|
"S_PRIVMSG_DISABLED" => $privmsg_off,
|
||||||
|
"INBOX_LIMIT" => $new['max_inbox_privmsgs'],
|
||||||
|
"SENTBOX_LIMIT" => $new['max_sentbox_privmsgs'],
|
||||||
|
"SAVEBOX_LIMIT" => $new['max_savebox_privmsgs'],
|
||||||
"GZIP_YES" => $gzip_yes,
|
"GZIP_YES" => $gzip_yes,
|
||||||
"GZIP_NO" => $gzip_no,
|
"GZIP_NO" => $gzip_no,
|
||||||
"PRUNE_YES" => $prune_yes,
|
"PRUNE_YES" => $prune_yes,
|
||||||
|
|
|
@ -51,6 +51,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_admin_styl
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat','D M d, Y g:i a');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat','D M d, Y g:i a');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone','0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone','0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('prune_enable','1');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('prune_enable','1');
|
||||||
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('privmsg_disable','0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', '');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', '');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
|
||||||
|
|
|
@ -51,6 +51,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_admin_styl
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat','D M d, Y g:i a');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat','D M d, Y g:i a');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone','0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone','0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('prune_enable','1');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('prune_enable','1');
|
||||||
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('privmsg_disable','0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', '');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', '');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
|
||||||
|
|
|
@ -84,23 +84,24 @@ class emailer
|
||||||
$this->extra_headers = $headers;
|
$this->extra_headers = $headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
function use_template($template_file)
|
function use_template($template_file, $template_lang = "")
|
||||||
{
|
{
|
||||||
global $board_config;
|
global $board_config, $phpbb_root_path;
|
||||||
|
|
||||||
$phpbb_root_path = "./";
|
if( $template_lang == "" )
|
||||||
$template_file = $phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/email/" . $template_file . ".tpl";
|
{
|
||||||
if (!file_exists($template_file))
|
$template_lang = $board_config['default_lang'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$template_file = $phpbb_root_path . "language/lang_" . $template_lang . "/email/" . $template_file . ".tpl";
|
||||||
|
if( !file_exists($template_file) )
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Couldn't find template file: $template_file", "", __LINE__, __FILE__);
|
message_die(GENERAL_ERROR, "Couldn't find template file: $template_file", "", __LINE__, __FILE__);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->tpl_file = $template_file;
|
$this->tpl_file = $template_file;
|
||||||
//
|
if( !$this->load_msg() )
|
||||||
// Load the email text into the $this->msg variable
|
|
||||||
//
|
|
||||||
if(!$this->load_msg())
|
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Couldn't load template file: $template_file", "", __LINE__, __FILE__);
|
message_die(GENERAL_ERROR, "Couldn't load template file: $template_file", "", __LINE__, __FILE__);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ $lang['Year'] = "Year";
|
||||||
$lang['Years'] = "Years";
|
$lang['Years'] = "Years";
|
||||||
|
|
||||||
$lang['Enabled'] = "Enabled";
|
$lang['Enabled'] = "Enabled";
|
||||||
|
$lang['Disabled'] = "Disabled";
|
||||||
$lang['Next'] = "Next";
|
$lang['Next'] = "Next";
|
||||||
$lang['Previous'] = "Previous";
|
$lang['Previous'] = "Previous";
|
||||||
$lang['Goto_page'] = "Goto page";
|
$lang['Goto_page'] = "Goto page";
|
||||||
|
@ -121,7 +122,6 @@ $lang['Jump_to'] = "Jump to";
|
||||||
$lang['Select_forum'] = "Select a forum";
|
$lang['Select_forum'] = "Select a forum";
|
||||||
|
|
||||||
$lang['Success'] = "Success";
|
$lang['Success'] = "Success";
|
||||||
$lang['Private_messaging'] = "Send a Private Message";
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -358,6 +358,7 @@ $lang['Topic_reply_notification'] = "Topic Reply Notification";
|
||||||
// Private Messaging
|
// Private Messaging
|
||||||
//
|
//
|
||||||
$lang['Private_Messaging'] = "Private Messaging";
|
$lang['Private_Messaging'] = "Private Messaging";
|
||||||
|
$lang['PM_disabled'] = "Private messaging has been disabled on this board";
|
||||||
|
|
||||||
$lang['Login_check_pm'] = "Login to check your private messages";
|
$lang['Login_check_pm'] = "Login to check your private messages";
|
||||||
$lang['New_pms'] = "You have %d new messages"; // You have 2 new messages
|
$lang['New_pms'] = "You have %d new messages"; // You have 2 new messages
|
||||||
|
@ -944,6 +945,11 @@ $lang['Site_name'] = "Site name";
|
||||||
$lang['Site_desc'] = "Site description";
|
$lang['Site_desc'] = "Site description";
|
||||||
$lang['Acct_activation'] = "Enable account activation";
|
$lang['Acct_activation'] = "Enable account activation";
|
||||||
|
|
||||||
|
$lang['Disable_privmsg'] = "Disable Private Messaging";
|
||||||
|
$lang['Inbox_limits'] = "Max posts in Inbox";
|
||||||
|
$lang['Sentbox_limits'] = "Max posts in Sentbox";
|
||||||
|
$lang['Savebox_limits'] = "Max posts in Savebox";
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Forum Management
|
// Forum Management
|
||||||
|
|
|
@ -26,6 +26,14 @@ include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/post.'.$phpEx);
|
include($phpbb_root_path . 'includes/post.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Is PM disabled?
|
||||||
|
//
|
||||||
|
if( !empty($board_config['privmsg_disable']) )
|
||||||
|
{
|
||||||
|
message_die(GENERAL_MESSAGE, 'PM_disabled');
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Var definitions
|
// Var definitions
|
||||||
//
|
//
|
||||||
|
@ -817,7 +825,7 @@ else if( $submit || $refresh || $mode != "" )
|
||||||
{
|
{
|
||||||
$to_username = $HTTP_POST_VARS['username'];
|
$to_username = $HTTP_POST_VARS['username'];
|
||||||
|
|
||||||
$sql = "SELECT user_id, user_notify_pm, user_email
|
$sql = "SELECT user_id, user_notify_pm, user_email, user_lang
|
||||||
FROM " . USERS_TABLE . "
|
FROM " . USERS_TABLE . "
|
||||||
WHERE username = '" . $to_username . "'
|
WHERE username = '" . $to_username . "'
|
||||||
AND user_id <> " . ANONYMOUS;
|
AND user_id <> " . ANONYMOUS;
|
||||||
|
@ -977,7 +985,10 @@ else if( $submit || $refresh || $mode != "" )
|
||||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||||
$emailer = new emailer($board_config['smtp_delivery']);
|
$emailer = new emailer($board_config['smtp_delivery']);
|
||||||
|
|
||||||
$emailer->use_template("privmsg_notify");
|
//
|
||||||
|
// Attempt to use language setting for recipient
|
||||||
|
//
|
||||||
|
$emailer->use_template("privmsg_notify", $to_userdata['user_lang']);
|
||||||
|
|
||||||
$emailer->extra_headers($email_headers);
|
$emailer->extra_headers($email_headers);
|
||||||
$emailer->email_address($to_userdata['user_email']);
|
$emailer->email_address($to_userdata['user_email']);
|
||||||
|
|
|
@ -63,6 +63,25 @@
|
||||||
<td class="row1">Enable Forum Pruning:</td>
|
<td class="row1">Enable Forum Pruning:</td>
|
||||||
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES}> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO}> {L_NO}</td>
|
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES}> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO}> {L_NO}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="thHead" colspan="2">{L_PRIVATE_MESSAGING}</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1">{L_DISABLE_PRIVATE_MESSAGING}:</td>
|
||||||
|
<td class="row2"><input type="radio" name="privmsg_disable" value="0" {S_PRIVMSG_ENABLED}>{L_ENABLED} <input type="radio" name="privmsg_disable" value="1" {S_PRIVMSG_DISABLED}>{L_DISABLED}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1">{L_INBOX_LIMIT}</span></td>
|
||||||
|
<td class="row2"><input type="text" maxlength="4" size="4" name="max_inbox_privmsgs" value="{INBOX_LIMIT}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1">{L_SENTBOX_LIMIT}</span></td>
|
||||||
|
<td class="row2"><input type="text" maxlength="4" size="4" name="max_sentbox_privmsgs" value="{SENTBOX_LIMIT}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1">{L_SAVEBOX_LIMIT}</span></td>
|
||||||
|
<td class="row2"><input type="text" maxlength="4" size="4" name="max_savebox_privmsgs" value="{SAVEBOX_LIMIT}"></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="thHead" colspan="2">User/Forum Ability Settings</th>
|
<th class="thHead" colspan="2">User/Forum Ability Settings</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Add table
Reference in a new issue