Vergleich admin/modules/forum/announcements.php - 1.8.20 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 53Zeile 53

if($mybb->request_method == "post")
{


if($mybb->request_method == "post")
{

		if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;
}

if(!trim($mybb->input['message']))
{
$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;
}

if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)))
{
$errors[] = $lang->error_invalid_start_date;
}

// End before startdate?
$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)
{
$startdate[0] = "00";
}
}

if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];
if($enddate[0] >= 24)
{
$enddate[0] = "00";
}
}

$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT));

if($mybb->input['endtime_type'] != "2")
{
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT));
if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)))
{
$errors[] = $lang->error_invalid_end_date;
}
if($enddate <= $startdate)
{
$errors[] = $lang->error_end_before_start;
}
}

if(!$errors)
{
if(isset($mybb->input['preview']))
{
$parser_options = array();
$parser_options['allow_html'] = $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT);
$parser_options['allow_mycode'] = $mybb->get_input('allowmycode', MyBB::INPUT_INT);
$parser_options['allow_smilies'] = $mybb->get_input('allowsmilies', MyBB::INPUT_INT);
$parser_options['allow_imgcode'] = 1;
$parser_options['allow_videocode'] = 1;
$parser_options['me_username'] = htmlspecialchars_uni($mybb->user['username']);
$parser_options['filter_badwords'] = 1;

// Set up the message parser if it doesn't already exist.
if(!is_object($parser))
{



		if(!trim($mybb->get_input('title')))
{
$errors[] = $lang->error_missing_title;
}

if(!trim($mybb->get_input('message')))
{
$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->get_input('fid')))
{
$errors[] = $lang->error_missing_forum;
}

if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)))
{
$errors[] = $lang->error_invalid_start_date;
}

// End before startdate?
$startdate = @explode(" ", $mybb->input['starttime_time']);
$startdate = @explode(":", $startdate[0]);
$enddate = @explode(" ", $mybb->input['endtime_time']);
$enddate = @explode(":", $enddate[0]);

if(stristr($mybb->input['starttime_time'], "pm"))
{
$startdate[0] = 12+$startdate[0];
if($startdate[0] >= 24)
{
$startdate[0] = "00";
}
}

if(stristr($mybb->input['endtime_time'], "pm"))
{
$enddate[0] = 12+$enddate[0];
if($enddate[0] >= 24)
{
$enddate[0] = "00";
}
}

$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT));

if($mybb->input['endtime_type'] != "2")
{
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT));
if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)))
{
$errors[] = $lang->error_invalid_end_date;
}
if($enddate <= $startdate)
{
$errors[] = $lang->error_end_before_start;
}
}

if(!$errors)
{
if(isset($mybb->input['preview']))
{
$lang->load('global', true);

$parser_options = array();
$parser_options['allow_html'] = $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT);
$parser_options['allow_mycode'] = $mybb->get_input('allowmycode', MyBB::INPUT_INT);
$parser_options['allow_smilies'] = $mybb->get_input('allowsmilies', MyBB::INPUT_INT);
$parser_options['allow_imgcode'] = 1;
$parser_options['allow_videocode'] = 1;
$parser_options['me_username'] = htmlspecialchars_uni($mybb->user['username']);
$parser_options['filter_badwords'] = 1;

// Set up the message parser if it doesn't already exist.
if(!isset($parser) || !is_object($parser))
{

					require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

					require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
}

Zeile 268Zeile 270
		else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";

		else
{
$startdateday .= "<option value=\"$i\">$i</option>\n";

		}

if($endday == $i)
{
$enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else

		}

if($endday == $i)
{
$enddateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else

		{
$enddateday .= "<option value=\"$i\">$i</option>\n";
}

		{
$enddateday .= "<option value=\"$i\">$i</option>\n";
}

Zeile 308Zeile 310
		$endmonthsel[$endmonth] = "selected=\"selected\"";
}


		$endmonthsel[$endmonth] = "selected=\"selected\"";
}


	$startdatemonth .= "<option value=\"01\" {$startmonthsel['01']}>{$lang->january}</option>\n";
