Vergleich admin/modules/forum/management.php - 1.6.9 - 1.6.12

  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($mybb->input['fid'] && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))

	if(isset($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 30Zeile 30
		$sub_tabs['add_child_forum'] = array(
'title' => $lang->add_child_forum,
'link' => "index.php?module=forum-management&action=add&pid=".$mybb->input['fid'],

		$sub_tabs['add_child_forum'] = array(
'title' => $lang->add_child_forum,
'link' => "index.php?module=forum-management&action=add&pid=".$mybb->input['fid'],

			'description' => $lang->add_child_forum_desc

			'description' => $lang->view_forum_desc

		);

$sub_tabs['edit_forum_settings'] = array(

		);

$sub_tabs['edit_forum_settings'] = array(

Zeile 185Zeile 185
	$form = new Form("index.php?module=forum-management&action=copy", "post");

if($errors)

	$form = new Form("index.php?module=forum-management&action=copy", "post");

if($errors)

	{

	{

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

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

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 341Zeile 341
	}

$sub_tabs = array();

	}

$sub_tabs = array();

	

	

	$sub_tabs['edit_mod'] = array(
'title' => $lang->edit_mod,
'link' => "index.php?module=forum-management&action=editmod&mid=".$mybb->input['mid'],

	$sub_tabs['edit_mod'] = array(
'title' => $lang->edit_mod,
'link' => "index.php?module=forum-management&action=editmod&mid=".$mybb->input['mid'],

Zeile 417Zeile 417
		else
{
$db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'");

		else
{
$db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'");

		}

$cache->update_forumpermissions();

		}

$cache->update_forumpermissions();

		
flash_message($lang->success_custom_permission_cleared, 'success');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions");

		
flash_message($lang->success_custom_permission_cleared, 'success');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions");

Zeile 454Zeile 454
		if(is_array($mybb->input['permissions']))
{
// User has set permissions for this group...

		if(is_array($mybb->input['permissions']))
{
// User has set permissions for this group...

			foreach($fields_array as $field)
{
if(strpos($field['Field'], 'can') !== false)
{

			foreach($fields_array as $field)
{
if(strpos($field['Field'], 'can') !== false)
{

					if(array_key_exists($field['Field'], $mybb->input['permissions']))
{
$update_array[$db->escape_string($field['Field'])] = intval($mybb->input['permissions'][$field['Field']]);

					if(array_key_exists($field['Field'], $mybb->input['permissions']))
{
$update_array[$db->escape_string($field['Field'])] = intval($mybb->input['permissions'][$field['Field']]);

Zeile 535Zeile 535
				'link' => "index.php?module=forum-management&action=permissions&pid=".intval($mybb->input['pid']),
'description' => $lang->forum_permissions_desc
);

				'link' => "index.php?module=forum-management&action=permissions&pid=".intval($mybb->input['pid']),
'description' => $lang->forum_permissions_desc
);

			

			

			$page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions");
}


			$page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions");
}


Zeile 650Zeile 650
			'candeleteposts' => 'editing',
'candeletethreads' => 'editing',
'caneditattachments' => 'editing',

			'candeleteposts' => 'editing',
'candeletethreads' => 'editing',
'caneditattachments' => 'editing',

			

			

			'canpostpolls' => 'polls',
'canvotepolls' => 'polls',
'cansearch' => 'misc',
);

			'canpostpolls' => 'polls',
'canvotepolls' => 'polls',
'cansearch' => 'misc',
);

		

		

		$groups = $plugins->run_hooks("admin_forum_management_permission_groups", $groups);

$tabs = array();

		$groups = $plugins->run_hooks("admin_forum_management_permission_groups", $groups);

$tabs = array();

Zeile 663Zeile 663
		{
$lang_group = "group_".$group;
$tabs[$group] = $lang->$lang_group;

		{
$lang_group = "group_".$group;
$tabs[$group] = $lang->$lang_group;

		}


		}


		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
{
$page->output_tab_control($tabs);

		else
{
$page->output_tab_control($tabs);

Zeile 687Zeile 687
				else
{
$field_list['misc'][] = $field['Field'];

				else
{
$field_list['misc'][] = $field['Field'];

				}

				}

			}
}


			}
}


Zeile 704Zeile 704
			}
$form_container->output_row("", "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $fields)."</div>");
$form_container->end();

			}
$form_container->output_row("", "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $fields)."</div>");
$form_container->end();

			echo "</div>";

			echo "</div>";

		}

if($mybb->input['ajax'] == 1)

		}

if($mybb->input['ajax'] == 1)

Zeile 712Zeile 712
			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 723Zeile 723
			$form->output_submit_wrapper($buttons);

$form->end();

			$form->output_submit_wrapper($buttons);

$form->end();

		}
}


		}
}


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

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

