Vergleich admin/modules/forum/management.php - 1.6.10 - 1.6.18

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

if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action'])
{


if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action'])
{

	if(isset($mybb->input['fid']) && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))

	if(!empty($mybb->input['fid']) && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))

	{
$sub_tabs['view_forum'] = array(
'title' => $lang->view_forum,

	{
$sub_tabs['view_forum'] = array(
'title' => $lang->view_forum,

Zeile 236Zeile 236
	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

		$usergroups[$usergroup['gid']] = $usergroup['title'];

		$usergroups[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}

$form_container = new FormContainer($lang->copy_forum);

	}

$form_container = new FormContainer($lang->copy_forum);

Zeile 299Zeile 299
			$forum = get_forum($fid);
if($mod_data['isgroup'])
{

			$forum = get_forum($fid);
if($mod_data['isgroup'])
{

				$mod = $mybb->usergroups[$mod_data['id']];

				$mod = $groupscache[$mod_data['id']];

			}
else
{

			}
else
{

Zeile 447Zeile 447
			$result = $db->fetch_array($query);
$fid = $result['fid'];
$gid = $result['gid'];

			$result = $db->fetch_array($query);
$fid = $result['fid'];
$gid = $result['gid'];

 
			$forum = get_forum($fid);

		}

$field_list = array();

		}

$field_list = array();

Zeile 466Zeile 467
					{
$update_array[$db->escape_string($field['Field'])] = 0;
}

					{
$update_array[$db->escape_string($field['Field'])] = 0;
}

				}
}
}
else

				}
}
}
else

		{
// Else, we assume that the group has no permissions...
foreach($fields_array as $field)

		{
// Else, we assume that the group has no permissions...
foreach($fields_array as $field)

Zeile 514Zeile 515
	if($mybb->input['ajax'] != 1)
{
$sub_tabs = array();

	if($mybb->input['ajax'] != 1)
{
$sub_tabs = array();

		

		

		if($mybb->input['fid'] && $mybb->input['gid'])
{
$sub_tabs['edit_permissions'] = array(

		if($mybb->input['fid'] && $mybb->input['gid'])
{
$sub_tabs['edit_permissions'] = array(

Zeile 559Zeile 560
			$form = new Form("#", "post", "modal_form");
}
echo $form->generate_hidden_field("usecustom", "1");

			$form = new Form("#", "post", "modal_form");
}
echo $form->generate_hidden_field("usecustom", "1");

		

		

		if($errors)

		if($errors)

		{

		{

			$page->output_inline_error($errors);
$permission_data = $mybb->input;

			$page->output_inline_error($errors);
$permission_data = $mybb->input;

			

			

			$query = $db->simple_select("usergroups", "*", "gid='{$permission_data['gid']}'");
$usergroup = $db->fetch_array($query);


			$query = $db->simple_select("usergroups", "*", "gid='{$permission_data['gid']}'");
$usergroup = $db->fetch_array($query);


Zeile 580Zeile 581
			if($pid)
{
$query = $db->simple_select("forumpermissions", "*", "pid='{$pid}'");

			if($pid)
{
$query = $db->simple_select("forumpermissions", "*", "pid='{$pid}'");

			}
else

			}
else

			{
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}' AND gid='{$gid}'", array('limit' => 1));
}

			{
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}' AND gid='{$gid}'", array('limit' => 1));
}

Zeile 627Zeile 628
				if(!$customperms['pid'])
{
$permission_data = usergroup_permissions($gid);

				if(!$customperms['pid'])
{
$permission_data = usergroup_permissions($gid);

				}
else
{

				}
else
{

					$permission_data = forum_permissions($fid, 0, $gid);
}
}

					$permission_data = forum_permissions($fid, 0, $gid);
}
}

Zeile 668Zeile 669
		if($mybb->input['ajax'] == 1)
{
$page->output_tab_control($tabs, false, "tabs2");

		if($mybb->input['ajax'] == 1)
{
$page->output_tab_control($tabs, false, "tabs2");

		}
else
{

		}
else
{

			$page->output_tab_control($tabs);
}


			$page->output_tab_control($tabs);
}


Zeile 712Zeile 713
			echo "</div><div class=\"ModalButtonRow\">";
$buttons[] = $form->generate_submit_button($lang->cancel, array('id' => 'modalCancel'));
$buttons[] = $form->generate_submit_button($lang->save_permissions, array('id' => 'modalSubmit'));

			echo "</div><div class=\"ModalButtonRow\">";
$buttons[] = $form->generate_submit_button($lang->cancel, array('id' => 'modalCancel'));
$buttons[] = $form->generate_submit_button($lang->save_permissions, array('id' => 'modalSubmit'));

			$form->output_submit_wrapper($buttons);
echo "</div>";

			$form->output_submit_wrapper($buttons);
echo "</div>";

			$form->end();
echo "</div>";
}

			$form->end();
echo "</div>";
}

Zeile 800Zeile 801
			foreach($mybb->input as $id => $permission)
{
if(strpos($id, 'fields_') === false)

			foreach($mybb->input as $id => $permission)
{
if(strpos($id, 'fields_') === false)

				{
continue;
}

list(, $gid) = explode('fields_', $id);

// If it isn't an array then it came from the javascript form
if(!is_array($permission))
{
$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)
{
$permission[$name] = 1;

				{
continue;
}

list(, $gid) = explode('fields_', $id);

// If it isn't an array then it came from the javascript form
if(!is_array($permission))
{
$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)
{
$permission[$name] = 1;

					}
}

foreach(array('canview','canpostthreads','canpostreplys','canpostpolls') as $name)
{
if(in_array($name, $permission) || $permission[$name])

					}
}

foreach(array('canview','canpostthreads','canpostreplys','canpostpolls') as $name)
{
if(in_array($name, $permission) || $permission[$name])

					{

					{

						$permissions[$name][$gid] = 1;
}
else

						$permissions[$name][$gid] = 1;
}
else

Zeile 903Zeile 904
		$forum_data['allowtratings'] = 1;
$forum_data['showinjump'] = 1;
$forum_data['usepostcounts'] = 1;

		$forum_data['allowtratings'] = 1;
$forum_data['showinjump'] = 1;
$forum_data['usepostcounts'] = 1;

	}

	}

	
$types = array(
'f' => $lang->forum,
'c' => $lang->category

	
$types = array(
'f' => $lang->forum,
'c' => $lang->category

	);

	);

	
$create_a_options_f = array(
'id' => 'forum'

	
$create_a_options_f = array(
'id' => 'forum'

	);


	);


	$create_a_options_c = array(
'id' => 'category'
);

	$create_a_options_c = array(
'id' => 'category'
);

Zeile 923Zeile 924
		$create_a_options_f['checked'] = true;
}
else

		$create_a_options_f['checked'] = true;
}
else

	{

	{

		$create_a_options_c['checked'] = true;
}


		$create_a_options_c['checked'] = true;
}