$enddatemonth .= "<option value=\"01\" {$endmonthsel['01']}>{$lang->january}</option>\n";
$startdatemonth .= "<option value=\"02\" {$startmonthsel['02']}>{$lang->february}</option>\n";
$enddatemonth .= "<option value=\"02\" {$endmonthsel['02']}>{$lang->february}</option>\n";
$startdatemonth .= "<option value=\"03\" {$startmonthsel['03']}>{$lang->march}</option>\n";
$enddatemonth .= "<option value=\"03\" {$endmonthsel['03']}>{$lang->march}</option>\n";
$startdatemonth .= "<option value=\"04\" {$startmonthsel['04']}>{$lang->april}</option>\n";
$enddatemonth .= "<option value=\"04\" {$endmonthsel['04']}>{$lang->april}</option>\n";
$startdatemonth .= "<option value=\"05\" {$startmonthsel['05']}>{$lang->may}</option>\n";
$enddatemonth .= "<option value=\"05\" {$endmonthsel['05']}>{$lang->may}</option>\n";
$startdatemonth .= "<option value=\"06\" {$startmonthsel['06']}>{$lang->june}</option>\n";
$enddatemonth .= "<option value=\"06\" {$endmonthsel['06']}>{$lang->june}</option>\n";
$startdatemonth .= "<option value=\"07\" {$startmonthsel['07']}>{$lang->july}</option>\n";
$enddatemonth .= "<option value=\"07\" {$endmonthsel['07']}>{$lang->july}</option>\n";
$startdatemonth .= "<option value=\"08\" {$startmonthsel['08']}>{$lang->august}</option>\n";
$enddatemonth .= "<option value=\"08\" {$endmonthsel['08']}>{$lang->august}</option>\n";
$startdatemonth .= "<option value=\"09\" {$startmonthsel['09']}>{$lang->september}</option>\n";
$enddatemonth .= "<option value=\"09\" {$endmonthsel['09']}>{$lang->september}</option>\n";

	$startdatemonth .= "<option value=\"01\" {$startmonthsel['1']}>{$lang->january}</option>\n";
$enddatemonth .= "<option value=\"01\" {$endmonthsel['1']}>{$lang->january}</option>\n";
$startdatemonth .= "<option value=\"02\" {$startmonthsel['2']}>{$lang->february}</option>\n";
$enddatemonth .= "<option value=\"02\" {$endmonthsel['2']}>{$lang->february}</option>\n";
$startdatemonth .= "<option value=\"03\" {$startmonthsel['3']}>{$lang->march}</option>\n";
$enddatemonth .= "<option value=\"03\" {$endmonthsel['3']}>{$lang->march}</option>\n";
$startdatemonth .= "<option value=\"04\" {$startmonthsel['4']}>{$lang->april}</option>\n";
$enddatemonth .= "<option value=\"04\" {$endmonthsel['4']}>{$lang->april}</option>\n";
$startdatemonth .= "<option value=\"05\" {$startmonthsel['5']}>{$lang->may}</option>\n";
$enddatemonth .= "<option value=\"05\" {$endmonthsel['5']}>{$lang->may}</option>\n";
$startdatemonth .= "<option value=\"06\" {$startmonthsel['6']}>{$lang->june}</option>\n";
$enddatemonth .= "<option value=\"06\" {$endmonthsel['6']}>{$lang->june}</option>\n";
$startdatemonth .= "<option value=\"07\" {$startmonthsel['7']}>{$lang->july}</option>\n";
$enddatemonth .= "<option value=\"07\" {$endmonthsel['7']}>{$lang->july}</option>\n";
$startdatemonth .= "<option value=\"08\" {$startmonthsel['8']}>{$lang->august}</option>\n";
$enddatemonth .= "<option value=\"08\" {$endmonthsel['8']}>{$lang->august}</option>\n";
$startdatemonth .= "<option value=\"09\" {$startmonthsel['9']}>{$lang->september}</option>\n";
$enddatemonth .= "<option value=\"09\" {$endmonthsel['9']}>{$lang->september}</option>\n";

	$startdatemonth .= "<option value=\"10\" {$startmonthsel['10']}>{$lang->october}</option>\n";
$enddatemonth .= "<option value=\"10\" {$endmonthsel['10']}>{$lang->october}</option>\n";
$startdatemonth .= "<option value=\"11\" {$startmonthsel['11']}>{$lang->november}</option>\n";

	$startdatemonth .= "<option value=\"10\" {$startmonthsel['10']}>{$lang->october}</option>\n";
$enddatemonth .= "<option value=\"10\" {$endmonthsel['10']}>{$lang->october}</option>\n";
$startdatemonth .= "<option value=\"11\" {$startmonthsel['11']}>{$lang->november}</option>\n";

Zeile 438Zeile 440
		if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;

		if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;

		}


		}


		if(!trim($mybb->input['message']))

		if(!trim($mybb->input['message']))

		{

		{

			$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;

			$errors[] = $lang->error_missing_message;
}

if(!trim($mybb->input['fid']))
{
$errors[] = $lang->error_missing_forum;

		}


		}


		if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)))
{
$errors[] = $lang->error_invalid_start_date;

		if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)))
{
$errors[] = $lang->error_invalid_start_date;

Zeile 467Zeile 469
			if($startdate[0] >= 24)
{
$startdate[0] = "00";

			if($startdate[0] >= 24)
{
$startdate[0] = "00";

			}

			}

		}

