Vergleich admin/modules/forum/announcements.php - 1.8.2 - 1.8.24

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 68Zeile 68
			$errors[] = $lang->error_missing_forum;
}


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


		if(!checkdate((int)$mybb->input['starttime_month'], (int)$mybb->input['starttime_day'], (int)$mybb->input['starttime_year']))

		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;
}

		{
$errors[] = $lang->error_invalid_start_date;
}

Zeile 97Zeile 97
			}
}


			}
}


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

		$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")
{


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

			$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, (int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']);
if(!checkdate((int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']))

			$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;
}

			{
$errors[] = $lang->error_invalid_end_date;
}

Zeile 117Zeile 117
			if(isset($mybb->input['preview']))
{
$parser_options = array();

			if(isset($mybb->input['preview']))
{
$parser_options = array();

				$parser_options['allow_html'] = (int)$mybb->input['allowhtml'];
$parser_options['allow_mycode'] = (int)$mybb->input['allowmycode'];
$parser_options['allow_smilies'] = (int)$mybb->input['allowsmilies'];

				$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['allow_imgcode'] = 1;
$parser_options['allow_videocode'] = 1;
$parser_options['me_username'] = htmlspecialchars_uni($mybb->user['username']);

Zeile 162Zeile 162
					"message" => $db->escape_string($mybb->input['message']),
"startdate" => $startdate,
"enddate" => $enddate,

					"message" => $db->escape_string($mybb->input['message']),
"startdate" => $startdate,
"enddate" => $enddate,

					"allowhtml" => $db->escape_string($mybb->input['allowhtml']),
"allowmycode" => $db->escape_string($mybb->input['allowmycode']),
"allowsmilies" => $db->escape_string($mybb->input['allowsmilies']),

					"allowhtml" => (int)($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT)),
"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT)

				);

$aid = $db->insert_query("announcements", $insert_announcement);

				);

$aid = $db->insert_query("announcements", $insert_announcement);

Zeile 230Zeile 230

if(!$mybb->input['starttime_time'])
{


if(!$mybb->input['starttime_time'])
{

		$start_time = explode("-", gmdate("g-i-a", TIME_NOW));
$mybb->input['starttime_time'] = $start_time[0].":".$start_time[1]." ".$start_time[2];

		$mybb->input['starttime_time'] = gmdate($mybb->settings['timeformat'], TIME_NOW);


	}

if(!$mybb->input['endtime_time'])
{

	}

if(!$mybb->input['endtime_time'])
{

		$end_time = explode("-", gmdate("g-i-a", TIME_NOW));
$mybb->input['endtime_time'] = $end_time[0].":".$end_time[1]." ".$end_time[2];

		$mybb->input['endtime_time'] = gmdate($mybb->settings['timeformat'], TIME_NOW);


	}

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

	}

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

		$startday = (int)$mybb->input['starttime_day'];

		$startday = $mybb->get_input('starttime_day', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 251Zeile 249

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


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

		$endday = (int)$mybb->input['endtime_day'];

		$endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 290Zeile 288

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


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

		$startmonth = (int)$mybb->input['starttime_month'];

		$startmonth = $mybb->get_input('starttime_month', MyBB::INPUT_INT);

		$startmonthsel[$startmonth] = "selected=\"selected\"";
}
else

		$startmonthsel[$startmonth] = "selected=\"selected\"";
}
else

Zeile 301Zeile 299

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


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

		$endmonth = (int)$mybb->input['endtime_month'];

		$endmonth = $mybb->get_input('endtime_month', MyBB::INPUT_INT);

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

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

Zeile 337Zeile 335

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


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

		$startdateyear = (int)$mybb->input['starttime_year'];

		$startdateyear = $mybb->get_input('starttime_year', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 346Zeile 344

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


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

		$enddateyear = (int)$mybb->input['endtime_year'];

		$enddateyear = $mybb->get_input('endtime_year', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 406Zeile 404

$form_container->output_row($lang->forums_to_appear_in." <em>*</em>", $lang->forums_to_appear_in_desc, $form->generate_forum_select('fid', $mybb->input['fid'], array('size' => 5, 'main_option' => $lang->all_forums)));



$form_container->output_row($lang->forums_to_appear_in." <em>*</em>", $lang->forums_to_appear_in_desc, $form->generate_forum_select('fid', $mybb->input['fid'], array('size' => 5, 'main_option' => $lang->all_forums)));


	$form_container->output_row($lang->allow_html." <em>*</em>", "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml'], array('style' => 'width: 2em;')));




	if ($mybb->settings['announcementshtml'])
{
$form_container->output_row($lang->allow_html." <em>*</em>", "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml'], array('style' => 'width: 2em;')));
}


$form_container->output_row($lang->allow_mycode." <em>*</em>", "", $form->generate_yes_no_radio('allowmycode', $mybb->input['allowmycode'], array('style' => 'width: 2em;')));



$form_container->output_row($lang->allow_mycode." <em>*</em>", "", $form->generate_yes_no_radio('allowmycode', $mybb->input['allowmycode'], array('style' => 'width: 2em;')));


Zeile 437Zeile 438
		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']))
{
$errors[] = $lang->error_missing_message;

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

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

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

		}

if(!checkdate((int)$mybb->input['starttime_month'], (int)$mybb->input['starttime_day'], (int)$mybb->input['starttime_year']))

		}

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;
}

		{
$errors[] = $lang->error_invalid_start_date;
}

Zeile 470Zeile 471
		}

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

		}

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

		{

		{

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

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

			}
}

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

			}
}