Zeile 934Zeile 935
	$form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $forum_data['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->end();

	$form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $forum_data['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->end();

	

	

	echo "<div id=\"additional_options_link\"><strong><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->show_additional_options}</a></strong><br /><br /></div>";
echo "<div id=\"additional_options\" style=\"display: none;\">";
$form_container = new FormContainer("<div class=\"float_right\" style=\"font-weight: normal;\"><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->hide_additional_options}</a></div>".$lang->additional_forum_options);

	echo "<div id=\"additional_options_link\"><strong><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->show_additional_options}</a></strong><br /><br /></div>";
echo "<div id=\"additional_options\" style=\"display: none;\">";
$form_container = new FormContainer("<div class=\"float_right\" style=\"font-weight: normal;\"><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->hide_additional_options}</a></div>".$lang->additional_forum_options);

Zeile 944Zeile 945
	$access_options = array(
$form->generate_check_box('active', 1, $lang->forum_is_active."<br />\n<small>{$lang->forum_is_active_desc}</small>", array('checked' => $forum_data['active'], 'id' => 'active')),
$form->generate_check_box('open', 1, $lang->forum_is_open."<br />\n<small>{$lang->forum_is_open_desc}</small>", array('checked' => $forum_data['open'], 'id' => 'open'))

	$access_options = array(
$form->generate_check_box('active', 1, $lang->forum_is_active."<br />\n<small>{$lang->forum_is_active_desc}</small>", array('checked' => $forum_data['active'], 'id' => 'active')),
$form->generate_check_box('open', 1, $lang->forum_is_open."<br />\n<small>{$lang->forum_is_open_desc}</small>", array('checked' => $forum_data['open'], 'id' => 'open'))

	);

	);

	
$form_container->output_row($lang->access_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $access_options)."</div>");

	
$form_container->output_row($lang->access_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $access_options)."</div>");

	

	

	$moderator_options = array(
$form->generate_check_box('modposts', 1, $lang->mod_new_posts, array('checked' => $forum_data['modposts'], 'id' => 'modposts')),
$form->generate_check_box('modthreads', 1, $lang->mod_new_threads, array('checked' => $forum_data['modthreads'], 'id' => 'modthreads')),
$form->generate_check_box('modattachments', 1, $lang->mod_new_attachments, array('checked' => $forum_data['modattachments'], 'id' => 'modattachments')),
$form->generate_check_box('mod_edit_posts', 1, $lang->mod_after_edit, array('checked' => $forum_data['mod_edit_posts'], 'id' => 'mod_edit_posts'))

	$moderator_options = array(
$form->generate_check_box('modposts', 1, $lang->mod_new_posts, array('checked' => $forum_data['modposts'], 'id' => 'modposts')),
$form->generate_check_box('modthreads', 1, $lang->mod_new_threads, array('checked' => $forum_data['modthreads'], 'id' => 'modthreads')),
$form->generate_check_box('modattachments', 1, $lang->mod_new_attachments, array('checked' => $forum_data['modattachments'], 'id' => 'modattachments')),
$form->generate_check_box('mod_edit_posts', 1, $lang->mod_after_edit, array('checked' => $forum_data['mod_edit_posts'], 'id' => 'mod_edit_posts'))

	);


	);


	$form_container->output_row($lang->moderation_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_options)."</div>");

