Vergleich admin/modules/forum/announcements.php - 1.6.1 - 1.6.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: announcements.php 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

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


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


		if(!$errors)
{
$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";
}
}

$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

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

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














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

$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)
{
$errors[] = $lang->error_invalid_start_date;
}

if($mybb->input['endtime_type'] == "2")
{
$enddate = '0';
}
else
{
if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}
$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)
{
$errors[] = $lang->error_invalid_end_date;

			}

			}

			else

			if($enddate <= $startdate)

			{

			{

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

				$errors[] = $lang->error_end_before_start;





			}

			}

			




		}

if(!$errors)
{

			$insert_announcement = array(
"fid" => $mybb->input['fid'],
"uid" => $mybb->user['uid'],

			$insert_announcement = array(
"fid" => $mybb->input['fid'],
"uid" => $mybb->user['uid'],

Zeile 126Zeile 138
				"allowmycode" => $db->escape_string($mybb->input['allowmycode']),
"allowsmilies" => $db->escape_string($mybb->input['allowsmilies']),
);

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

	

	

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

$plugins->run_hooks("admin_forum_announcements_add_commit");

// Log admin action
log_admin_action($aid, $mybb->input['title']);

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

$plugins->run_hooks("admin_forum_announcements_add_commit");

// Log admin action
log_admin_action($aid, $mybb->input['title']);

 
			$cache->update_forumsdisplay();

	
flash_message($lang->success_added_announcement, 'success');
admin_redirect("index.php?module=forum-announcements");

	
flash_message($lang->success_added_announcement, 'success');
admin_redirect("index.php?module=forum-announcements");

 
		}
else
{
$mybb->input['action'] = 'add';

		}
}


		}
}


Zeile 148Zeile 165
	{
$page->output_inline_error($errors);
}

	{
$page->output_inline_error($errors);
}

	




























$default_options = array(
'starttime_time',
'starttime_day',
'starttime_month',
'starttime_year',
'endtime_type',
'endtime_time',
'endtime_day',
'endtime_month',
'endtime_year',
'title',
'message',
'fid',
'allowhtml',
'allowmycode',
'allowsmilies'
);

foreach($default_options as $option)
{
if(!isset($mybb->input[$option]))
{
$mybb->input[$option] = '';
}
}


	if($mybb->input['endtime_type'] == "1")
{
$endtime_checked[1] = "checked=\"checked\"";

	if($mybb->input['endtime_type'] == "1")
{
$endtime_checked[1] = "checked=\"checked\"";

Zeile 189Zeile 232
	{
$endday = gmdate("j", TIME_NOW);
}

	{
$endday = gmdate("j", TIME_NOW);
}

	





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

// Days

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

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

		{

		{

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

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

		}

		}

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

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

		}

		}

		
