Zeile 45 | Zeile 45 |
---|
{ $page->add_breadcrumb_item($lang->edit_mass_mail);
|
{ $page->add_breadcrumb_item($lang->edit_mass_mail);
|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', 1)."'");
| $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
|
$email = $db->fetch_array($query); if(!$email['mid']) {
| $email = $db->fetch_array($query); if(!$email['mid']) {
|
Zeile 82 | Zeile 82 |
---|
$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 = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
|
// All done here if($mybb->request_method == "post") {
| // All done here if($mybb->request_method == "post") {
|
Zeile 93 | Zeile 95 |
---|
// Delivering in the future else {
|
// 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];
|
|
|
$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 124 | Zeile 126 |
---|
if(!trim($mybb->input['subject'])) { $errors[] = $lang->error_missing_subject;
|
if(!trim($mybb->input['subject'])) { $errors[] = $lang->error_missing_subject;
|
}
| }
|
if($mybb->input['type'] == 1) { if(!$mybb->input['message']) { $errors[] = $lang->error_missing_message;
|
if($mybb->input['type'] == 1) { if(!$mybb->input['message']) { $errors[] = $lang->error_missing_message;
|
}
| }
|
} else { if($mybb->input['format'] == 2 && $mybb->input['automatic_text'] == 0 && !$mybb->input['message'])
|
} else { if($mybb->input['format'] == 2 && $mybb->input['automatic_text'] == 0 && !$mybb->input['message'])
|
{
| {
|
$errors[] = $lang->error_missing_plain_text; }
| $errors[] = $lang->error_missing_plain_text; }
|
Zeile 147 | Zeile 149 |
---|
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)
| }
if(!$errors)
|
Zeile 181 | Zeile 183 |
---|
"status" => 1, "senddate" => $delivery_date, "totalcount" => $num,
|
"status" => 1, "senddate" => $delivery_date, "totalcount" => $num,
|
"conditions" => $db->escape_string(serialize($mybb->input['conditions'])),
| "conditions" => $db->escape_string(my_serialize($mybb->input['conditions'])),
|
"message" => $db->escape_string($mybb->input['message']), "subject" => $db->escape_string($mybb->input['subject']), "htmlmessage" => $db->escape_string($mybb->input['htmlmessage']),
|
"message" => $db->escape_string($mybb->input['message']), "subject" => $db->escape_string($mybb->input['subject']), "htmlmessage" => $db->escape_string($mybb->input['htmlmessage']),
|
"format" => (int)$mybb->input['format'], "type" => $mybb->get_input('type', 1), "perpage" => $mybb->get_input('perpage', 1)
| "format" => $mybb->get_input('format', MyBB::INPUT_INT), "type" => $mybb->get_input('type', MyBB::INPUT_INT), "perpage" => $mybb->get_input('perpage', MyBB::INPUT_INT)
|
);
$plugins->run_hooks("admin_user_mass_email_edit_commit");
| );
$plugins->run_hooks("admin_user_mass_email_edit_commit");
|
Zeile 222 | Zeile 224 |
---|
} else {
|
} 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\""; } }
|
Zeile 239 | Zeile 241 |
---|
$input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\""; }
|
$input['delivery_type'] = "now"; $delivery_type_checked['now'] = " checked=\"checked\""; }
|
| } if(!$input['endtime_time']) { $input['endtime_time'] = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);
|
}
|
}
|
if($input['deliveryhour'])
| if(!$input['deliveryyear'])
|
{
|
{
|
$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";
| $enddateyear = gmdate('Y', TIME_NOW + $localized_time_offset);
|
}
|
}
|
if(!$input['deliveryyear']) { $enddateyear = gmdate('Y', TIME_NOW); } else {
| else {
|
$enddateyear = (int)$input['deliveryyear']; }
if(!$input['deliverymonth'])
|
$enddateyear = (int)$input['deliveryyear']; }
if(!$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']) { $input['enddateday'] = gmdate('j', TIME_NOW); }
| }
if(!$input['deliveryday']) { $input['enddateday'] = gmdate('j', TIME_NOW + $localized_time_offset); }
|
else { $input['enddateday'] = (int)$input['deliveryday'];
| else { $input['enddateday'] = (int)$input['deliveryday'];
|
Zeile 391 | Zeile 371 |
---|
$(this).hide(); }); if($('#'+id+'_'+checked))
|
$(this).hide(); }); if($('#'+id+'_'+checked))
|
{
| {
|
$('#'+id+'_'+checked).show(); } } </script> <dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\"> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"delivery_type\" value=\"now\" {$delivery_type_checked['now']} class=\"delivery_types_check\" onclick=\"checkAction('delivery_type');\" style=\"vertical-align: middle;\" /> <strong>{$lang->deliver_immediately}</strong></label></dt>
|
$('#'+id+'_'+checked).show(); } } </script> <dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\"> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"delivery_type\" value=\"now\" {$delivery_type_checked['now']} class=\"delivery_types_check\" onclick=\"checkAction('delivery_type');\" style=\"vertical-align: middle;\" /> <strong>{$lang->deliver_immediately}</strong></label></dt>
|
|
|
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"delivery_type\" value=\"future\" {$delivery_type_checked['future']} class=\"delivery_types_check\" onclick=\"checkAction('delivery_type');\" style=\"vertical-align: middle;\" /> <strong>{$lang->deliver_specific}</strong></label></dt> <dd style=\"margin-top: 4px;\" id=\"delivery_type_future\" class=\"delivery_types\"> <table cellpadding=\"4\">
| <dt><label style=\"display: block;\"><input type=\"radio\" name=\"delivery_type\" value=\"future\" {$delivery_type_checked['future']} class=\"delivery_types_check\" onclick=\"checkAction('delivery_type');\" style=\"vertical-align: middle;\" /> <strong>{$lang->deliver_specific}</strong></label></dt> <dd style=\"margin-top: 4px;\" id=\"delivery_type_future\" class=\"delivery_types\"> <table cellpadding=\"4\">
|
Zeile 412 | Zeile 392 |
---|
checkAction('delivery_type'); </script>"; $form_container->output_row("{$lang->delivery_date}: <em>*</em>", $lang->delivery_date_desc, $actions);
|
checkAction('delivery_type'); </script>"; $form_container->output_row("{$lang->delivery_date}: <em>*</em>", $lang->delivery_date_desc, $actions);
|
$form_container->output_row("{$lang->per_page}: <em>*</em>", $lang->per_page_desc, $form->generate_text_box('perpage', $input['perpage'], array('id' => 'perpage')), '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');
|
$format_options = array( 0 => $lang->plain_text_only, 1 => $lang->html_only, 2 => $lang->html_and_plain_text );
|
$format_options = array( 0 => $lang->plain_text_only, 1 => $lang->html_only, 2 => $lang->html_and_plain_text );
|
$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->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();
if($input['format'] == 2)
| $form_container->end();
if($input['format'] == 2)
|
Zeile 435 | Zeile 415 |
---|
} } else if($input['format'] == 1 && $input['type'] != 1)
|
} } else if($input['format'] == 1 && $input['type'] != 1)
|
{
| {
|
$text_display = 'display: none;'; } else if($input['format'] == 0 || $input['type'] == 1)
| $text_display = 'display: none;'; } else if($input['format'] == 0 || $input['type'] == 1)
|
Zeile 446 | Zeile 426 |
---|
echo "<div id=\"message_html\" style=\"{$html_display}\">"; $form_container = new FormContainer("{$lang->edit_mass_mail}: {$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>");
|
echo "<div id=\"message_html\" style=\"{$html_display}\">"; $form_container = new FormContainer("{$lang->edit_mass_mail}: {$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->end();
|
echo "</div>";
echo "<div id=\"message_text\" style=\"{$text_display}\">";
| echo "</div>";
echo "<div id=\"message_text\" style=\"{$text_display}\">";
|
Zeile 457 | Zeile 437 |
---|
echo " <script type=\"text/javascript\">
|
echo " <script type=\"text/javascript\">
|
function ToggleFormat() { var v = $('#format option:selected').val(); if(v == 2) {
| function ToggleFormat() { var v = $('#format option:selected').val(); if(v == 2) {
|
$('#automatic_display').show(); $('#message_html').show(); if($('#automatic_text').checked) { $('#message_text').hide();
|
$('#automatic_display').show(); $('#message_html').show(); if($('#automatic_text').checked) { $('#message_text').hide();
|
}
| }
|
else { $('#message_text').show(); }
|
else { $('#message_text').show(); }
|
}
| }
|
else if(v == 1) { $('#message_text').hide(); $('#message_html').show(); $('#automatic_display').hide();
|
else if(v == 1) { $('#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 503 | Zeile 483 |
---|
$('#message_html').show(); $('#format_container').show(); ToggleFormat();
|
$('#message_html').show(); $('#format_container').show(); ToggleFormat();
|
} }
| } }
|
$('#type_pm').on('click', function() { ToggleType(); });
| $('#type_pm').on('click', function() { ToggleType(); });
|
Zeile 557 | Zeile 537 |
---|
$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 566 | Zeile 546 |
---|
while($usergroup = $db->fetch_array($query)) { $options[$usergroup['gid']] = $usergroup['title'];
|
while($usergroup = $db->fetch_array($query)) { $options[$usergroup['gid']] = $usergroup['title'];
|
}
$form_container->output_row($lang->members_of, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');
| }
$form_container->output_row($lang->members_of, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');
|
$greater_options = array( "greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly,
|
$greater_options = array( "greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly,
|
"less_than" => $lang->less_than ); $form_container->output_row($lang->post_count_is, "", $form->generate_select_box('conditions[postnum_dir]', $greater_options, $input['conditions']['postnum_dir'], array('id' => 'postnum_dir'))." ".$form->generate_text_box('conditions[postnum]', $input['conditions']['postnum'], array('id' => 'postnum')), 'postnum');
| "less_than" => $lang->less_than ); $form_container->output_row($lang->post_count_is, "", $form->generate_select_box('conditions[postnum_dir]', $greater_options, $input['conditions']['postnum_dir'], array('id' => 'postnum_dir'))." ".$form->generate_numeric_field('conditions[postnum]', $input['conditions']['postnum'], array('id' => 'postnum', 'min' => 0)), 'postnum');
|
$more_options = array( "more_than" => $lang->more_than, "less_than" => $lang->less_than
|
$more_options = array( "more_than" => $lang->more_than, "less_than" => $lang->less_than
|
);
| );
|
$date_options = array( "hours" => $lang->hours, "days" => $lang->days,
| $date_options = array( "hours" => $lang->hours, "days" => $lang->days,
|
Zeile 589 | Zeile 569 |
---|
"months" => $lang->months, "years" => $lang->years );
|
"months" => $lang->months, "years" => $lang->years );
|
$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_text_box('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate'))." ".$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_text_box('conditions[lastactive]', $input['conditions']['lastactive'], array('id' => 'lastactive'))." ".$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->save_mass_mail); $form->output_submit_wrapper($buttons);
$form->end(); $page->output_footer(); }
|
$buttons[] = $form->generate_submit_button($lang->save_mass_mail); $form->output_submit_wrapper($buttons);
$form->end(); $page->output_footer(); }
|
|
|
if($mybb->input['action'] == "send") { $page->add_breadcrumb_item($lang->send_mass_mail);
if($mybb->input['step']) {
|
if($mybb->input['action'] == "send") { $page->add_breadcrumb_item($lang->send_mass_mail);
if($mybb->input['step']) {
|
$query = $db->simple_select("massemails", "*", "status=0 and mid='".$mybb->get_input('mid', 1)."'");
| $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) { flash_message($lang->error_invalid_mid, 'error'); admin_redirect("index.php?module=user-mass_mail"); }
|
$email = $db->fetch_array($query); if(!$email['mid'] && $mybb->input['step'] != 1) { flash_message($lang->error_invalid_mid, 'error'); 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 626 | Zeile 606 |
---|
$html_personalisation = $text_personalisation = "<script type=\"text/javascript\">\n<!--\ndocument.write('{$lang->personalize_message} "; foreach($replacement_fields as $value => $name)
|
$html_personalisation = $text_personalisation = "<script type=\"text/javascript\">\n<!--\ndocument.write('{$lang->personalize_message} "; foreach($replacement_fields as $value => $name)
|
{
| {
|
$html_personalisation .= " [<a href=\"#\" onclick=\"insertText(\'{$value}\', \'htmlmessage\'); return false;\">{$name}</a>], "; $text_personalisation .= " [<a href=\"#\" onclick=\"insertText(\'{$value}\', \'message\'); return false;\">{$name}</a>], "; }
| $html_personalisation .= " [<a href=\"#\" onclick=\"insertText(\'{$value}\', \'htmlmessage\'); return false;\">{$name}</a>], "; $text_personalisation .= " [<a href=\"#\" onclick=\"insertText(\'{$value}\', \'message\'); return false;\">{$name}</a>], "; }
|
Zeile 634 | Zeile 614 |
---|
$text_personalisation = substr($text_personalisation, 0, -2)."');\n// --></script>\n";
$plugins->run_hooks("admin_user_mass_email_send_start");
|
$text_personalisation = substr($text_personalisation, 0, -2)."');\n// --></script>\n";
$plugins->run_hooks("admin_user_mass_email_send_start");
|
if($mybb->input['step'] == 4) {
| $localized_time_offset = $mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
if($mybb->input['step'] == 4) {
|
// All done here if($mybb->request_method == "post") {
| // All done here if($mybb->request_method == "post") {
|
Zeile 648 | Zeile 630 |
---|
// Delivering in the future else {
|
// 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 659 | Zeile 641 |
---|
$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 680 | Zeile 662 |
---|
flash_message($lang->success_mass_mail_saved, 'success'); admin_redirect("index.php?module=user-mass_mail");
|
flash_message($lang->success_mass_mail_saved, 'success'); admin_redirect("index.php?module=user-mass_mail");
|
} }
| } }
|
// Show summary of the mass email we've just been creating and allow the user to specify the delivery date $page->output_header("{$lang->send_mass_mail}: {$lang->step_four}");
| // Show summary of the mass email we've just been creating and allow the user to specify the delivery date $page->output_header("{$lang->send_mass_mail}: {$lang->step_four}");
|
Zeile 690 | Zeile 672 |
---|
// If we have any error messages, show them if($errors)
|
// If we have any error messages, show them if($errors)
|
{
| {
|
$page->output_inline_error($errors); $input = $mybb->input; }
| $page->output_inline_error($errors); $input = $mybb->input; }
|
Zeile 703 | Zeile 685 |
---|
{ $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\""; }
|
}
| }
|
else { $input['delivery_type'] = "now";
| else { $input['delivery_type'] = "now";
|
Zeile 728 | Zeile 708 |
---|
$table = new Table; $table->construct_cell("<strong>{$lang->delivery_method}:</strong>", array('width' => '25%')); if($email['type'] == 1)
|
$table = new Table; $table->construct_cell("<strong>{$lang->delivery_method}:</strong>", array('width' => '25%')); if($email['type'] == 1)
|
{
| {
|
$delivery_type = $lang->private_message;
|
$delivery_type = $lang->private_message;
|
}
| }
|
else if($email['type'] == 0) { $delivery_type = $lang->email;
| else if($email['type'] == 0) { $delivery_type = $lang->email;
|
Zeile 749 | Zeile 729 |
---|
$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)
|
{
| {
|
$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->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>";
|
}
| }
|
$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>"); $table->construct_cell(my_number_format($email['totalcount'])." - <a href=\"index.php?module=user-mass_mail&action=send&step=3&mid={$email['mid']}\">{$lang->change_recipient_conds}</a>"); $table->construct_row();
|
// Recipient counts & details $table->construct_cell("<strong>{$lang->total_recipients}:</strong>"); $table->construct_cell(my_number_format($email['totalcount'])." - <a href=\"index.php?module=user-mass_mail&action=send&step=3&mid={$email['mid']}\">{$lang->change_recipient_conds}</a>"); $table->construct_row();
|
|
|
$table->output("{$lang->send_mass_mail}: {$lang->step_four} - {$lang->review_message}");
|
$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
| if(!$input['endtime_time'])
|
{
|
{
|
$input['endtime_time'] .= "am";
| $input['endtime_time'] = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);
|
}
if(!$input['deliveryyear'])
|
}
if(!$input['deliveryyear'])
|
{ $enddateyear = gmdate('Y', TIME_NOW); }
| { $enddateyear = gmdate('Y', TIME_NOW + $localized_time_offset); }
|
else { $enddateyear = (int)$input['deliveryyear']; }
if(!$input['deliverymonth'])
|
else { $enddateyear = (int)$input['deliveryyear']; }
if(!$input['deliverymonth'])
|
{ $input['enddatemonth'] = gmdate('n', TIME_NOW); }
| { $input['enddatemonth'] = gmdate('n', TIME_NOW + $localized_time_offset); }
|
else { $input['enddatemonth'] = (int)$input['deliverymonth']; }
if(!$input['deliveryday'])
|
else { $input['enddatemonth'] = (int)$input['deliverymonth']; }
if(!$input['deliveryday'])
|
{ $input['enddateday'] = gmdate('j', TIME_NOW); }
| { $input['enddateday'] = gmdate('j', TIME_NOW + $localized_time_offset); }
|
else { $input['enddateday'] = (int)$input['deliveryday']; }
|
else { $input['enddateday'] = (int)$input['deliveryday']; }
|
|
|
$monthnames = array( "offset", $lang->january,
| $monthnames = array( "offset", $lang->january,
|
Zeile 840 | Zeile 798 |
---|
foreach($monthnames as $key => $month) { if($month == "offset")
|
foreach($monthnames as $key => $month) { if($month == "offset")
|
{
| {
|
continue; }
| continue; }
|
Zeile 938 | Zeile 896 |
---|
{ $updated_email = array( "totalcount" => $num,
|
{ $updated_email = array( "totalcount" => $num,
|
"conditions" => $db->escape_string(serialize($mybb->input['conditions']))
| "conditions" => $db->escape_string(my_serialize($mybb->input['conditions']))
|
);
$plugins->run_hooks("admin_user_mass_email_send_define_commit");
| );
$plugins->run_hooks("admin_user_mass_email_send_define_commit");
|
Zeile 947 | Zeile 905 |
---|
// 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 947 |
---|
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');
|
$form_container->output_row($lang->email_addr_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
|
|
|
$options = array(); $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
| $options = array(); $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
|
Zeile 1008 | Zeile 966 |
---|
$greater_options = array( "greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly,
|
$greater_options = array( "greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly,
|
"less_than" => $lang->less_than
| "less_than" => $lang->less_than
|
);
|
);
|
$form_container->output_row($lang->post_count_is, "", $form->generate_select_box('conditions[postnum_dir]', $greater_options, $input['conditions']['postnum_dir'], array('id' => 'postnum_dir'))." ".$form->generate_text_box('conditions[postnum]', $input['conditions']['postnum'], array('id' => 'postnum')), 'postnum');
| $form_container->output_row($lang->post_count_is, "", $form->generate_select_box('conditions[postnum_dir]', $greater_options, $input['conditions']['postnum_dir'], array('id' => 'postnum_dir'))." ".$form->generate_numeric_field('conditions[postnum]', $input['conditions']['postnum'], array('id' => 'postnum', 'min' => 0)), 'postnum');
|
$more_options = array( "more_than" => $lang->more_than, "less_than" => $lang->less_than
|
$more_options = array( "more_than" => $lang->more_than, "less_than" => $lang->less_than
|
);
| );
|
$date_options = array( "hours" => $lang->hours,
| $date_options = array( "hours" => $lang->hours,
|
Zeile 1024 | Zeile 982 |
---|
"months" => $lang->months, "years" => $lang->years );
|
"months" => $lang->months, "years" => $lang->years );
|
$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_text_box('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate'))." ".$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_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_text_box('conditions[lastactive]', $input['conditions']['lastactive'], array('id' => 'lastactive'))." ".$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_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();
|
Zeile 1058 | Zeile 1016 |
---|
// Take the user to the next step admin_redirect("index.php?module=user-mass_mail&action=send&step=3&mid={$email['mid']}");
|
// Take the user to the next step admin_redirect("index.php?module=user-mass_mail&action=send&step=3&mid={$email['mid']}");
|
}
| }
|
}
$page->output_header("{$lang->send_mass_mail}: {$lang->step_two}");
| }
$page->output_header("{$lang->send_mass_mail}: {$lang->step_two}");
|
Zeile 1149 | Zeile 1107 |
---|
"subject" => $db->escape_string($mybb->input['subject']), "message" => $db->escape_string($mybb->input['message']), "htmlmessage" => $db->escape_string($mybb->input['htmlmessage']),
|
"subject" => $db->escape_string($mybb->input['subject']), "message" => $db->escape_string($mybb->input['message']), "htmlmessage" => $db->escape_string($mybb->input['htmlmessage']),
|
"format" => (int)$mybb->input['format'], "type" => $mybb->get_input('type', 1),
| "format" => $mybb->get_input('format', MyBB::INPUT_INT), "type" => $mybb->get_input('type', MyBB::INPUT_INT),
|
"dateline" => TIME_NOW, "senddate" => 0, "status" => 0, "sentcount" => 0, "totalcount" => 0, "conditions" => "",
|
"dateline" => TIME_NOW, "senddate" => 0, "status" => 0, "sentcount" => 0, "totalcount" => 0, "conditions" => "",
|
"perpage" => $mybb->get_input('perpage', 1)
| "perpage" => $mybb->get_input('perpage', MyBB::INPUT_INT)
|
);
$mid = $db->insert_query("massemails", $new_email);
| );
$mid = $db->insert_query("massemails", $new_email);
|
Zeile 1165 | Zeile 1123 |
---|
$plugins->run_hooks("admin_user_mass_email_send_insert_commit"); } // Updating an existing one
|
$plugins->run_hooks("admin_user_mass_email_send_insert_commit"); } // Updating an existing one
|
else {
| else {
|
$updated_email = array( "subject" => $db->escape_string($mybb->input['subject']), "message" => $db->escape_string($mybb->input['message']), "htmlmessage" => $db->escape_string($mybb->input['htmlmessage']),
|
$updated_email = array( "subject" => $db->escape_string($mybb->input['subject']), "message" => $db->escape_string($mybb->input['message']), "htmlmessage" => $db->escape_string($mybb->input['htmlmessage']),
|
"format" => (int)$mybb->input['format'], "type" => $mybb->get_input('type', 1), "perpage" => $mybb->get_input('perpage', 1)
| "format" => $mybb->get_input('format', MyBB::INPUT_INT), "type" => $mybb->get_input('type', MyBB::INPUT_INT), "perpage" => $mybb->get_input('perpage', MyBB::INPUT_INT)
|
);
|
);
|
$plugins->run_hooks("admin_user_mass_email_send_update_commit");
| $plugins->run_hooks("admin_user_mass_email_send_update_commit");
|
$db->update_query("massemails", $updated_email, "mid='{$email['mid']}'"); $mid = $email['mid'];
|
$db->update_query("massemails", $updated_email, "mid='{$email['mid']}'"); $mid = $email['mid'];
|
}
| }
|
if($mybb->input['format'] == 2 && $mybb->input['automatic_text'] == 1)
|
if($mybb->input['format'] == 2 && $mybb->input['automatic_text'] == 1)
|
{
| {
|
$next = 2;
|
$next = 2;
|
}
| }
|
else { $next = 3; } admin_redirect("index.php?module=user-mass_mail&action=send&step={$next}&mid={$mid}");
|
else { $next = 3; } admin_redirect("index.php?module=user-mass_mail&action=send&step={$next}&mid={$mid}");
|
} }
$page->output_header("{$lang->send_mass_mail}: {$lang->step_one}");
| } }
$page->output_header("{$lang->send_mass_mail}: {$lang->step_one}");
|
$mid_add = ''; if($email['mid'])
| $mid_add = ''; if($email['mid'])
|
Zeile 1254 | Zeile 1212 |
---|
$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_text_box('perpage', $input['perpage'], array('id' => 'perpage')), '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();
|
Zeile 1400 | Zeile 1358 |
---|
if($mybb->input['action'] == "delete") {
|
if($mybb->input['action'] == "delete") {
|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', 1)."'");
| $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
|
$mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
| $mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
|
Zeile 1452 | Zeile 1410 |
---|
if($mybb->input['action'] == "preview") {
|
if($mybb->input['action'] == "preview") {
|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', 1)."'");
| $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
|
$mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
| $mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
|
Zeile 1493 | Zeile 1451 |
---|
if($mybb->input['action'] == "resend") { // Copy and resend an email
|
if($mybb->input['action'] == "resend") { // Copy and resend an email
|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', 1)."'");
| $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
|
$mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
| $mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
|
Zeile 1538 | Zeile 1496 |
---|
if($mybb->input['action'] == "cancel") {
|
if($mybb->input['action'] == "cancel") {
|
| if(!verify_post_check($mybb->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.
|
// Cancel the delivery of a mass-email.
|
$query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', 1)."'");
| $query = $db->simple_select("massemails", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
|
$mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
| $mass_email = $db->fetch_array($query);
if(!$mass_email['mid'])
|