$styles = array(
'0' => $lang->use_default

	$form_container->output_row($lang->moderation_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_options)."</div>");

$styles = array(
'0' => $lang->use_default

	);

	);

	
$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name'));
while($style = $db->fetch_array($query))
{
$styles[$style['tid']] = htmlspecialchars_uni($style['name']);

	
$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name'));
while($style = $db->fetch_array($query))
{
$styles[$style['tid']] = htmlspecialchars_uni($style['name']);

	}

$style_options = array(
$form->generate_check_box('overridestyle', 1, $lang->override_user_style, array('checked' => $forum_data['overridestyle'], 'id' => 'overridestyle')),
$lang->forum_specific_style."<br />\n".$form->generate_select_box('style', $styles, $forum_data['style'], array('id' => 'style'))
);

$form_container->output_row($lang->style_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $style_options)."</div>");

$display_methods = array(
'0' => $lang->dont_display_rules,
'1' => $lang->display_rules_inline,
'3' => $lang->display_rules_inline_new,
'2' => $lang->display_rules_link
);

$forum_rules = array(
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
$lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')),
$lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))
);

$form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>");

$default_date_cut = array(
0 => $lang->board_default,
1 => $lang->datelimit_1day,
5 => $lang->datelimit_5days,
10 => $lang->datelimit_10days,
20 => $lang->datelimit_20days,
50 => $lang->datelimit_50days,
75 => $lang->datelimit_75days,
100 => $lang->datelimit_100days,

	}

$style_options = array(
$form->generate_check_box('overridestyle', 1, $lang->override_user_style, array('checked' => $forum_data['overridestyle'], 'id' => 'overridestyle')),
$lang->forum_specific_style."<br />\n".$form->generate_select_box('style', $styles, $forum_data['style'], array('id' => 'style'))
);