if($endday == $i)
{

		
if($endday == $i)
{

Zeile 210Zeile 256
			$enddateday .= "<option value=\"$i\">$i</option>\n";
}
}

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

	








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


	if($mybb->input['starttime_month'])
{
$startmonth = intval($mybb->input['starttime_month']);

	if($mybb->input['starttime_month'])
{
$startmonth = intval($mybb->input['starttime_month']);

Zeile 225Zeile 277
	if($mybb->input['endtime_month'])
{
$endmonth = intval($mybb->input['endtime_month']);

	if($mybb->input['endtime_month'])
{
$endmonth = intval($mybb->input['endtime_month']);

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

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

	else
{
$endmonth = gmdate("m", TIME_NOW);
$endmonthsel[$endmonth] = "selected=\"selected\"";

	else
{
$endmonth = gmdate("m", TIME_NOW);
$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=\"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";
$enddatemonth .= "<option value=\"11\" {$endmonthsel['11']}>{$lang->november}</option>\n";
$startdatemonth .= "<option value=\"12\" {$startmonthsel['12']}>{$lang->december}</option>\n";
$enddatemonth .= "<option value=\"12\" {$endmonthsel['12']}>{$lang->december}</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";
$enddatemonth .= "<option value=\"11\" {$endmonthsel[11]}>{$lang->november}</option>\n";
$startdatemonth .= "<option value=\"12\" {$startmonthsel[12]}>{$lang->december}</option>\n";
$enddatemonth .= "<option value=\"12\" {$endmonthsel[12]}>{$lang->december}</option>\n";

	
if($mybb->input['starttime_year'])
{
$startdateyear = intval($mybb->input['starttime_year']);

	
if($mybb->input['starttime_year'])
{
$startdateyear = intval($mybb->input['starttime_year']);

	}

	}

	else

	else

	{

	{

		$startdateyear = gmdate("Y", TIME_NOW);
}

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

		$startdateyear = gmdate("Y", TIME_NOW);
}

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

	{

	{

		$enddateyear = intval($mybb->input['endtime_year']);
}
else

		$enddateyear = intval($mybb->input['endtime_year']);
}
else

Zeile 308Zeile 360
			<table cellpadding=\"4\">
<tr>
<td><select name=\"endtime_day\">\n{$enddateday}</select>\n &nbsp; \n<select name=\"endtime_month\">\n{$enddatemonth}</select>\n &nbsp; \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', $mybb->input['endtime_time'], array('id' => 'endtime_time', 'style' => 'width: 50px;'))."</td>

			<table cellpadding=\"4\">
<tr>
<td><select name=\"endtime_day\">\n{$enddateday}</select>\n &nbsp; \n<select name=\"endtime_month\">\n{$enddatemonth}</select>\n &nbsp; \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', $mybb->input['endtime_time'], array('id' => 'endtime_time', 'style' => 'width: 50px;'))."</td>

				</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"endtime_type\" value=\"2\" {$endtime_checked[2]} class=\"endtimes_check\" onclick=\"checkAction('endtime');\" style=\"vertical-align: middle;\" /> <strong>{$lang->never}</strong></label></dt>
</dl>
<script type=\"text/javascript\">
checkAction('endtime');
</script>";
$form_container->output_row($lang->end_date." <em>*</em>", $lang->end_date_desc, $actions);

$form_container->output_row($lang->message." <em>*</em>", "", $form->generate_text_area('message', $mybb->input['message'], array('id' => 'message')), 'message');

$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;')));

$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_smilies." <em>*</em>", "", $form->generate_yes_no_radio('allowsmilies', $mybb->input['allowsmilies'], array('style' => 'width: 2em;')));

$form_container->end();

				</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"endtime_type\" value=\"2\" {$endtime_checked[2]} class=\"endtimes_check\" onclick=\"checkAction('endtime');\" style=\"vertical-align: middle;\" /> <strong>{$lang->never}</strong></label></dt>
</dl>
<script type=\"text/javascript\">
checkAction('endtime');
</script>";
$form_container->output_row($lang->end_date." <em>*</em>", $lang->end_date_desc, $actions);

$form_container->output_row($lang->message." <em>*</em>", "", $form->generate_text_area('message', $mybb->input['message'], array('id' => 'message')), 'message');

$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;')));

$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_smilies." <em>*</em>", "", $form->generate_yes_no_radio('allowsmilies', $mybb->input['allowsmilies'], array('style' => 'width: 2em;')));

$form_container->end();


$buttons[] = $form->generate_submit_button($lang->save_announcement);
$form->output_submit_wrapper($buttons);


$buttons[] = $form->generate_submit_button($lang->save_announcement);
$form->output_submit_wrapper($buttons);

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

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

		}


		}


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

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

		{

		{

			$errors[] = $lang->error_missing_forum;

			$errors[] = $lang->error_missing_forum;

		}






























		}

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

$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))
{
$mybb->input['starttime_month'] = 1;
}

		

		

		if(!$errors)


		$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year']));