Zeile 953Zeile 953
		$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->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))
{

	$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']] = $style['name'];

		$styles[$style['tid']] = htmlspecialchars_uni($style['name']);

	}

$style_options = array(

	}

$style_options = array(

Zeile 1037Zeile 1037
		$form->generate_check_box('allowtratings', 1, $lang->allow_thread_ratings, array('checked' => $forum_data['allowtratings'], 'id' => 'allowtratings')),
$form->generate_check_box('showinjump', 1, $lang->show_forum_jump, array('checked' => $forum_data['showinjump'], 'id' => 'showinjump')),
$form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts'))

		$form->generate_check_box('allowtratings', 1, $lang->allow_thread_ratings, array('checked' => $forum_data['allowtratings'], 'id' => 'allowtratings')),
$form->generate_check_box('showinjump', 1, $lang->show_forum_jump, array('checked' => $forum_data['showinjump'], 'id' => 'showinjump')),
$form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts'))

	);


	);


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


	$form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</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 1094Zeile 1094
	foreach($usergroups as $usergroup)
{
$perms = array();

	foreach($usergroups as $usergroup)
{
$perms = array();

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

		if(isset($mybb->input['default_permissions']) && $mybb->input['default_permissions'][$usergroup['gid']])

		{
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{

		{
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{

Zeile 1117Zeile 1117
		{
$perms = $usergroup;
$default_checked = true;

		{
$perms = $usergroup;
$default_checked = true;

		}

		}

		
foreach($field_list as $forum_permission => $forum_perm_title)
{
if(isset($mybb->input['permissions']))

		
foreach($field_list as $forum_permission => $forum_perm_title)
{
if(isset($mybb->input['permissions']))

			{

			{

				if($mybb->input['default_permissions'][$usergroup['gid']])
{
$default_checked = true;

				if($mybb->input['default_permissions'][$usergroup['gid']])
{
$default_checked = true;

				}
else

				}
else

				{
$default_checked = false;
}

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

				{
$default_checked = false;
}

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 1156Zeile 1156
		$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);

if($default_checked)

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

if($default_checked)

		{

		{

			$inherited_text = $lang->inherited_permission;

			$inherited_text = $lang->inherited_permission;

		}

		}

		else

		else

		{

		{

			$inherited_text = $lang->custom_permission;

			$inherited_text = $lang->custom_permission;

		}

$form_container->output_cell("<strong>{$usergroup['title']}</strong><br />".$form->generate_check_box("default_permissions[{$usergroup['gid']}]", 1, "", array("id" => "default_permissions_{$usergroup['gid']}", "checked" => $default_checked, "onclick" => $default_click))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");

		}

$form_container->output_cell("<strong>{$usergroup['title']}</strong><br />".$form->generate_check_box("default_permissions[{$usergroup['gid']}]", 1, "", array("id" => "default_permissions_{$usergroup['gid']}", "checked" => $default_checked))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");

		
$field_select = "<div class=\"quick_perm_fields\">\n";

		
$field_select = "<div class=\"quick_perm_fields\">\n";

		$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";

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

		foreach($perms_checked as $perm => $value)
{
if($value == 1)

		foreach($perms_checked as $perm => $value)
{
if($value == 1)

Zeile 1176Zeile 1176
			}
}
$field_select .= "</ul></div>\n";

			}
}
$field_select .= "</ul></div>\n";

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

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

		foreach($perms_checked as $perm => $value)
{
if($value == 0)

		foreach($perms_checked as $perm => $value)
{
if($value == 0)

Zeile 1234Zeile 1234
	$plugins->run_hooks("admin_forum_management_edit");

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

	$plugins->run_hooks("admin_forum_management_edit");

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

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


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


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

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

Zeile 1252Zeile 1252
	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

		{

		{

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


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


Zeile 1271Zeile 1271
				{
$errors[] = $lang->error_forum_parent_child;
break;

				{
$errors[] = $lang->error_forum_parent_child;
break;

				}
}

				}
}

		}

$type = $mybb->input['type'];

		}

$type = $mybb->input['type'];

Zeile 1349Zeile 1349
				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']}'", 1);

				}
}

				}
}

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


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


Zeile 1427Zeile 1427
	
$form = new Form("index.php?module=forum-management&amp;action=edit", "post");
echo $form->generate_hidden_field("fid", $fid);

	
$form = new Form("index.php?module=forum-management&amp;action=edit", "post");
echo $form->generate_hidden_field("fid", $fid);





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

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

Zeile 1438Zeile 1438
		$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 1583Zeile 1583
	);

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

	);

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

	$form_container->end();

	$form_container->end();

	
$cached_forum_perms = $cache->read("forumpermissions");
$field_list = array(

	
$cached_forum_perms = $cache->read("forumpermissions");
$field_list = array(

Zeile 1616Zeile 1616
			{
$input_permissions = $mybb->input['fields_'.$usergroup['gid']];
if(!is_array($input_permissions))

			{
$input_permissions = $mybb->input['fields_'.$usergroup['gid']];
if(!is_array($input_permissions))

				{

				{

					// Convering the comma separated list from Javascript form into a variable
$input_permissions = explode(',' , $input_permissions);
}
foreach($input_permissions as $input_permission)

					// Convering the comma separated list from Javascript form into a variable
$input_permissions = explode(',' , $input_permissions);
}
foreach($input_permissions as $input_permission)

				{

				{

					$mybb->input['permissions'][$usergroup['gid']][$input_permission] = 1;

					$mybb->input['permissions'][$usergroup['gid']][$input_permission] = 1;

				}
}

				}
}

		}
}


		}
}


Zeile 1634Zeile 1634
		if(isset($mybb->input['default_permissions']))
{
if($mybb->input['default_permissions'][$usergroup['gid']])

		if(isset($mybb->input['default_permissions']))
{
if($mybb->input['default_permissions'][$usergroup['gid']])

			{

			{

				if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])

				if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])

				{

				{

					$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
$default_checked = true;
}

					$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
$default_checked = true;
}

Zeile 1649Zeile 1649
				{
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
$default_checked = true;

				{
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
$default_checked = true;

				}
}

if(!$perms)
{
$perms = $usergroup;
$default_checked = true;
}
}
else
{

				}
}