$form_container->output_row($lang->style_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $style_options)."</div>");

$display_methods = array(
'0' => $lang->dont_display_rules,
'1' => $lang->display_rules_inline,
'3' => $lang->display_rules_inline_new,
'2' => $lang->display_rules_link
);

$forum_rules = array(
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
$lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')),
$lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))
);

$form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>");

$default_date_cut = array(
0 => $lang->board_default,
1 => $lang->datelimit_1day,
5 => $lang->datelimit_5days,
10 => $lang->datelimit_10days,
20 => $lang->datelimit_20days,
50 => $lang->datelimit_50days,
75 => $lang->datelimit_75days,
100 => $lang->datelimit_100days,

		365 => $lang->datelimit_lastyear,
9999 => $lang->datelimit_beginning,
);

		365 => $lang->datelimit_lastyear,
9999 => $lang->datelimit_beginning,
);

Zeile 1043Zeile 1044
	$form_container->end();
echo "</div>";


	$form_container->end();
echo "</div>";


	$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));

	$query = $db->simple_select("usergroups", "*", "", array("order" => "name"));

	while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

	while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

Zeile 1133Zeile 1134
				}

if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])

				}

if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])

				{
$perms_checked[$forum_permission] = 1;
}
else

				{
$perms_checked[$forum_permission] = 1;
}
else

				{
$perms_checked[$forum_permission] = 0;
}

				{
$perms_checked[$forum_permission] = 0;
}

Zeile 1177Zeile 1178
		}
$field_select .= "</ul></div>\n";
$field_select .= "<div class=\"disabled\"><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";

		}