if(!checkdate(intval($mybb->input['starttime_month']), intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])) || $startdate < 0 || $startdate == false)

		{

		{

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

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



		

		

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

$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
if(!in_array($mybb->input['starttime_month'], $months))

		if($mybb->input['endtime_type'] == "2")
{
$enddate = '0';
}
else
{
if(!in_array($mybb->input['endtime_month'], $months))
{
$mybb->input['endtime_month'] = 1;
}
$enddate = gmmktime(intval($enddate[0]), intval($enddate[1]), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year']));
if(!checkdate(intval($mybb->input['endtime_month']), intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])) || $enddate < 0 || $enddate == false)









			{

			{

				$mybb->input['starttime_month'] = 1;

				$errors[] = $lang->error_invalid_end_date;

			}


			}


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

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

			if($enddate <= $startdate)



			{

			{

				$enddate = '0';

				$errors[] = $lang->error_end_before_start;

			}

			}

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


		}

if(!$errors)
{






			$update_announcement = array(
"fid" => $mybb->input['fid'],
"subject" => $db->escape_string($mybb->input['title']),

			$update_announcement = array(
"fid" => $mybb->input['fid'],
"subject" => $db->escape_string($mybb->input['title']),

Zeile 427Zeile 492
	
// Log admin action
log_admin_action($mybb->input['aid'], $mybb->input['title']);

	
// Log admin action
log_admin_action($mybb->input['aid'], $mybb->input['title']);

 
			$cache->update_forumsdisplay();

	
flash_message($lang->success_updated_announcement, 'success');
admin_redirect("index.php?module=forum-announcements");

	
flash_message($lang->success_updated_announcement, 'success');
admin_redirect("index.php?module=forum-announcements");

 
		}
else
{
$mybb->input['action'] = 'edit';

		}
}


		}
}


Zeile 443Zeile 513
	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

 

// Gather start and end date data
$startday = $mybb->input['starttime_day'];
$start_time = $mybb->input['starttime_time'];
$startmonth = $mybb->input['starttime_month'];
$startmonthsel[$startmonth] = 'selected="selected"';
$startdateyear = $mybb->input['starttime_year'];

if($mybb->input['endtime_type'] == 1)
{
// Set time
$endtime_checked[1] = 'checked="checked"';
$endtime_checked[2] = '';

$endday = $mybb->input['endtime_day'];
$endtime = $mybb->input['endtime_time'];
$endmonth = $mybb->input['endtime_month'];
$endmonthsel[$endmonth] = 'selected';
$enddateyear = $mybb->input['endtime_year'];
}
else
{
// Never
$endtime_checked[1] = '';
$endtime_checked[2] = 'checked="checked"';

$endday = $startday;
$endmonth = $startmonth;
$endmonthsel[$endmonth] = 'selected';
$enddateyear = $startdateyear + 1;
}

	}
else
{

	}
else
{

Zeile 450Zeile 551
		$announcement = $db->fetch_array($query);

if(!$announcement)

		$announcement = $db->fetch_array($query);

if(!$announcement)

		{

		{

			flash_message($lang->error_invalid_announcement, 'error');
admin_redirect("index.php?module=forum-announcements");
}

			flash_message($lang->error_invalid_announcement, 'error');
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];

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

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

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

		

		

		$startmonth = gmdate("m", $announcement['startdate']);
$startmonthsel[$startmonth] = "selected=\"selected\"";


		$startmonth = gmdate("m", $announcement['startdate']);
$startmonthsel[$startmonth] = "selected=\"selected\"";


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

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

			

			

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

$endmonth = gmdate("m", $announcement['enddate']);

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

$endmonth = gmdate("m", $announcement['enddate']);

Zeile 505Zeile 606
		{
$startdateday .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}

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

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

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

		
if($endday == $i)
{

		
if($endday == $i)
{

Zeile 634Zeile 735
		
// Log admin action
log_admin_action($announcement['aid'], $announcement['title']);

		
// Log admin action
log_admin_action($announcement['aid'], $announcement['title']);

 
		$cache->update_forumsdisplay();


flash_message($lang->success_announcement_deleted, 'success');
admin_redirect("index.php?module=forum-announcements");


flash_message($lang->success_announcement_deleted, 'success');
admin_redirect("index.php?module=forum-announcements");

Zeile 655Zeile 757
	$page->output_nav_tabs($sub_tabs, "forum_announcements");

// Fetch announcements into their proper arrays

	$page->output_nav_tabs($sub_tabs, "forum_announcements");

// Fetch announcements into their proper arrays

 
	$global_announcements = $announcements = array();

	$query = $db->simple_select("announcements", "aid, fid, subject, enddate");
while($announcement = $db->fetch_array($query))
{

	$query = $db->simple_select("announcements", "aid, fid, subject, enddate");
while($announcement = $db->fetch_array($query))
{

Zeile 664Zeile 767
			continue;
}
$announcements[$announcement['fid']][$announcement['aid']] = $announcement;

			continue;
}
$announcements[$announcement['fid']][$announcement['aid']] = $announcement;

	}

if($global_announcements)
{

	}

if(!empty($global_announcements))
{

		$table = new Table;
$table->construct_header($lang->announcement);
$table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 2, "width" => 150));

		$table = new Table;
$table->construct_header($lang->announcement);
$table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 2, "width" => 150));