$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")
{


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

			$enddate = gmmktime((int)$enddate[0], (int)$enddate[1], 0, (int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']);
if(!checkdate((int)$mybb->input['endtime_month'], (int)$mybb->input['endtime_day'], (int)$mybb->input['endtime_year']))
{

			$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 494Zeile 495
		}

if(!$errors)

		}

if(!$errors)

		{

		{

			if(isset($mybb->input['preview']))
{
$parser_options = array();

			if(isset($mybb->input['preview']))
{
$parser_options = array();

				$parser_options['allow_html'] = (int)$mybb->input['allowhtml'];
$parser_options['allow_mycode'] = (int)$mybb->input['allowmycode'];
$parser_options['allow_smilies'] = (int)$mybb->input['allowsmilies'];

				$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['allow_imgcode'] = 1;
$parser_options['allow_videocode'] = 1;
$parser_options['me_username'] = htmlspecialchars_uni($mybb->user['username']);

Zeile 543Zeile 544
					"message" => $db->escape_string($mybb->input['message']),
"startdate" => $startdate,
"enddate" => $enddate,

					"message" => $db->escape_string($mybb->input['message']),
"startdate" => $startdate,
"enddate" => $enddate,

					"allowhtml" => $db->escape_string($mybb->input['allowhtml']),
"allowmycode" => $db->escape_string($mybb->input['allowmycode']),
"allowsmilies" => $db->escape_string($mybb->input['allowsmilies']),

					"allowhtml" => (int)($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', 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");

				);

$plugins->run_hooks("admin_forum_announcements_edit_commit");

Zeile 569Zeile 570
	$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']);


	if($errors)

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

	{

	{

		$page->output_inline_error($errors);





		// Only show errors if we have any
if($errors)
{
$page->output_inline_error($errors);
}


// Gather start and end date data
$startday = $mybb->input['starttime_day'];


// Gather start and end date data
$startday = $mybb->input['starttime_day'];

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


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


		$start_time = explode("-", gmdate("g-i-a", $announcement['startdate']));
$mybb->input['starttime_time'] = $start_time[0].":".$start_time[1]." ".$start_time[2];

		$mybb->input['starttime_time'] = gmdate( $mybb->settings['timeformat'], $announcement['startdate']);



$startday = gmdate("j", $announcement['startdate']);



$startday = gmdate("j", $announcement['startdate']);


Zeile 627Zeile 631

$mybb->input['title'] = $announcement['subject'];
$mybb->input['message'] = $announcement['message'];


$mybb->input['title'] = $announcement['subject'];
$mybb->input['message'] = $announcement['message'];

		$mybb->input['allowhtml'] = $announcement['allowhtml'];

		$mybb->input['allowhtml'] = $mybb->settings['announcementshtml'] && $announcement['allowhtml'];

		$mybb->input['allowsmilies'] = $announcement['allowsmilies'];
$mybb->input['allowmycode'] = $announcement['allowmycode'];
$mybb->input['fid'] = $announcement['fid'];

		$mybb->input['allowsmilies'] = $announcement['allowsmilies'];
$mybb->input['allowmycode'] = $announcement['allowmycode'];
$mybb->input['fid'] = $announcement['fid'];

Zeile 637Zeile 641
			$endtime_checked[1] = "checked=\"checked\"";
$endtime_checked[2] = "";


			$endtime_checked[1] = "checked=\"checked\"";
$endtime_checked[2] = "";


			$end_time = explode("-", gmdate("g-i-a", $announcement['enddate']));
$mybb->input['endtime_time'] = $end_time[0].":".$end_time[1]." ".$end_time[2];

			$mybb->input['endtime_time'] = gmdate( $mybb->settings['timeformat'],$announcement['enddate']);



$endday = gmdate("j", $announcement['enddate']);



$endday = gmdate("j", $announcement['enddate']);


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

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

		}

		}

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

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

	}


	}


	$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";

	$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";

Zeile 715Zeile 718
	$form_container = new FormContainer($lang->add_an_announcement);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->start_date." <em>*</em>", $lang->start_date_desc, "<select name=\"starttime_day\">\n{$startdateday}</select>\n &nbsp; \n<select name=\"starttime_month\">\n{$startdatemonth}</select>\n &nbsp; \n<input type=\"text\" name=\"starttime_year\" value=\"{$startdateyear}\" size=\"4\" maxlength=\"4\" class=\"text_input\" />\n - {$lang->time} ".$form->generate_text_box('starttime_time', $mybb->input['starttime_time'], array('id' => 'starttime_time', 'style' => 'width: 50px;')));

	$form_container = new FormContainer($lang->add_an_announcement);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->start_date." <em>*</em>", $lang->start_date_desc, "<select name=\"starttime_day\">\n{$startdateday}</select>\n &nbsp; \n<select name=\"starttime_month\">\n{$startdatemonth}</select>\n &nbsp; \n<input type=\"text\" name=\"starttime_year\" value=\"{$startdateyear}\" size=\"4\" maxlength=\"4\" class=\"text_input\" />\n - {$lang->time} ".$form->generate_text_box('starttime_time', $mybb->input['starttime_time'], array('id' => 'starttime_time', 'style' => 'width: 50px;')));





	$actions = "<script type=\"text/javascript\">
function checkAction(id)
{

	$actions = "<script type=\"text/javascript\">
function checkAction(id)
{

Zeile 736Zeile 739
		{
$('#'+id+'_'+checked).show();
}

		{
$('#'+id+'_'+checked).show();
}

	}

	}

</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"endtime_type\" value=\"1\" {$endtime_checked[1]} class=\"endtimes_check\" onclick=\"checkAction('endtime');\" style=\"vertical-align: middle;\" /> <strong>{$lang->set_time}</strong></label></dt>

</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"endtime_type\" value=\"1\" {$endtime_checked[1]} class=\"endtimes_check\" onclick=\"checkAction('endtime');\" style=\"vertical-align: middle;\" /> <strong>{$lang->set_time}</strong></label></dt>

Zeile 758Zeile 761

$form_container->output_row($lang->forums_to_appear_in." <em>*</em>", $lang->forums_to_appear_in_desc, $form->generate_forum_select('fid', $mybb->input['fid'], array('size' => 5, 'main_option' => $lang->all_forums)));



$form_container->output_row($lang->forums_to_appear_in." <em>*</em>", $lang->forums_to_appear_in_desc, $form->generate_forum_select('fid', $mybb->input['fid'], array('size' => 5, 'main_option' => $lang->all_forums)));


	$form_container->output_row($lang->allow_html." <em>*</em>", "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml'], array('style' => 'width: 2em;')));




	if ($mybb->settings['announcementshtml'])
{
$form_container->output_row($lang->allow_html." <em>*</em>", "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml'], array('style' => 'width: 2em;')));
}


$form_container->output_row($lang->allow_mycode." <em>*</em>", "", $form->generate_yes_no_radio('allowmycode', $mybb->input['allowmycode'], array('style' => 'width: 2em;')));



$form_container->output_row($lang->allow_mycode." <em>*</em>", "", $form->generate_yes_no_radio('allowmycode', $mybb->input['allowmycode'], array('style' => 'width: 2em;')));


Zeile 877Zeile 883
	$page->output_footer();
}


	$page->output_footer();
}


 
/**
* @param DefaultTable $table
* @param int $pid
* @param int $depth
*/

function fetch_forum_announcements(&$table, $pid=0, $depth=1)
{
global $mybb, $db, $lang, $announcements, $page;

function fetch_forum_announcements(&$table, $pid=0, $depth=1)
{
global $mybb, $db, $lang, $announcements, $page;