if(stristr($mybb->input['endtime_time'], "pm"))

		}

if(stristr($mybb->input['endtime_time'], "pm"))

Zeile 476Zeile 478
			if($enddate[0] >= 24)
{
$enddate[0] = "00";

			if($enddate[0] >= 24)
{
$enddate[0] = "00";

			}

			}

		}

		}





		$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT));

if($mybb->input['endtime_type'] != "2")
{
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT));
if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)))

		$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT));

if($mybb->input['endtime_type'] != "2")
{
$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, $mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT));
if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)))

			{

			{

				$errors[] = $lang->error_invalid_end_date;
}
if($enddate <= $startdate)

				$errors[] = $lang->error_invalid_end_date;
}
if($enddate <= $startdate)

Zeile 498Zeile 500
		{
if(isset($mybb->input['preview']))
{

		{
if(isset($mybb->input['preview']))
{

 
				$lang->load('global', true);


				$parser_options = array();
$parser_options['allow_html'] = $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT);
$parser_options['allow_mycode'] = $mybb->get_input('allowmycode', MyBB::INPUT_INT);

				$parser_options = array();
$parser_options['allow_html'] = $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT);
$parser_options['allow_mycode'] = $mybb->get_input('allowmycode', MyBB::INPUT_INT);

Zeile 508Zeile 512
				$parser_options['filter_badwords'] = 1;

// Set up the message parser if it doesn't already exist.

				$parser_options['filter_badwords'] = 1;

// Set up the message parser if it doesn't already exist.

				if(!is_object($parser))

				if(!isset($parser) || !is_object($parser))

				{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

				{
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

				}


				}


				$preview = array();
$preview['message'] = $parser->parse_message($mybb->input['message'], $parser_options);
$preview['subject'] = htmlspecialchars_uni($mybb->input['title']);

				$preview = array();
$preview['message'] = $parser->parse_message($mybb->input['message'], $parser_options);
$preview['subject'] = htmlspecialchars_uni($mybb->input['title']);

Zeile 527Zeile 531
				}

if($mybb->input['endtime_type'] == "2")

				}

if($mybb->input['endtime_type'] == "2")

				{

				{

					$enddate = '0';
}
else

					$enddate = '0';
}
else

Zeile 548Zeile 552
					"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT)
);

					"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT)
);





				$plugins->run_hooks("admin_forum_announcements_edit_commit");

$db->update_query("announcements", $update_announcement, "aid='{$mybb->input['aid']}'");

				$plugins->run_hooks("admin_forum_announcements_edit_commit");

$db->update_query("announcements", $update_announcement, "aid='{$mybb->input['aid']}'");

Zeile 561Zeile 565
				admin_redirect("index.php?module=forum-announcements");
}
}

				admin_redirect("index.php?module=forum-announcements");
}
}

	}


	}


	$page->add_breadcrumb_item($lang->update_an_announcement);
$page->output_header($lang->update_an_announcement);
$page->output_nav_tabs($sub_tabs, "update_announcement");

	$page->add_breadcrumb_item($lang->update_an_announcement);
$page->output_header($lang->update_an_announcement);
$page->output_nav_tabs($sub_tabs, "update_announcement");





	$form = new Form("index.php?module=forum-announcements&amp;action=edit", "post");
echo $form->generate_hidden_field("aid", $mybb->input['aid']);

	$form = new Form("index.php?module=forum-announcements&amp;action=edit", "post");
echo $form->generate_hidden_field("aid", $mybb->input['aid']);

 

// Months
for($i = 1; $i <= 12; ++$i)
{
$endmonthsel[$i] = $startmonthsel[$i] = '';
}


if($errors || isset($mybb->input['preview']))
{


if($errors || isset($mybb->input['preview']))
{

Zeile 661Zeile 671
			$enddateyear = $startdateyear+1;
}
}

			$enddateyear = $startdateyear+1;
}
}

 

$startdateday = $enddateday = $startdatemonth = $enddatemonth = '';


for($i = 1; $i <= 31; ++$i)
{


for($i = 1; $i <= 31; ++$i)
{

Zeile 683Zeile 695
		}
}


		}
}


	$startdatemonth .= "<option value=\"01\" {$startmonthsel['01']}>{$lang->january}</option>\n";