Zeile 687Zeile 790
			$table->construct_cell($icon."<a href=\"index.php?module=forum-announcements&amp;action=edit&amp;aid={$aid}\">".htmlspecialchars_uni($announcement['subject'])."</a>");
$table->construct_cell("<a href=\"index.php?module=forum-announcements&amp;action=edit&amp;aid={$aid}\">{$lang->edit}</a>", array("class" => "align_center", "width" => 75));
$table->construct_cell("<a href=\"index.php?module=forum-announcements&amp;action=delete&amp;aid={$aid}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_announcement_deletion}')\">{$lang->delete}</a>", array("class" => "align_center", "width" => 75));

			$table->construct_cell($icon."<a href=\"index.php?module=forum-announcements&amp;action=edit&amp;aid={$aid}\">".htmlspecialchars_uni($announcement['subject'])."</a>");
$table->construct_cell("<a href=\"index.php?module=forum-announcements&amp;action=edit&amp;aid={$aid}\">{$lang->edit}</a>", array("class" => "align_center", "width" => 75));
$table->construct_cell("<a href=\"index.php?module=forum-announcements&amp;action=delete&amp;aid={$aid}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_announcement_deletion}')\">{$lang->delete}</a>", array("class" => "align_center", "width" => 75));

			$table->construct_row();

			$table->construct_row();

		}
$table->output($lang->global_announcements);
}

		}
$table->output($lang->global_announcements);
}

Zeile 739Zeile 842
			{
$forum['name'] = "<em>".$forum['name']."</em>";
}

			{
$forum['name'] = "<em>".$forum['name']."</em>";
}

			



			if($forum['type'] == "c")
{
$forum['name'] = "<strong>".$forum['name']."</strong>";
}

			if($forum['type'] == "c")
{
$forum['name'] = "<strong>".$forum['name']."</strong>";
}

				



			$table->construct_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\">{$forum['name']}</div>");
$table->construct_cell("<a href=\"index.php?module=forum-announcements&amp;action=add&amp;fid={$forum['fid']}\">{$lang->add_announcement}</a>", array("class" => "align_center", "colspan" => 2));
$table->construct_row();

			$table->construct_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\">{$forum['name']}</div>");
$table->construct_cell("<a href=\"index.php?module=forum-announcements&amp;action=add&amp;fid={$forum['fid']}\">{$lang->add_announcement}</a>", array("class" => "align_center", "colspan" => 2));
$table->construct_row();

				
if($announcements[$forum['fid']])


if(isset($announcements[$forum['fid']]))

			{
foreach($announcements[$forum['fid']] as $aid => $announcement)
{

			{
foreach($announcements[$forum['fid']] as $aid => $announcement)
{

Zeile 770Zeile 873
			}

// Build the list for any sub forums of this forum

			}

// Build the list for any sub forums of this forum

			if($forums_by_parent[$forum['fid']])

			if(isset($forums_by_parent[$forum['fid']]))

			{
fetch_forum_announcements($table, $forum['fid'], $depth+1);
}

			{
fetch_forum_announcements($table, $forum['fid'], $depth+1);
}