if(!$perms)
{
$perms = $usergroup;
$default_checked = true;
}
}
else
{

			if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;

			if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;

			}

			}

			elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];

			elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];

				$default_checked = true;
}

				$default_checked = true;
}

			else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];

			else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];

				$default_checked = true;
}

				$default_checked = true;
}

			
if(!$perms)
{

			
if(!$perms)
{

Zeile 1697Zeile 1697
				}
}
else

				}
}
else

			{
if($perms[$forum_permission] == 1)

			{
if($perms[$forum_permission] == 1)

				{
$perms_checked[$forum_permission] = 1;
}

				{
$perms_checked[$forum_permission] = 1;
}

Zeile 1810Zeile 1810
	if(!$mod['mid'])
{
flash_message($lang->error_invalid_moderator, 'error');

	if(!$mod['mid'])
{
flash_message($lang->error_invalid_moderator, 'error');

		admin_redirect("index.php?module=forum-management&fid={$fid}");
}

// User clicked no

		admin_redirect("index.php?module=forum-management&fid={$fid}");
}

// User clicked no

	if($mybb->input['no'])
{
admin_redirect("index.php?module=forum-management&fid={$fid}");

	if($mybb->input['no'])
{
admin_redirect("index.php?module=forum-management&fid={$fid}");

Zeile 1860Zeile 1860
		// Log admin action
if ($isgroup)
{

		// 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 1892Zeile 1892

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


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

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

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


if($mybb->request_method == "post")
{
$fid = intval($mybb->input['fid']);
$forum_info = get_forum($fid);


if($mybb->request_method == "post")
{
$fid = intval($mybb->input['fid']);
$forum_info = get_forum($fid);

		

		

		$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'");
$stats = $db->fetch_array($query);

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

		$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'");
$stats = $db->fetch_array($query);

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

		
switch($db->type)
{

		
switch($db->type)
{

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

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

Zeile 1950Zeile 1950
		}

if(is_array($moderators))

		}

if(is_array($moderators))

		{

		{

			$mod_list = implode(",", $moderators);
if($mod_list)
{

			$mod_list = implode(",", $moderators);
if($mod_list)
{

Zeile 1992Zeile 1992
		
// Log admin action
log_admin_action($forum_info['fid'], $forum_info['name']);

		
// Log admin action
log_admin_action($forum_info['fid'], $forum_info['name']);





		flash_message($lang->success_forum_deleted, 'success');
admin_redirect("index.php?module=forum-management");
}
else
{
$page->output_confirm_action("index.php?module=forum-management&amp;action=delete&amp;fid={$forum['fid']}", $lang->confirm_forum_deletion);

		flash_message($lang->success_forum_deleted, 'success');
admin_redirect("index.php?module=forum-management");
}
else
{
$page->output_confirm_action("index.php?module=forum-management&amp;action=delete&amp;fid={$forum['fid']}", $lang->confirm_forum_deletion);

	}

	}

}

}





if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_forum_management_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_forum_management_start");

	$fid = intval($mybb->input['fid']);

 




 
	if(!isset($mybb->input['fid']))
{
$mybb->input['fid'] = 0;
}

$fid = intval($mybb->input['fid']);

	if($fid)
{
$forum = get_forum($fid);

	if($fid)
{
$forum = get_forum($fid);

Zeile 2144Zeile 2149
					$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 2218Zeile 2223
		$page->output_tab_control($tabs);

echo "<div id=\"tab_subforums\">\n";

		$page->output_tab_control($tabs);

echo "<div id=\"tab_subforums\">\n";

		if(!is_array($forum_cache))

		if(!isset($forum_cache) || !is_array($forum_cache))

		{
cache_forums();
}

		{
cache_forums();
}

Zeile 2260Zeile 2265
		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 2332Zeile 2337
			}
else
{

			}
else
{

				if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

				if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

				{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}

				{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}

				elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum['fid']][$usergroup['gid']])

				elseif(is_array($cached_forum_perms) && isset($cached_forum_perms[$forum['fid']]) && $cached_forum_perms[$forum['fid']][$usergroup['gid']])

				{
$perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']];
$default_checked = true;

				{
$perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']];
$default_checked = true;

Zeile 2393Zeile 2398
			$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>");

$field_select = "<div class=\"quick_perm_fields\">\n";

			$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>");

$field_select = "<div class=\"quick_perm_fields\">\n";

			$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";

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

			foreach($perms_checked as $perm => $value)
{
if($value == 1)

			foreach($perms_checked as $perm => $value)
{
if($value == 1)

Zeile 2402Zeile 2407
				}
}
$field_select .= "</ul></div>\n";

				}
}
$field_select .= "</ul></div>\n";

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

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

			foreach($perms_checked as $perm => $value)

			foreach($perms_checked as $perm => $value)

			{

			{

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

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

Zeile 2448Zeile 2453
			$form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));

$ids[] = $usergroup['gid'];

			$form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));

$ids[] = $usergroup['gid'];

		}
$form_container->end();


		}
$form_container->end();


		$buttons = array();
$buttons[] = $form->generate_submit_button($lang->update_forum_permissions);
$buttons[] = $form->generate_reset_button($lang->reset);

		$buttons = array();
$buttons[] = $form->generate_submit_button($lang->update_forum_permissions);
$buttons[] = $form->generate_reset_button($lang->reset);

Zeile 2495Zeile 2500
				$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=editmod&amp;mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center"));
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=deletemod&amp;id={$moderator['id']}&amp;isgroup=0&amp;fid={$fid}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
}

				$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=editmod&amp;mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center"));
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=deletemod&amp;id={$moderator['id']}&amp;isgroup=0&amp;fid={$fid}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
}

			$form_container->construct_row();
}

			$form_container->construct_row();
}

		
if($form_container->num_rows() == 0)

		
if($form_container->num_rows() == 0)

		{

		{

			$form_container->output_cell($lang->no_moderators, array('colspan' => 3));
$form_container->construct_row();

			$form_container->output_cell($lang->no_moderators, array('colspan' => 3));
$form_container->construct_row();

		}

		}

		$form_container->end();

// Users

		$form_container->end();

// Users

Zeile 2519Zeile 2524

foreach($usergroups as $group)
{


foreach($usergroups as $group)
{

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











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

if(!isset($mybb->input['usergroup']))
{
$mybb->input['usergroup'] = '';
}

if(!isset($mybb->input['username']))
{
$mybb->input['username'] = '';

		}

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

		}

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