$field_select .= "</ul></div>\n";
$field_select .= "<div class=\"disabled\"><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";

		foreach($perms_checked as $perm => $value)
{
if($value == 0)
{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
}

		foreach($perms_checked as $perm => $value)
{
if($value == 0)
{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
}

		}
$field_select .= "</ul></div></div>\n";
$field_select .= $form->generate_hidden_field("fields_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_'.$usergroup['gid']));

		}
$field_select .= "</ul></div></div>\n";
$field_select .= $form->generate_hidden_field("fields_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_'.$usergroup['gid']));

Zeile 1221Zeile 1222
	// Write in our JS based field selector
echo "<script type=\"text/javascript\">\n<!--\n";
foreach($ids as $id)

	// Write in our JS based field selector
echo "<script type=\"text/javascript\">\n<!--\n";
foreach($ids as $id)

	{

	{

		echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id.") });\n";
}
echo "// -->\n</script>\n";

		echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id.") });\n";
}
echo "// -->\n</script>\n";

Zeile 1266Zeile 1267
		{
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'");
while($child = $db->fetch_array($query))

		{
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'");
while($child = $db->fetch_array($query))

			{

			{

				if($child['fid'] == $pid)
{
$errors[] = $lang->error_forum_parent_child;

				if($child['fid'] == $pid)
{
$errors[] = $lang->error_forum_parent_child;

Zeile 1288Zeile 1289
			if($db->fetch_field($query, "num_threads") > 0)
{
$errors[] = $lang->error_not_empty;

			if($db->fetch_field($query, "num_threads") > 0)
{
$errors[] = $lang->error_not_empty;

			}










			}
}

if(!empty($mybb->input['linkto']) && empty($forum_data['linkto']))
{
$query = $db->simple_select('threads', 'COUNT(tid) as num_threads', "fid = '{$fid}'", array("limit" => 1));
if($db->fetch_field($query, "num_threads") > 0)
{
$errors[] = $lang->error_forum_link_not_empty;
}

		}

		}

 


		
if(!$errors)
{

		
if(!$errors)
{

Zeile 1333Zeile 1344
			if($pid != $forum_data['pid'])
{
// Update the parentlist of this forum.

			if($pid != $forum_data['pid'])
{
// Update the parentlist of this forum.

				$db->update_query("forums", array("parentlist" => make_parent_list($fid)), "fid='{$fid}'", 1);


				$db->update_query("forums", array("parentlist" => make_parent_list($fid)), "fid='{$fid}'");


				// Rebuild the parentlist of all of the subforums of this forum
switch($db->type)

				// Rebuild the parentlist of all of the subforums of this forum
switch($db->type)

				{

				{

					case "sqlite":
case "pgsql":
$query = $db->simple_select("forums", "fid", "','||parentlist||',' LIKE '%,$fid,%'");

					case "sqlite":
case "pgsql":
$query = $db->simple_select("forums", "fid", "','||parentlist||',' LIKE '%,$fid,%'");

Zeile 1345Zeile 1356
					default:
$query = $db->simple_select("forums", "fid", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'");
}

					default:
$query = $db->simple_select("forums", "fid", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'");
}

				
while($child = $db->fetch_array($query))
{
$db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1);
}

				
while($child = $db->fetch_array($query))
{
$db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'");
}

			}

$inherit = $mybb->input['default_permissions'];

			}

$inherit = $mybb->input['default_permissions'];

Zeile 1358Zeile 1369
			{
// Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_
if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))

			{
// Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_
if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))

				{
continue;
}


				{
continue;
}


				list(, $gid) = explode('fields_', $id);

if($mybb->input['fields_default_'.$gid] == $permission && $mybb->input['fields_inherit_'.$gid] == 1)

				list(, $gid) = explode('fields_', $id);

if($mybb->input['fields_default_'.$gid] == $permission && $mybb->input['fields_inherit_'.$gid] == 1)

Zeile 1438Zeile 1449
		$forum_data['title'] = $forum_data['name'];
}


		$forum_data['title'] = $forum_data['name'];
}


	$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));

	$query = $db->simple_select("usergroups", "*", "", array("order" => "name"));

	while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

	while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

Zeile 1453Zeile 1464
	$types = array(
'f' => $lang->forum,
'c' => $lang->category

	$types = array(
'f' => $lang->forum,
'c' => $lang->category

	);


	);


	$create_a_options_f = array(
'id' => 'forum'
);

	$create_a_options_f = array(
'id' => 'forum'
);

Zeile 1522Zeile 1533
		'1' => $lang->display_rules_inline,
'3' => $lang->display_rules_inline_new,
'2' => $lang->display_rules_link

		'1' => $lang->display_rules_inline,
'3' => $lang->display_rules_inline_new,
'2' => $lang->display_rules_link

	);


	);


	$forum_rules = array(
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
$lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')),
$lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))

	$forum_rules = array(
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
$lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')),
$lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))

	);


	);


	$form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>");