$enddatemonth .= "<option value=\"01\" {$endmonthsel['01']}>{$lang->january}</option>\n";
$startdatemonth .= "<option value=\"02\" {$startmonthsel['02']}>{$lang->february}</option>\n";
$enddatemonth .= "<option value=\"02\" {$endmonthsel['02']}>{$lang->february}</option>\n";
$startdatemonth .= "<option value=\"03\" {$startmonthsel['03']}>{$lang->march}</option>\n";
$enddatemonth .= "<option value=\"03\" {$endmonthsel['03']}>{$lang->march}</option>\n";
$startdatemonth .= "<option value=\"04\" {$startmonthsel['04']}>{$lang->april}</option>\n";
$enddatemonth .= "<option value=\"04\" {$endmonthsel['04']}>{$lang->april}</option>\n";
$startdatemonth .= "<option value=\"05\" {$startmonthsel['05']}>{$lang->may}</option>\n";
$enddatemonth .= "<option value=\"05\" {$endmonthsel['05']}>{$lang->may}</option>\n";
$startdatemonth .= "<option value=\"06\" {$startmonthsel['06']}>{$lang->june}</option>\n";
$enddatemonth .= "<option value=\"06\" {$endmonthsel['06']}>{$lang->june}</option>\n";
$startdatemonth .= "<option value=\"07\" {$startmonthsel['07']}>{$lang->july}</option>\n";
$enddatemonth .= "<option value=\"07\" {$endmonthsel['07']}>{$lang->july}</option>\n";
$startdatemonth .= "<option value=\"08\" {$startmonthsel['08']}>{$lang->august}</option>\n";
$enddatemonth .= "<option value=\"08\" {$endmonthsel['08']}>{$lang->august}</option>\n";
$startdatemonth .= "<option value=\"09\" {$startmonthsel['09']}>{$lang->september}</option>\n";
$enddatemonth .= "<option value=\"09\" {$endmonthsel['09']}>{$lang->september}</option>\n";

	$startdatemonth .= "<option value=\"01\" {$startmonthsel['1']}>{$lang->january}</option>\n";
$enddatemonth .= "<option value=\"01\" {$endmonthsel['1']}>{$lang->january}</option>\n";
$startdatemonth .= "<option value=\"02\" {$startmonthsel['2']}>{$lang->february}</option>\n";
$enddatemonth .= "<option value=\"02\" {$endmonthsel['2']}>{$lang->february}</option>\n";
$startdatemonth .= "<option value=\"03\" {$startmonthsel['3']}>{$lang->march}</option>\n";
$enddatemonth .= "<option value=\"03\" {$endmonthsel['3']}>{$lang->march}</option>\n";
$startdatemonth .= "<option value=\"04\" {$startmonthsel['4']}>{$lang->april}</option>\n";
$enddatemonth .= "<option value=\"04\" {$endmonthsel['4']}>{$lang->april}</option>\n";
$startdatemonth .= "<option value=\"05\" {$startmonthsel['5']}>{$lang->may}</option>\n";
$enddatemonth .= "<option value=\"05\" {$endmonthsel['5']}>{$lang->may}</option>\n";
$startdatemonth .= "<option value=\"06\" {$startmonthsel['6']}>{$lang->june}</option>\n";
$enddatemonth .= "<option value=\"06\" {$endmonthsel['6']}>{$lang->june}</option>\n";
$startdatemonth .= "<option value=\"07\" {$startmonthsel['7']}>{$lang->july}</option>\n";
$enddatemonth .= "<option value=\"07\" {$endmonthsel['7']}>{$lang->july}</option>\n";
$startdatemonth .= "<option value=\"08\" {$startmonthsel['8']}>{$lang->august}</option>\n";
$enddatemonth .= "<option value=\"08\" {$endmonthsel['8']}>{$lang->august}</option>\n";
$startdatemonth .= "<option value=\"09\" {$startmonthsel['9']}>{$lang->september}</option>\n";
$enddatemonth .= "<option value=\"09\" {$endmonthsel['9']}>{$lang->september}</option>\n";

	$startdatemonth .= "<option value=\"10\" {$startmonthsel['10']}>{$lang->october}</option>\n";
$enddatemonth .= "<option value=\"10\" {$endmonthsel['10']}>{$lang->october}</option>\n";
$startdatemonth .= "<option value=\"11\" {$startmonthsel['11']}>{$lang->november}</option>\n";

	$startdatemonth .= "<option value=\"10\" {$startmonthsel['10']}>{$lang->october}</option>\n";
$enddatemonth .= "<option value=\"10\" {$endmonthsel['10']}>{$lang->october}</option>\n";
$startdatemonth .= "<option value=\"11\" {$startmonthsel['11']}>{$lang->november}</option>\n";

Zeile 793Zeile 805
	}

// User clicked no

	}

// User clicked no

	if($mybb->input['no'])

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=forum-announcements");
}

	{
admin_redirect("index.php?module=forum-announcements");
}