Zeile 47 | Zeile 47 |
---|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $email = $db->fetch_array($query);
|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $email = $db->fetch_array($query);
|
if(!$email['mid'])
| if(!$email)
|
{ flash_message($lang->error_invalid_mid, 'error'); admin_redirect("index.php?module=user-mass_mail");
| { flash_message($lang->error_invalid_mid, 'error'); admin_redirect("index.php?module=user-mass_mail");
|
Zeile 58 | Zeile 58 |
---|
if($email['conditions'] != '') { $email['conditions'] = my_unserialize($email['conditions']);
|
if($email['conditions'] != '') { $email['conditions'] = my_unserialize($email['conditions']);
|
| } else { // Fill the conditions with default values $email['conditions'] = array( "username" => "", "email" => "", "postnum_dir" => "greater_than", "postnum" => "", "regdate_dir" => "more_than", "regdate" => "", "regdate_date" => "hours", "lastactive_dir" => "more_than", "lastactive" => "", "lastactive_date" => "hours" );
|
}
$sub_tabs['edit_mass_mail'] = array(
| }
$sub_tabs['edit_mass_mail'] = array(
|
Zeile 81 | Zeile 97 |
---|
} $html_personalisation = substr($html_personalisation, 0, -2)."');\n// --></script>\n"; $text_personalisation = substr($text_personalisation, 0, -2)."');\n// --></script>\n";
|
} $html_personalisation = substr($html_personalisation, 0, -2)."');\n// --></script>\n"; $text_personalisation = substr($text_personalisation, 0, -2)."');\n// --></script>\n";
|
| $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
|
// All done here if($mybb->request_method == "post") { // Sending this message now if($mybb->input['delivery_type'] == "now")
|
// All done here if($mybb->request_method == "post") { // Sending this message now if($mybb->input['delivery_type'] == "now")
|
{
| {
|
$delivery_date = TIME_NOW; } // Delivering in the future else {
|
$delivery_date = TIME_NOW; } // Delivering in the future else {
|
if(strstr($mybb->input['deliverytime_time'], "pm"))
| if(stristr($mybb->input['deliverytime_time'], "pm"))
|
{ $mybb->input['deliveryhour'] += 12; }
| { $mybb->input['deliveryhour'] += 12; }
|
Zeile 103 | Zeile 121 |
---|
$exploded = explode(' ', $exploded[1]); $mybb->input['deliveryminute'] = (int)$exploded[0];
|
$exploded = explode(' ', $exploded[1]); $mybb->input['deliveryminute'] = (int)$exploded[0];
|
$delivery_date = gmmktime($mybb->input['deliveryhour'], $mybb->input['deliveryminute'], 0, $mybb->input['endtime_month'], $mybb->input['endtime_day'], $mybb->input['endtime_year']) + $mybb->user['timezone']*3600;
| $delivery_date = gmmktime($mybb->input['deliveryhour'], $mybb->input['deliveryminute'], 0, $mybb->input['endtime_month'], $mybb->input['endtime_day'], $mybb->input['endtime_year']) - $localized_time_offset;
|
if($delivery_date <= TIME_NOW) { $errors[] = $lang->error_only_in_future;
| if($delivery_date <= TIME_NOW) { $errors[] = $lang->error_only_in_future;
|
Zeile 135 | Zeile 153 |
---|
} else {
|
} else {
|
if($mybb->input['format'] == 2 && $mybb->input['automatic_text'] == 0 && !$mybb->input['message'])
| if($mybb->input['format'] == 2 && $mybb->get_input('automatic_text') == 0 && !$mybb->input['message'])
|
{ $errors[] = $lang->error_missing_plain_text; }
| { $errors[] = $lang->error_missing_plain_text; }
|
Zeile 147 | Zeile 165 |
---|
else if($mybb->input['format'] == 0 && !$mybb->input['message']) { $errors[] = $lang->error_missing_plain_text;
|
else if($mybb->input['format'] == 0 && !$mybb->input['message']) { $errors[] = $lang->error_missing_plain_text;
|
} }
| } }
|
if(!$errors) { // Sending via a PM
| if(!$errors) { // Sending via a PM
|
Zeile 162 | Zeile 180 |
---|
else { // Do we need to generate a text based version?
|
else { // Do we need to generate a text based version?
|
if($mybb->input['format'] == 2 && $mybb->input['automatic_text'])
| if($mybb->input['format'] == 2 && $mybb->get_input('automatic_text'))
|
{ $mybb->input['message'] = create_text_message($mybb->input['htmlmessage']); }
| { $mybb->input['message'] = create_text_message($mybb->input['htmlmessage']); }
|
Zeile 202 | Zeile 220 |
---|
$page->output_header($lang->edit_mass_mail);
$page->output_nav_tabs($sub_tabs, 'edit_mass_mail');
|
$page->output_header($lang->edit_mass_mail);
$page->output_nav_tabs($sub_tabs, 'edit_mass_mail');
|
| $delivery_type_checked = array( "now" => "", "future" => "", );
|
// If we have any error messages, show them if($errors)
| // If we have any error messages, show them if($errors)
|
Zeile 216 | Zeile 239 |
---|
if($email['senddate'] != 0) { if($email['senddate'] <= TIME_NOW)
|
if($email['senddate'] != 0) { if($email['senddate'] <= TIME_NOW)
|
{
| {
|
$input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\""; } else {
|
$input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\""; } else {
|
| // correct date by timezone and dst $offset =
|
$input['delivery_type'] = "future";
|
$input['delivery_type'] = "future";
|
$time = date("d-n-Y-h-i-a", $email['senddate']);
| $time = gmdate("d-n-Y", $email['senddate'] + $localized_time_offset);
|
$time = explode('-', $time);
|
$time = explode('-', $time);
|
$input['deliveryhour'] = (int)$time[3]; $input['deliveryminute'] = (int)$time[4];
| |
$input['deliverymonth'] = (int)$time[1]; $input['deliveryday'] = (int)$time[0]; $input['deliveryyear'] = (int)$time[2];
|
$input['deliverymonth'] = (int)$time[1]; $input['deliveryday'] = (int)$time[0]; $input['deliveryyear'] = (int)$time[2];
|
$input['deliverymeridiem'] = $time[5];
| $input['endtime_time'] = gmdate($mybb->settings['timeformat'], $email['senddate'] + $localized_time_offset);
|
$delivery_type_checked['future'] = " checked=\"checked\""; }
|
$delivery_type_checked['future'] = " checked=\"checked\""; }
|
}
| }
|
else { $input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\"";
|
else { $input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\"";
|
} }
if($input['deliveryhour']) { $input['endtime_time'] = (int)$input['deliveryhour'].":"; } else { $input['endtime_time'] = "12:"; }
if($input['deliveryminute']) { $input['endtime_time'] .= (int)$input['deliveryminute']." "; } else { $input['endtime_time'] .= "00 "; }
if($input['deliverymeridiem']) { $input['endtime_time'] .= $input['deliverymeridiem']; } else
| } }
if(empty($input['endtime_time'])) { $input['endtime_time'] = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset); }
if(empty($input['deliveryyear']))
|
{
|
{
|
$input['endtime_time'] .= "am";
| $enddateyear = gmdate('Y', TIME_NOW + $localized_time_offset);
|
}
|
}
|
if(!$input['deliveryyear']) { $enddateyear = gmdate('Y', TIME_NOW);
| else { $enddateyear = (int)$input['deliveryyear'];
|
}
|
}
|
else { $enddateyear = (int)$input['deliveryyear']; }
if(!$input['deliverymonth'])
| if(empty($input['deliverymonth']))
|
{
|
{
|
$input['enddatemonth'] = gmdate('n', TIME_NOW);
| $input['enddatemonth'] = gmdate('n', TIME_NOW + $localized_time_offset);
|
} else { $input['enddatemonth'] = (int)$input['deliverymonth'];
|
} else { $input['enddatemonth'] = (int)$input['deliverymonth'];
|
}
if(!$input['deliveryday'])
| }
if(empty($input['deliveryday']))
|
{
|
{
|
$input['enddateday'] = gmdate('j', TIME_NOW);
| $input['enddateday'] = gmdate('j', TIME_NOW + $localized_time_offset);
|
} else {
| } else {
|
Zeile 297 | Zeile 298 |
---|
$form = new Form("index.php?module=user-mass_mail&action=edit", "post"); echo $form->generate_hidden_field("mid", $email['mid']);
|
$form = new Form("index.php?module=user-mass_mail&action=edit", "post"); echo $form->generate_hidden_field("mid", $email['mid']);
|
|
|
$mid_add = '';
|
$mid_add = '';
|
if($email['mid'])
| if(!empty($email['mid']))
|
{ $mid_add = "&mid={$email['mid']}"; }
|
{ $mid_add = "&mid={$email['mid']}"; }
|
|
|
$form_container = new FormContainer("{$lang->edit_mass_mail}: {$lang->message_settings}");
$form_container->output_row("{$lang->subject}: <em>*</em>", $lang->subject_desc, $form->generate_text_box('subject', $input['subject'], array('id' => 'subject')), 'subject');
|
$form_container = new FormContainer("{$lang->edit_mass_mail}: {$lang->message_settings}");
$form_container->output_row("{$lang->subject}: <em>*</em>", $lang->subject_desc, $form->generate_text_box('subject', $input['subject'], array('id' => 'subject')), 'subject');
|
|
|
if($input['type'] == 0) { $type_email_checked = true;
| if($input['type'] == 0) { $type_email_checked = true;
|
Zeile 365 | Zeile 366 |
---|
for($i = 1; $i <= 31; ++$i) { if($i == $input['enddateday'])
|
for($i = 1; $i <= 31; ++$i) { if($i == $input['enddateday'])
|
{
| {
|
$enddateday .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";
|
$enddateday .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";
|
}
| }
|
else
|
else
|
{
| {
|
$enddateday .= "<option value=\"{$i}\">{$i}</option>\n"; } }
| $enddateday .= "<option value=\"{$i}\">{$i}</option>\n"; } }
|
Zeile 385 | Zeile 386 |
---|
{ checked = $(this).val(); }
|
{ checked = $(this).val(); }
|
});
| });
|
$('.'+id+'s').each(function(e) { $(this).hide();
| $('.'+id+'s').each(function(e) { $(this).hide();
|
Zeile 403 | Zeile 404 |
---|
<dd style=\"margin-top: 4px;\" id=\"delivery_type_future\" class=\"delivery_types\"> <table cellpadding=\"4\"> <tr>
|
<dd style=\"margin-top: 4px;\" id=\"delivery_type_future\" class=\"delivery_types\"> <table cellpadding=\"4\"> <tr>
|
<td><select name=\"endtime_day\">\n{$enddateday}</select>\n \n<select name=\"endtime_month\">\n{$enddatemonth}</select>\n \n<input type=\"text\" name=\"endtime_year\" value=\"{$enddateyear}\" class=\"text_input\" size=\"4\" maxlength=\"4\" />\n - {$lang->time} ".$form->generate_text_box('endtime_time', $input['endtime_time'], array('id' => 'endtime_time', 'style' => 'width: 60px;'))."</td>
| <td><select name=\"endtime_day\">\n{$enddateday}</select>\n \n<select name=\"endtime_month\">\n{$enddatemonth}</select>\n \n<input type=\"text\" name=\"endtime_year\" value=\"{$enddateyear}\" class=\"text_input\" size=\"4\" maxlength=\"4\" />\n - ".$form->generate_text_box('endtime_time', $input['endtime_time'], array('id' => 'endtime_time', 'style' => 'width: 60px;'))."</td>
|
</tr> </table> </dd>
| </tr> </table> </dd>
|
Zeile 424 | Zeile 425 |
---|
$form_container->output_row("{$lang->message_format}: <em>*</em>", "", $form->generate_select_box('format', $format_options, $input['format'], array('id' => 'format')), 'format', null, array("id" => "format_container"));
$form_container->end();
|
$form_container->output_row("{$lang->message_format}: <em>*</em>", "", $form->generate_select_box('format', $format_options, $input['format'], array('id' => 'format')), 'format', null, array("id" => "format_container"));
$form_container->end();
|
| $automatic_text_check = ''; $text_display = ''; $automatic_display = ''; $html_display = '';
|
if($input['format'] == 2) {
|
if($input['format'] == 2) {
|
if($input['automatic_text'] && !$email['mid'])
| if(!empty($input['automatic_text']) && empty($email['mid']))
|
{ $automatic_text_check = true; $text_display = 'display: none';
| { $automatic_text_check = true; $text_display = 'display: none';
|
Zeile 536 | Zeile 542 |
---|
// Internet Explorer if(document.selection) {
|
// Internet Explorer if(document.selection) {
|
textarea.focus();
| textarea.trigger('focus');
|
var selection = document.selection.createRange(); selection.text = value; }
| var selection = document.selection.createRange(); selection.text = value; }
|
Zeile 554 | Zeile 560 |
---|
}
</script>";
|
}
</script>";
|
| $options = array( 'username', 'email', 'postnum_dir', 'postnum', 'regdate', 'regdate_date', 'regdate_dir', 'lastactive', 'lastactive_date', 'lastactive_dir' );
foreach($options as $option) { if(!isset($input['conditions'][$option])) { $input['conditions'][$option] = ''; } } if(!isset($input['conditions']['usergroup']) || !is_array($input['conditions']['usergroup'])) { $input['conditions']['usergroup'] = array(); }
|
$form_container = new FormContainer("{$lang->edit_mass_mail}: {$lang->define_the_recipients}");
|
$form_container = new FormContainer("{$lang->edit_mass_mail}: {$lang->define_the_recipients}");
|
$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
| $form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', htmlspecialchars_uni($input['conditions']['username']), array('id' => 'username')), 'username');
|
$form_container->output_row($lang->email_addr_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
| $form_container->output_row($lang->email_addr_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
|
Zeile 592 | Zeile 614 |
---|
$form_container->output_row($lang->user_registered, "", $form->generate_select_box('conditions[regdate_dir]', $more_options, $input['conditions']['regdate_dir'], array('id' => 'regdate_dir'))." ".$form->generate_numeric_field('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate', 'min' => 0))." ".$form->generate_select_box('conditions[regdate_date]', $date_options, $input['conditions']['regdate_date'], array('id' => 'regdate_date'))." {$lang->ago}", 'regdate');
$form_container->output_row($lang->user_last_active, "", $form->generate_select_box('conditions[lastactive_dir]', $more_options, $input['conditions']['lastactive_dir'], array('id' => 'lastactive_dir'))." ".$form->generate_numeric_field('conditions[lastactive]', $input['conditions']['lastactive'], array('id' => 'lastactive', 'min' => 0))." ".$form->generate_select_box('conditions[lastactive_date]', $date_options, $input['conditions']['lastactive_date'], array('id' => 'lastactive_date'))." {$lang->ago}", 'lastactive');
|
$form_container->output_row($lang->user_registered, "", $form->generate_select_box('conditions[regdate_dir]', $more_options, $input['conditions']['regdate_dir'], array('id' => 'regdate_dir'))." ".$form->generate_numeric_field('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate', 'min' => 0))." ".$form->generate_select_box('conditions[regdate_date]', $date_options, $input['conditions']['regdate_date'], array('id' => 'regdate_date'))." {$lang->ago}", 'regdate');
$form_container->output_row($lang->user_last_active, "", $form->generate_select_box('conditions[lastactive_dir]', $more_options, $input['conditions']['lastactive_dir'], array('id' => 'lastactive_dir'))." ".$form->generate_numeric_field('conditions[lastactive]', $input['conditions']['lastactive'], array('id' => 'lastactive', 'min' => 0))." ".$form->generate_select_box('conditions[lastactive_date]', $date_options, $input['conditions']['lastactive_date'], array('id' => 'lastactive_date'))." {$lang->ago}", 'lastactive');
|
|
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_mass_mail);
| $form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_mass_mail);
|
Zeile 606 | Zeile 628 |
---|
{ $page->add_breadcrumb_item($lang->send_mass_mail);
|
{ $page->add_breadcrumb_item($lang->send_mass_mail);
|
if($mybb->input['step'])
| if(($mybb->get_input('step')))
|
{ $query = $db->simple_select("massemails", "*", "status=0 and mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $email = $db->fetch_array($query);
|
{ $query = $db->simple_select("massemails", "*", "status=0 and mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $email = $db->fetch_array($query);
|
if(!$email['mid'] && $mybb->input['step'] != 1)
| if(!$email && $mybb->input['step'] != 1)
|
{ flash_message($lang->error_invalid_mid, 'error');
|
{ flash_message($lang->error_invalid_mid, 'error');
|
admin_redirect("index.php?module=user-mass_mail"); } }
| admin_redirect("index.php?module=user-mass_mail"); } }
|
$replacement_fields = array( "{username}" => $lang->username, "{email}" => $lang->email_addr,
| $replacement_fields = array( "{username}" => $lang->username, "{email}" => $lang->email_addr,
|
Zeile 635 | Zeile 657 |
---|
$plugins->run_hooks("admin_user_mass_email_send_start");
|
$plugins->run_hooks("admin_user_mass_email_send_start");
|
if($mybb->input['step'] == 4)
| $localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
if($mybb->get_input('step') == 4)
|
{ // All done here if($mybb->request_method == "post") { // Sending this message now if($mybb->input['delivery_type'] == "now")
|
{ // All done here if($mybb->request_method == "post") { // Sending this message now if($mybb->input['delivery_type'] == "now")
|
{
| {
|
$delivery_date = TIME_NOW; } // Delivering in the future else {
|
$delivery_date = TIME_NOW; } // Delivering in the future else {
|
if(strstr($mybb->input['deliverytime_time'], "pm"))
| if(stristr($mybb->input['deliverytime_time'], "pm"))
|
{ $mybb->input['deliveryhour'] += 12;
|
{ $mybb->input['deliveryhour'] += 12;
|
}
| }
|
$exploded = explode(':', $mybb->input['endtime_time']); $mybb->input['deliveryhour'] = (int)$exploded[0];
| $exploded = explode(':', $mybb->input['endtime_time']); $mybb->input['deliveryhour'] = (int)$exploded[0];
|
Zeile 659 | Zeile 683 |
---|
$exploded = explode(' ', $exploded[1]); $mybb->input['deliveryminute'] = (int)$exploded[0];
|
$exploded = explode(' ', $exploded[1]); $mybb->input['deliveryminute'] = (int)$exploded[0];
|
$delivery_date = gmmktime($mybb->input['deliveryhour'], $mybb->input['deliveryminute'], 0, $mybb->input['endtime_month'], $mybb->input['endtime_day'], $mybb->input['endtime_year']) + $mybb->user['timezone']*3600;
| $delivery_date = gmmktime($mybb->input['deliveryhour'], $mybb->input['deliveryminute'], 0, $mybb->input['endtime_month'], $mybb->input['endtime_day'], $mybb->input['endtime_year'])- $localized_time_offset;
|
if($delivery_date <= TIME_NOW) { $errors[] = $lang->error_only_in_future;
| if($delivery_date <= TIME_NOW) { $errors[] = $lang->error_only_in_future;
|
Zeile 687 | Zeile 711 |
---|
$page->output_header("{$lang->send_mass_mail}: {$lang->step_four}");
$page->output_nav_tabs($sub_tabs, 'send_mass_mail');
|
$page->output_header("{$lang->send_mass_mail}: {$lang->step_four}");
$page->output_nav_tabs($sub_tabs, 'send_mass_mail');
|
| $delivery_type_checked = array( "now" => "", "future" => "", );
|
// If we have any error messages, show them if($errors) { $page->output_inline_error($errors); $input = $mybb->input;
|
// If we have any error messages, show them if($errors) { $page->output_inline_error($errors); $input = $mybb->input;
|
| // Delivery type radio selection is to carry over in step 4 only $input['delivery_type'] = $mybb->get_input('delivery_type'); if(empty($input['delivery_type'])) { $input['delivery_type'] = "now"; } $delivery_type_checked[$input['delivery_type']] = " checked=\"checked\"";
|
} else {
| } else {
|
Zeile 703 | Zeile 740 |
---|
{ $input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\"";
|
{ $input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\"";
|
}
| }
|
else { $input['delivery_type'] = "future";
|
else { $input['delivery_type'] = "future";
|
$time = date("d-n-Y-h-i-a", $email['senddate']);
| $time = gmdate("d-n-Y", $email['senddate'] + $localized_time_offset);
|
$time = explode('-', $time);
|
$time = explode('-', $time);
|
$input['deliveryhour'] = (int)$time[3]; $input['deliveryminute'] = (int)$time[4];
| |
$input['deliverymonth'] = (int)$time[1]; $input['deliveryday'] = (int)$time[0]; $input['deliveryyear'] = (int)$time[2];
|
$input['deliverymonth'] = (int)$time[1]; $input['deliveryday'] = (int)$time[0]; $input['deliveryyear'] = (int)$time[2];
|
$input['deliverymeridiem'] = $time[5];
| $input['endtime_time'] = gmdate($mybb->settings['timeformat'], $email['senddate'] + $localized_time_offset);
|
$delivery_type_checked['future'] = " checked=\"checked\""; } }
| $delivery_type_checked['future'] = " checked=\"checked\""; } }
|
Zeile 745 | Zeile 780 |
---|
$table->construct_cell("<strong>{$lang->message}:</strong>"); $format_preview = ''; if($email['format'] == 0 || $email['format'] == 2)
|
$table->construct_cell("<strong>{$lang->message}:</strong>"); $format_preview = ''; if($email['format'] == 0 || $email['format'] == 2)
|
{
| {
|
$format_preview .= "{$lang->text_based} - <a href=\"#\" onclick=\"javascript:MyBB.popupWindow('index.php?module=user-mass_mail&action=preview&mid={$email['mid']}&format=text', null, true);\">{$lang->preview}</a>"; } if($email['format'] == 2)
| $format_preview .= "{$lang->text_based} - <a href=\"#\" onclick=\"javascript:MyBB.popupWindow('index.php?module=user-mass_mail&action=preview&mid={$email['mid']}&format=text', null, true);\">{$lang->preview}</a>"; } if($email['format'] == 2)
|
Zeile 753 | Zeile 788 |
---|
$format_preview .= " {$lang->and} <br />"; } if($email['format'] == 1 || $email['format'] == 2)
|
$format_preview .= " {$lang->and} <br />"; } if($email['format'] == 1 || $email['format'] == 2)
|
{
| {
|
$format_preview.= "{$lang->html_based} - <a href=\"#\" onclick=\"javascript:MyBB.popupWindow('index.php?module=user-mass_mail&action=preview&mid={$email['mid']}', null, true);\">{$lang->preview}</a>";
|
$format_preview.= "{$lang->html_based} - <a href=\"#\" onclick=\"javascript:MyBB.popupWindow('index.php?module=user-mass_mail&action=preview&mid={$email['mid']}', null, true);\">{$lang->preview}</a>";
|
}
| }
|
$table->construct_cell($format_preview);
|
$table->construct_cell($format_preview);
|
$table->construct_row();
| $table->construct_row();
|
// Recipient counts & details $table->construct_cell("<strong>{$lang->total_recipients}:</strong>");
| // Recipient counts & details $table->construct_cell("<strong>{$lang->total_recipients}:</strong>");
|
Zeile 765 | Zeile 800 |
---|
$table->construct_row();
$table->output("{$lang->send_mass_mail}: {$lang->step_four} - {$lang->review_message}");
|
$table->construct_row();
$table->output("{$lang->send_mass_mail}: {$lang->step_four} - {$lang->review_message}");
|
if($input['deliveryhour']) { $input['endtime_time'] = (int)$input['deliveryhour'].":"; } else { $input['endtime_time'] = "12:"; }
if($input['deliveryminute']) { $input['endtime_time'] .= (int)$input['deliveryminute']." "; } else { $input['endtime_time'] .= "00 "; }
if($input['deliverymeridiem']) { $input['endtime_time'] .= $input['deliverymeridiem']; } else { $input['endtime_time'] .= "am"; }
if(!$input['deliveryyear']) { $enddateyear = gmdate('Y', TIME_NOW); } else { $enddateyear = (int)$input['deliveryyear']; }
if(!$input['deliverymonth']) { $input['enddatemonth'] = gmdate('n', TIME_NOW); } else { $input['enddatemonth'] = (int)$input['deliverymonth']; }
if(!$input['deliveryday']) { $input['enddateday'] = gmdate('j', TIME_NOW);
| if(empty($input['endtime_time'])) { $input['endtime_time'] = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset); }
if(empty($input['deliveryyear'])) { $enddateyear = gmdate('Y', TIME_NOW + $localized_time_offset); } else { $enddateyear = (int)$input['deliveryyear']; }
if(empty($input['deliverymonth'])) { $input['enddatemonth'] = gmdate('n', TIME_NOW + $localized_time_offset); } else { $input['enddatemonth'] = (int)$input['deliverymonth']; }
if(empty($input['deliveryday'])) { $input['enddateday'] = gmdate('j', TIME_NOW + $localized_time_offset);
|
} else {
| } else {
|
Zeile 834 | Zeile 847 |
---|
$lang->october, $lang->november, $lang->december,
|
$lang->october, $lang->november, $lang->december,
|
);
| );
|
$enddatemonth = ""; foreach($monthnames as $key => $month) {
| $enddatemonth = ""; foreach($monthnames as $key => $month) {
|
Zeile 901 | Zeile 914 |
---|
<dd style=\"margin-top: 4px;\" id=\"delivery_type_future\" class=\"delivery_types\"> <table cellpadding=\"4\"> <tr>
|
<dd style=\"margin-top: 4px;\" id=\"delivery_type_future\" class=\"delivery_types\"> <table cellpadding=\"4\"> <tr>
|
<td><select name=\"endtime_day\">\n{$enddateday}</select>\n \n<select name=\"endtime_month\">\n{$enddatemonth}</select>\n \n<input type=\"text\" name=\"endtime_year\" class=\"text_input\" value=\"{$enddateyear}\" size=\"4\" maxlength=\"4\" />\n - {$lang->time} ".$form->generate_text_box('endtime_time', $input['endtime_time'], array('id' => 'endtime_time', 'style' => 'width: 60px;'))."</td>
| <td><select name=\"endtime_day\">\n{$enddateday}</select>\n \n<select name=\"endtime_month\">\n{$enddatemonth}</select>\n \n<input type=\"text\" name=\"endtime_year\" class=\"text_input\" value=\"{$enddateyear}\" size=\"4\" maxlength=\"4\" />\n - ".$form->generate_text_box('endtime_time', $input['endtime_time'], array('id' => 'endtime_time', 'style' => 'width: 60px;'))."</td>
|
</tr> </table> </dd>
| </tr> </table> </dd>
|
Zeile 919 | Zeile 932 |
---|
$form->end(); $page->output_footer(); }
|
$form->end(); $page->output_footer(); }
|
elseif($mybb->input['step'] == 3)
| elseif($mybb->get_input('step') == 3)
|
{ // Define the recipients/conditions if($mybb->request_method == "post")
| { // Define the recipients/conditions if($mybb->request_method == "post")
|
Zeile 947 | Zeile 960 |
---|
// Take the user to the next step admin_redirect("index.php?module=user-mass_mail&action=send&step=4&mid={$email['mid']}");
|
// Take the user to the next step admin_redirect("index.php?module=user-mass_mail&action=send&step=4&mid={$email['mid']}");
|
}
| }
|
}
$page->output_header("{$lang->send_mass_mail}: {$lang->step_three}");
| }
$page->output_header("{$lang->send_mass_mail}: {$lang->step_three}");
|
Zeile 989 | Zeile 1002 |
---|
if(!isset($input['conditions']['usergroup']) || !is_array($input['conditions']['usergroup'])) { $input['conditions']['usergroup'] = array();
|
if(!isset($input['conditions']['usergroup']) || !is_array($input['conditions']['usergroup'])) { $input['conditions']['usergroup'] = array();
|
}
$form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_three} - {$lang->define_the_recipients}");
| }
$form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_three} - {$lang->define_the_recipients}");
|
|
|
$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
| $form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', htmlspecialchars_uni($input['conditions']['username']), array('id' => 'username')), 'username');
|
$form_container->output_row($lang->email_addr_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
$options = array();
| $form_container->output_row($lang->email_addr_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
$options = array();
|
Zeile 1027 | Zeile 1040 |
---|
$form_container->output_row($lang->user_registered, "", $form->generate_select_box('conditions[regdate_dir]', $more_options, $input['conditions']['regdate_dir'], array('id' => 'regdate_dir'))." ".$form->generate_numeric_field('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate', 'min' => 0))." ".$form->generate_select_box('conditions[regdate_date]', $date_options, $input['conditions']['regdate_date'], array('id' => 'regdate_date'))." {$lang->ago}", 'regdate');
$form_container->output_row($lang->user_last_active, "", $form->generate_select_box('conditions[lastactive_dir]', $more_options, $input['conditions']['lastactive_dir'], array('id' => 'lastactive_dir'))." ".$form->generate_numeric_field('conditions[lastactive]', $input['conditions']['lastactive'], array('id' => 'lastactive', 'min' => 0))." ".$form->generate_select_box('conditions[lastactive_date]', $date_options, $input['conditions']['lastactive_date'], array('id' => 'lastactive_date'))." {$lang->ago}", 'lastactive');
|
$form_container->output_row($lang->user_registered, "", $form->generate_select_box('conditions[regdate_dir]', $more_options, $input['conditions']['regdate_dir'], array('id' => 'regdate_dir'))." ".$form->generate_numeric_field('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate', 'min' => 0))." ".$form->generate_select_box('conditions[regdate_date]', $date_options, $input['conditions']['regdate_date'], array('id' => 'regdate_date'))." {$lang->ago}", 'regdate');
$form_container->output_row($lang->user_last_active, "", $form->generate_select_box('conditions[lastactive_dir]', $more_options, $input['conditions']['lastactive_dir'], array('id' => 'lastactive_dir'))." ".$form->generate_numeric_field('conditions[lastactive]', $input['conditions']['lastactive'], array('id' => 'lastactive', 'min' => 0))." ".$form->generate_select_box('conditions[lastactive_date]', $date_options, $input['conditions']['lastactive_date'], array('id' => 'lastactive_date'))." {$lang->ago}", 'lastactive');
|
$form_container->end();
| $form_container->end();
|
$buttons[] = $form->generate_submit_button($lang->next_step); $form->output_submit_wrapper($buttons);
| $buttons[] = $form->generate_submit_button($lang->next_step); $form->output_submit_wrapper($buttons);
|
Zeile 1037 | Zeile 1050 |
---|
$page->output_footer(); } // Reviewing the automatic text based version of the message.
|
$page->output_footer(); } // Reviewing the automatic text based version of the message.
|
elseif($mybb->input['step'] == 2)
| elseif($mybb->get_input('step') == 2)
|
{ // Update text based version if($mybb->request_method == "post")
| { // Update text based version if($mybb->request_method == "post")
|
Zeile 1078 | Zeile 1091 |
---|
$buttons[] = $form->generate_submit_button($lang->next_step); $form->output_submit_wrapper($buttons);
|
$buttons[] = $form->generate_submit_button($lang->next_step); $form->output_submit_wrapper($buttons);
|
|
|
$form->end(); $page->output_footer(); }
|
$form->end(); $page->output_footer(); }
|
elseif(!$mybb->input['step'] || $mybb->input['step'] == 1)
| elseif(!$mybb->get_input('step') || $mybb->get_input('step') == 1)
|
{ if($mybb->request_method == "post") {
| { if($mybb->request_method == "post") {
|
Zeile 1091 | Zeile 1104 |
---|
$errors[] = $lang->error_missing_subject; }
|
$errors[] = $lang->error_missing_subject; }
|
if($mybb->input['type'] == 1)
| if($mybb->get_input('type') == 1)
|
{ if(!$mybb->input['message']) {
| { if(!$mybb->input['message']) {
|
Zeile 1100 | Zeile 1113 |
---|
} else {
|
} else {
|
if($mybb->input['format'] == 2 && $mybb->input['automatic_text'] == 0 && !$mybb->input['message'])
| if($mybb->input['format'] == 2 && $mybb->get_input('automatic_text') == 0 && !$mybb->input['message'])
|
{ $errors[] = $lang->error_missing_plain_text; }
| { $errors[] = $lang->error_missing_plain_text; }
|
Zeile 1197 | Zeile 1210 |
---|
$page->output_header("{$lang->send_mass_mail}: {$lang->step_one}");
$mid_add = '';
|
$page->output_header("{$lang->send_mass_mail}: {$lang->step_one}");
$mid_add = '';
|
if($email['mid'])
| if(!empty($email['mid']))
|
{ $mid_add = "&mid={$email['mid']}"; }
| { $mid_add = "&mid={$email['mid']}"; }
|
Zeile 1211 | Zeile 1224 |
---|
$page->output_inline_error($errors); $input = $mybb->input; }
|
$page->output_inline_error($errors); $input = $mybb->input; }
|
else if(!$email)
| else if(empty($email))
|
{ $input = array( "type" => 0,
| { $input = array( "type" => 0,
|
Zeile 1227 | Zeile 1240 |
---|
$form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->message_settings}");
|
$form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->message_settings}");
|
$form_container->output_row("{$lang->subject}: <em>*</em>", $lang->subject_desc, $form->generate_text_box('subject', $input['subject'], array('id' => 'subject')), 'subject');
| $form_container->output_row("{$lang->subject}: <em>*</em>", $lang->subject_desc, $form->generate_text_box('subject', !empty($input['subject']) ? $input['subject'] : null, array('id' => 'subject')), 'subject');
|
|
|
if($mybb->input['type'] == 0)
| if($mybb->get_input('type') == 0)
|
{ $type_email_checked = true; $type_pm_checked = false; }
|
{ $type_email_checked = true; $type_pm_checked = false; }
|
else if($mybb->input['type'] == 1)
| else if($mybb->get_input('type') == 1)
|
{ $type_email_checked = false; $type_pm_checked = true;
|
{ $type_email_checked = false; $type_pm_checked = true;
|
| } else { $type_email_checked = false; $type_pm_checked = false;
|
}
$type_options = array(
| }
$type_options = array(
|
Zeile 1254 | Zeile 1272 |
---|
$form_container->output_row("{$lang->message_format}:", "", $form->generate_select_box('format', $format_options, $input['format'], array('id' => 'format')), 'format', null, array("id" => "format_container"));
|
$form_container->output_row("{$lang->message_format}:", "", $form->generate_select_box('format', $format_options, $input['format'], array('id' => 'format')), 'format', null, array("id" => "format_container"));
|
$form_container->output_row("{$lang->per_page}: <em>*</em>", $lang->per_page_desc, $form->generate_numeric_field('perpage', $input['perpage'], array('id' => 'perpage', 'min' => 1)), 'perpage');
| $form_container->output_row("{$lang->per_page}: <em>*</em>", $lang->per_page_desc, $form->generate_numeric_field('perpage', $input['perpage'], array('id' => 'perpage', 'min' => 1)), 'perpage');
|
$form_container->end();
|
$form_container->end();
|
if($mybb->input['format'] == 2)
| $automatic_text_check = false; $text_display = null; $automatic_display = null; $html_display = null;
if($mybb->get_input('format') == 2)
|
{
|
{
|
if($mybb->input['automatic_text'] && !$email['mid'])
| if($mybb->get_input('automatic_text') && empty($email['mid']))
|
{ $automatic_text_check = true; $text_display = 'display: none'; $automatic_display = 'display: none;'; } }
|
{ $automatic_text_check = true; $text_display = 'display: none'; $automatic_display = 'display: none;'; } }
|
else if($mybb->input['format'] == 1 && $mybb->input['type'] != 1)
| else if($mybb->get_input('format') == 1 && $mybb->get_input('type') != 1)
|
{ $text_display = 'display: none;';
|
{ $text_display = 'display: none;';
|
} else if($mybb->input['format'] == 0 || $mybb->input['type'] == 1)
| } else if($mybb->get_input('format') == 0 || $mybb->get_input('type') == 1)
|
{ $html_display = 'display: none'; }
|
{ $html_display = 'display: none'; }
|
|
|
echo "<div id=\"message_html\" style=\"{$html_display}\">"; $form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->define_html_message}");
|
echo "<div id=\"message_html\" style=\"{$html_display}\">"; $form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->define_html_message}");
|
$form_container->output_row("{$lang->define_html_message_desc}:", $html_personalisation, $form->generate_text_area('htmlmessage', $input['htmlmessage'], array('id' => 'htmlmessage', 'rows' => 15, 'cols '=> 70, 'style' => 'width: 95%'))."<div id=\"automatic_display\" style=\"{$automatic_display}\">".$form->generate_check_box('automatic_text', 1, $lang->auto_gen_plain_text, array('checked' => $automatic_text_check, "id" => "automatic_text"))."</div>"); $form_container->end();
| $form_container->output_row("{$lang->define_html_message_desc}:", $html_personalisation, $form->generate_text_area('htmlmessage', !empty($input['htmlmessage']) ? $input['htmlmessage'] : null, array('id' => 'htmlmessage', 'rows' => 15, 'cols '=> 70, 'style' => 'width: 95%'))."<div id=\"automatic_display\" style=\"{$automatic_display}\">".$form->generate_check_box('automatic_text', 1, $lang->auto_gen_plain_text, array('checked' => $automatic_text_check, "id" => "automatic_text"))."</div>"); $form_container->end();
|
echo "</div>";
echo "<div id=\"message_text\" style=\"{$text_display}\">"; $form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->define_text_version}");
|
echo "</div>";
echo "<div id=\"message_text\" style=\"{$text_display}\">"; $form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->define_text_version}");
|
$form_container->output_row("{$lang->define_text_version_desc}:", $text_personalisation, $form->generate_text_area('message', $input['message'], array('id' => 'message', 'rows' => 15, 'cols '=> 70, 'style' => 'width: 95%')));
| $form_container->output_row("{$lang->define_text_version_desc}:", $text_personalisation, $form->generate_text_area('message', !empty($input['message']) ? $input['message'] : null, array('id' => 'message', 'rows' => 15, 'cols '=> 70, 'style' => 'width: 95%')));
|
$form_container->end(); echo "</div>";
|
$form_container->end(); echo "</div>";
|
|
|
echo " <script type=\"text/javascript\"> function ToggleFormat()
| echo " <script type=\"text/javascript\"> function ToggleFormat()
|
Zeile 1311 | Zeile 1334 |
---|
$('#message_text').hide(); $('#message_html').show(); $('#automatic_display').hide();
|
$('#message_text').hide(); $('#message_html').show(); $('#automatic_display').hide();
|
} else { $('#message_text').show(); $('#message_html').hide(); }
| } else { $('#message_text').show(); $('#message_html').hide(); }
|
} $(document).on('change', '#format', function() { ToggleFormat();
| } $(document).on('change', '#format', function() { ToggleFormat();
|
Zeile 1330 | Zeile 1353 |
---|
$('#message_html').hide(); $('#message_text').show(); $('#format_container').hide();
|
$('#message_html').hide(); $('#message_text').show(); $('#format_container').hide();
|
}
| }
|
else { $('#message_html').show();
| else { $('#message_html').show();
|
Zeile 1356 | Zeile 1379 |
---|
else { $('#message_text').show();
|
else { $('#message_text').show();
|
} }
| } }
|
$('#automatic_text').on('click', function() { ToggleAutomatic(); });
| $('#automatic_text').on('click', function() { ToggleAutomatic(); });
|
Zeile 1369 | Zeile 1392 |
---|
// Internet Explorer if(document.selection) {
|
// Internet Explorer if(document.selection) {
|
textarea.focus();
| textarea.trigger('focus');
|
var selection = document.selection.createRange(); selection.text = value; }
| var selection = document.selection.createRange(); selection.text = value; }
|
Zeile 1399 | Zeile 1422 |
---|
}
if($mybb->input['action'] == "delete")
|
}
if($mybb->input['action'] == "delete")
|
{ $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
| { $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
|
{ flash_message($lang->error_delete_invalid_mid, 'error');
|
{ flash_message($lang->error_delete_invalid_mid, 'error');
|
admin_redirect("index.php?module=user-mass_mail");
| admin_redirect("index.php?module=user-mass_mail");
|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=user-mass_mail"); }
| { admin_redirect("index.php?module=user-mass_mail"); }
|
Zeile 1425 | Zeile 1448 |
---|
// Log admin action log_admin_action($mass_email['mid'], $mass_email['subject']);
|
// Log admin action log_admin_action($mass_email['mid'], $mass_email['subject']);
|
if($mybb->input['archive'] == 1) { flash_message($lang->success_mass_mail_deleted, 'success');
| if($mybb->get_input('archive') == 1) { flash_message($lang->success_mass_mail_deleted, 'success');
|
admin_redirect("index.php?module=user-mass_mail&action=archive");
|
admin_redirect("index.php?module=user-mass_mail&action=archive");
|
} else
| } else
|
{ flash_message($lang->success_mass_mail_deleted, 'success'); admin_redirect("index.php?module=user-mass_mail");
|
{ flash_message($lang->success_mass_mail_deleted, 'success'); admin_redirect("index.php?module=user-mass_mail");
|
} }
| } }
|
else { if($mybb->input['archive'] == 1)
| else { if($mybb->input['archive'] == 1)
|
Zeile 1447 | Zeile 1470 |
---|
{ $page->output_confirm_action("index.php?module=user-mass_mail&action=delete&mid={$mass_email['mid']}", $lang->mass_mail_deletion_confirmation); }
|
{ $page->output_confirm_action("index.php?module=user-mass_mail&action=delete&mid={$mass_email['mid']}", $lang->mass_mail_deletion_confirmation); }
|
} }
| } }
|
if($mybb->input['action'] == "preview") { $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $mass_email = $db->fetch_array($query);
|
if($mybb->input['action'] == "preview") { $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $mass_email = $db->fetch_array($query);
|
|
|
if(!$mass_email['mid']) { flash_message($lang->error_invalid_mid, 'error');
| if(!$mass_email['mid']) { flash_message($lang->error_invalid_mid, 'error');
|
Zeile 1462 | Zeile 1485 |
---|
}
$plugins->run_hooks("admin_user_mass_email_preview_start");
|
}
$plugins->run_hooks("admin_user_mass_email_preview_start");
|
|
|
echo '<div class="modal"> <div style="overflow-y: auto; max-height: 400px;">';
|
echo '<div class="modal"> <div style="overflow-y: auto; max-height: 400px;">';
|
|
|
$table = new Table();
|
$table = new Table();
|
|
|
if($mybb->input['format'] == 'text' || !$mass_email['htmlmessage']) { // Show preview of the text version $table->construct_cell(nl2br($mass_email['message']));
|
if($mybb->input['format'] == 'text' || !$mass_email['htmlmessage']) { // Show preview of the text version $table->construct_cell(nl2br($mass_email['message']));
|
}
| }
|
else { // Preview the HTML version
| else { // Preview the HTML version
|
Zeile 1538 | Zeile 1561 |
---|
if($mybb->input['action'] == "cancel") {
|
if($mybb->input['action'] == "cancel") {
|
| if(!verify_post_check($mybb->get_input('my_post_key'))) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=user-users"); }
|
// Cancel the delivery of a mass-email. $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $mass_email = $db->fetch_array($query);
| // Cancel the delivery of a mass-email. $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'"); $mass_email = $db->fetch_array($query);
|
Zeile 1610 | Zeile 1639 |
---|
{ $table->construct_cell($lang->no_archived_messages, array('colspan' => 6)); $table->construct_row();
|
{ $table->construct_cell($lang->no_archived_messages, array('colspan' => 6)); $table->construct_row();
|
$no_results = true;
| |
}
$plugins->run_hooks("admin_user_mass_email_archive_end");
| }
$plugins->run_hooks("admin_user_mass_email_archive_end");
|
Zeile 1693 | Zeile 1721 |
---|
{ $table->construct_cell($lang->no_unsent_messages, array('colspan' => 6)); $table->construct_row();
|
{ $table->construct_cell($lang->no_unsent_messages, array('colspan' => 6)); $table->construct_row();
|
$no_results = true;
| |
}
$plugins->run_hooks("admin_user_mass_email_end");
| }
$plugins->run_hooks("admin_user_mass_email_end");
|