$default_date_cut = array(

	$form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>");

$default_date_cut = array(

Zeile 1546Zeile 1557
	);

$default_sort_by = array(

	);

$default_sort_by = array(

		"" => $lang->board_default,

		"" => $lang->board_default,

		"subject" => $lang->sort_by_subject,
"lastpost" => $lang->sort_by_lastpost,
"starter" => $lang->sort_by_starter,

		"subject" => $lang->sort_by_subject,
"lastpost" => $lang->sort_by_lastpost,
"starter" => $lang->sort_by_starter,

Zeile 1843Zeile 1854
		$mod = $db->fetch_array($query);

$db->delete_query("moderators", "mid='{$mid}'");

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

$db->delete_query("moderators", "mid='{$mid}'");

		$query = $db->simple_select("moderators", "*", "id='{$mod['id']}' AND isgroup='0'");
if($db->num_rows($query) == 0)
{
$updatequery = array(
"usergroup" => "2"
);
$db->update_query("users", $updatequery, "uid='{$mod['id']}' AND usergroup != '4' AND usergroup != '3'");
}

 
		$cache->update_moderators();

		$cache->update_moderators();

		

		

		$plugins->run_hooks("admin_forum_management_deletemod_commit");

		$plugins->run_hooks("admin_forum_management_deletemod_commit");

		

		

		$forum = get_forum($fid);

// Log admin action
if ($isgroup)

		$forum = get_forum($fid);

// Log admin action
if ($isgroup)

		{
log_admin_action($mod['id'], $mod['title'], $forum['fid'], $forum['name']);

		{
log_admin_action($mid, $mod['title'], $forum['fid'], $forum['name']);

		}
else
{

		}
else
{

			log_admin_action($mod['id'], $mod['username'], $forum['fid'], $forum['name']);

			log_admin_action($mid, $mod['username'], $forum['fid'], $forum['name']);

		}

flash_message($lang->success_moderator_deleted, 'success');

		}

flash_message($lang->success_moderator_deleted, 'success');

Zeile 1879Zeile 1882
if($mybb->input['action'] == "delete")
{
$plugins->run_hooks("admin_forum_management_delete");

if($mybb->input['action'] == "delete")
{
$plugins->run_hooks("admin_forum_management_delete");

	

	

	$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'");
$forum = $db->fetch_array($query);


	$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'");
$forum = $db->fetch_array($query);


Zeile 1887Zeile 1890
	if(!$forum['fid'])
{
flash_message($lang->error_invalid_forum, 'error');

	if(!$forum['fid'])
{
flash_message($lang->error_invalid_forum, 'error');

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

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


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


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

Zeile 1906Zeile 1909
		
// Delete the forum
$db->delete_query("forums", "fid='$fid'");

		
// Delete the forum
$db->delete_query("forums", "fid='$fid'");

		

		

		switch($db->type)
{
case "pgsql":

		switch($db->type)
{
case "pgsql":

Zeile 1925Zeile 1928
			$stats['unapprovedposts'] += $forum['unapprovedposts'];
$stats['threads'] += $forum['threads'];
$stats['unapprovedthreads'] += $forum['unapprovedthreads'];

			$stats['unapprovedposts'] += $forum['unapprovedposts'];
$stats['threads'] += $forum['threads'];
$stats['unapprovedthreads'] += $forum['unapprovedthreads'];

		}

/**
* This slab of code pulls out the moderators for this forum,
* checks if they moderate any other forums, and if they don't
* it moves them back to the registered usergroup
*/

$query = $db->simple_select("moderators", "*", "fid='$fid' AND isgroup='0'");
while($mod = $db->fetch_array($query))
{
$moderators[$mod['id']] = $mod['id'];
}

if(is_array($moderators))
{
$mod_list = implode(",", $moderators);
$query = $db->simple_select("moderators", "*", "fid != '$fid' AND id IN ($mod_list) AND isgroup='0'");
while($mod = $db->fetch_array($query))
{
unset($moderators[$mod['id']]);
}
}

if(is_array($moderators))
{
$mod_list = implode(",", $moderators);
if($mod_list)
{
$updatequery = array(
"usergroup" => "2"
);
$db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'");
}

 
		}

switch($db->type)

		}

switch($db->type)

Zeile 2149Zeile 2118
					$plugins->run_hooks("admin_forum_management_start_moderators_commit");

// Log admin action

					$plugins->run_hooks("admin_forum_management_start_moderators_commit");

// Log admin action

					log_admin_action('addmod', $new_mod['fid'], $newmod['name'], $fid, $forum['name']);

					log_admin_action('addmod', $mid, $newmod['name'], $fid, $forum['name']);

					
flash_message($lang->success_moderator_added, 'success');
admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");

					
flash_message($lang->success_moderator_added, 'success');
admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");

Zeile 2265Zeile 2234
		echo "</div>\n";
$form->end();


		echo "</div>\n";
$form->end();


		$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));

		$query = $db->simple_select("usergroups", "*", "", array("order" => "name"));

		while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

		while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

Zeile 2524Zeile 2493

foreach($usergroups as $group)
{


foreach($usergroups as $group)
{

			$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".$group['title'];

			$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".htmlspecialchars_uni($group['title']);

		}

if(!isset($mybb->input['usergroup']))

		}

if(!isset($mybb->input['usergroup']))