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

  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: management.php 5162 2010-08-01 22:09:04Z RyanGordon $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

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 90Zeile 90
			
if($mybb->input['pid'] == -1 && $mybb->input['type'] == 'f')
{

			
if($mybb->input['pid'] == -1 && $mybb->input['type'] == 'f')
{

				$errors[] = $lang->error_forum_noparent;

				$errors[] = $lang->error_no_parent;

			}

if(!$errors)

			}

if(!$errors)

Zeile 248Zeile 248
	$form_container->end();

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

	$form_container->end();

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

	$form_container->output_row($lang->create_a, $lang->create_a_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));

	$form_container->output_row($lang->forum_type, $lang->forum_type_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $copy_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $copy_data['description'], array('id' => 'description')), 'description');
$form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $copy_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $copy_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $copy_data['description'], array('id' => 'description')), 'description');
$form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $copy_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');

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 312Zeile 312
				'canviewips' => intval($mybb->input['canviewips']),
'canopenclosethreads' => intval($mybb->input['canopenclosethreads']),
'canmanagethreads' => intval($mybb->input['canmanagethreads']),

				'canviewips' => intval($mybb->input['canviewips']),
'canopenclosethreads' => intval($mybb->input['canopenclosethreads']),
'canmanagethreads' => intval($mybb->input['canmanagethreads']),

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


				'canmovetononmodforum' => intval($mybb->input['canmovetononmodforum']),
'canusecustomtools' => intval($mybb->input['canusecustomtools'])

			);
$db->update_query("moderators", $update_array, "mid='".intval($mybb->input['mid'])."'");


			);
$db->update_query("moderators", $update_array, "mid='".intval($mybb->input['mid'])."'");


Zeile 370Zeile 371
		$form->generate_check_box('canviewips', 1, $lang->can_view_ips, array('checked' => $mod_data['canviewips'], 'id' => 'canviewips')),
$form->generate_check_box('canopenclosethreads', 1, $lang->can_open_close_threads, array('checked' => $mod_data['canopenclosethreads'], 'id' => 'canopenclosethreads')),
$form->generate_check_box('canmanagethreads', 1, $lang->can_manage_threads, array('checked' => $mod_data['canmanagethreads'], 'id' => 'canmanagethreads')),

		$form->generate_check_box('canviewips', 1, $lang->can_view_ips, array('checked' => $mod_data['canviewips'], 'id' => 'canviewips')),
$form->generate_check_box('canopenclosethreads', 1, $lang->can_open_close_threads, array('checked' => $mod_data['canopenclosethreads'], 'id' => 'canopenclosethreads')),
$form->generate_check_box('canmanagethreads', 1, $lang->can_manage_threads, array('checked' => $mod_data['canmanagethreads'], 'id' => 'canmanagethreads')),

		$form->generate_check_box('canmovetononmodforum', 1, $lang->can_move_to_other_forums, array('checked' => $mod_data['canmovetononmodforum'], 'id' => 'canmovetononmodforum'))


		$form->generate_check_box('canmovetononmodforum', 1, $lang->can_move_to_other_forums, array('checked' => $mod_data['canmovetononmodforum'], 'id' => 'canmovetononmodforum')),
$form->generate_check_box('canusecustomtools', 1, $lang->can_use_custom_tools, array('checked' => $mod_data['canusecustomtools'], 'id' => 'canusecustomtools'))

	);

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

	);

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

Zeile 499Zeile 501
		
if($mybb->input['ajax'] == 1)
{

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

			echo "<script type=\"text/javascript\">
$('row_{$gid}').innerHTML = '".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."';
QuickPermEditor.init({$gid});
</script>\n";

			echo "<script type=\"text/javascript\">$('row_{$gid}').update('".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'); QuickPermEditor.init({$gid});</script>";




			die;
}
else

			die;
}
else

Zeile 657Zeile 656
			'cansearch' => 'misc',
);


			'cansearch' => 'misc',
);


		$plugins->run_hooks_by_ref("admin_forum_management_permission_groups", $groups);

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

		
$tabs = array();
foreach(array_unique(array_values($groups)) as $group)

		
$tabs = array();
foreach(array_unique(array_values($groups)) as $group)

Zeile 929Zeile 928
	}

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

	}

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

	$form_container->output_row($lang->create_a, $lang->create_a_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));

	$form_container->output_row($lang->forum_type, $lang->forum_type_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description');
$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->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description');
$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');

Zeile 954Zeile 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>");

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

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

Zeile 965Zeile 964
	$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 978Zeile 977
	$display_methods = array(
'0' => $lang->dont_display_rules,
'1' => $lang->display_rules_inline,

	$display_methods = array(
'0' => $lang->dont_display_rules,
'1' => $lang->display_rules_inline,

 
		'3' => $lang->display_rules_inline_new,

		'2' => $lang->display_rules_link
);


		'2' => $lang->display_rules_link
);


Zeile 1043Zeile 1043
	$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 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 1107Zeile 1107
				$default_checked = true;
}
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']])

				$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']];
$default_checked = true;

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

			}
}

			}
}

		
if(!$perms)
{

		
if(!$perms)
{

Zeile 1130Zeile 1130
				else
{
$default_checked = false;

				else
{
$default_checked = false;

				}

				}

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

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

				{
$perms_checked[$forum_permission] = 1;
}

				{
$perms_checked[$forum_permission] = 1;
}

				else
{
$perms_checked[$forum_permission] = 0;

				else
{
$perms_checked[$forum_permission] = 0;

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

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

					$perms_checked[$forum_permission] = 1;

					$perms_checked[$forum_permission] = 1;

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

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

			}
}

			}
}

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

if($default_checked)

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

if($default_checked)

		{

		{

			$inherited_text = $lang->inherited_permission;
}
else
{
$inherited_text = $lang->custom_permission;

			$inherited_text = $lang->inherited_permission;
}
else
{
$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 1223Zeile 1223
	foreach($ids as $id)
{
echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id.") });\n";

	foreach($ids as $id)
{
echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id.") });\n";

	}

	}

	echo "// -->\n</script>\n";

$page->output_footer();

	echo "// -->\n</script>\n";

$page->output_footer();

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)

	{

	{

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

Zeile 1261Zeile 1261
		if($pid == $mybb->input['fid'])
{
$errors[] = $lang->error_forum_parent_itself;

		if($pid == $mybb->input['fid'])
{
$errors[] = $lang->error_forum_parent_itself;

		}

		}

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

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

Zeile 1411Zeile 1411
			log_admin_action($fid, $mybb->input['title']);

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

			log_admin_action($fid, $mybb->input['title']);

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

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

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

		}

		}

	}

	}

	
$page->extra_header .= "<script src=\"../jscripts/scriptaculous.js?load=effects,dragdrop,controls\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";

	
$page->extra_header .= "<script src=\"../jscripts/scriptaculous.js?load=effects,dragdrop,controls\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";

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

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

	}

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

	$form_container->output_row($lang->create_a, $lang->create_a_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));

	$form_container->output_row($lang->forum_type, $lang->forum_type_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description');
$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->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description');
$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');

Zeile 1520Zeile 1520
	$display_methods = array(
'0' => $lang->dont_display_rules,
'1' => $lang->display_rules_inline,

	$display_methods = array(
'0' => $lang->dont_display_rules,
'1' => $lang->display_rules_inline,

 
		'3' => $lang->display_rules_inline_new,

		'2' => $lang->display_rules_link
);


		'2' => $lang->display_rules_link
);


Zeile 1527Zeile 1528
		$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'))

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

	);

$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,

	
$default_date_cut = array(
0 => $lang->board_default,

Zeile 1553Zeile 1554
		"rating" => $lang->sort_by_rating,
"replies" => $lang->sort_by_replies,
"views" => $lang->sort_by_views,

		"rating" => $lang->sort_by_rating,
"replies" => $lang->sort_by_replies,
"views" => $lang->sort_by_views,

	);

	);

	
$default_sort_order = array(
"" => $lang->board_default,

	
$default_sort_order = array(
"" => $lang->board_default,

Zeile 1568Zeile 1569
	);

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

	);

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

	

	

	$misc_options = array(
$form->generate_check_box('allowhtml', 1, $lang->allow_html, array('checked' => $forum_data['allowhtml'], 'id' => 'allowhtml')),
$form->generate_check_box('allowmycode', 1, $lang->allow_mycode, array('checked' => $forum_data['allowmycode'], 'id' => 'allowmycode')),

	$misc_options = array(
$form->generate_check_box('allowhtml', 1, $lang->allow_html, array('checked' => $forum_data['allowhtml'], 'id' => 'allowhtml')),
$form->generate_check_box('allowmycode', 1, $lang->allow_mycode, array('checked' => $forum_data['allowmycode'], 'id' => 'allowmycode')),

Zeile 1642Zeile 1643
				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']];
$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']];
$default_checked = true;
}

			}

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

			}

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

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

		}
else
{
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 = $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 1679Zeile 1680
			{
$perms = $usergroup;
$default_checked = true;

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

			}
}


			}
}


		foreach($field_list as $forum_permission => $forum_perm_title)

		foreach($field_list as $forum_permission => $forum_perm_title)

		{

		{

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

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

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

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

				}
}
else

				}
}
else

Zeile 1706Zeile 1707
					$perms_checked[$forum_permission] = 0;
}
}

					$perms_checked[$forum_permission] = 0;
}
}

		}

		}

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

if($default_checked)

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

if($default_checked)

Zeile 1716Zeile 1717
		else
{
$inherited_text = $lang->custom_permission;

		else
{
$inherited_text = $lang->custom_permission;

		}

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

		}

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

Zeile 1859Zeile 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 1872Zeile 1873
	else
{
$page->output_confirm_action("index.php?module=forum-management&amp;action=deletemod&amp;fid={$mod['fid']}&amp;uid={$mod['uid']}", $lang->confirm_moderator_deletion);

	else
{
$page->output_confirm_action("index.php?module=forum-management&amp;action=deletemod&amp;fid={$mod['fid']}&amp;uid={$mod['uid']}", $lang->confirm_moderator_deletion);

	}
}


	}
}


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

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

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

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

 

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


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

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

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


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

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

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

 
		if($mybb->input['update'] == "permissions")
{
$inherit = array();

		if($mybb->input['update'] == "permissions")
{
$inherit = array();

Zeile 2018Zeile 2026
			{
// 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;
}

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

				{
continue;
}

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

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

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

Zeile 2037Zeile 2045
					$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					{

					{

						$permission[$name] = 1;
}
}

						$permission[$name] = 1;
}
}

Zeile 2050Zeile 2058
					else
{
$permissions[$name][$gid] = 0;

					else
{
$permissions[$name][$gid] = 0;

					}
}
}

					}
}
}

			
$cache->update_forums();


			
$cache->update_forums();


Zeile 2063Zeile 2071
			$canpostreplies = $permissions['canpostreplys'];

save_quick_perms($fid);

			$canpostreplies = $permissions['canpostreplys'];

save_quick_perms($fid);

			

			

			$plugins->run_hooks("admin_forum_management_start_permissions_commit");

// Log admin action

			$plugins->run_hooks("admin_forum_management_start_permissions_commit");

// Log admin action

Zeile 2074Zeile 2082
		}
elseif($mybb->input['add'] == "moderators")
{

		}
elseif($mybb->input['add'] == "moderators")
{

			

 
			$forum = get_forum($fid);
if(!$forum)
{
flash_message($lang->error_invalid_forum, 'error');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");

			$forum = get_forum($fid);
if(!$forum)
{
flash_message($lang->error_invalid_forum, 'error');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");

			}
if (!empty($mybb->input['usergroup']))
{
$query = $db->simple_select("usergroups", "gid AS id, title AS name", "title='".$db->escape_string($mybb->input['usergroup'])."'", array('limit' => 1));

			}
if(!empty($mybb->input['usergroup']))
{


				$isgroup = 1;

				$isgroup = 1;

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

if(!$groupscache[$gid])
{
// Didn't select a valid moderator
flash_message($lang->error_moderator_not_found, 'error');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");
}

$newmod = array(
"id" => $gid,
"name" => $groupscache[$gid]['title']
);

			}
else

			}
else

			{

			{

				$query = $db->simple_select("users", "uid AS id, username AS name", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));

				$query = $db->simple_select("users", "uid AS id, username AS name", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));

 

if(!$db->num_rows($query))
{
flash_message($lang->error_moderator_not_found, 'error');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");
}


				$isgroup = 0;

				$isgroup = 0;

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

			}

			}

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



			if($newmod['id'])
{
$query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));

			if($newmod['id'])
{
$query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));

				$mod = $db->fetch_array($query);
if(!$mod['id'])


if(!$db->num_rows($query))

				{
$new_mod = array(
"fid" => $fid,

				{
$new_mod = array(
"fid" => $fid,

Zeile 2107Zeile 2134
						"canviewips" => 1,
"canopenclosethreads" => 1,
"canmanagethreads" => 1,

						"canviewips" => 1,
"canopenclosethreads" => 1,
"canmanagethreads" => 1,

						"canmovetononmodforum" => 1


						"canmovetononmodforum" => 1,
"canusecustomtools" => 1

					);

					);

 


					$mid = $db->insert_query("moderators", $new_mod);

if(!$isgroup)
{
$db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'");
}

					$mid = $db->insert_query("moderators", $new_mod);

if(!$isgroup)
{
$db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'");
}

 


					$cache->update_moderators();

					$cache->update_moderators();

					

 
					$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 2194Zeile 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 2236Zeile 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 2288Zeile 2317
						$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_data['fid']][$usergroup['gid']])

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

					{

					{

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

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

						$default_checked = true;
}

						$default_checked = true;
}

					else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']])

					else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']])

					{

					{

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

						$perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];

						$default_checked = true;
}
}

						$default_checked = true;
}
}

Zeile 2308Zeile 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_data['fid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
$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']];

				}
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;
}
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];

					$default_checked = true;
}


					$default_checked = true;
}


Zeile 2331Zeile 2360
				}
}
foreach($field_list as $forum_permission => $forum_perm_title)

				}
}
foreach($field_list as $forum_permission => $forum_perm_title)

			{				

			{

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

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

Zeile 2356Zeile 2385
				}
}
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);

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

			

			

			if($default_checked == 1)
{
$inherited_text = $lang->inherited_permission;

			if($default_checked == 1)
{
$inherited_text = $lang->inherited_permission;

Zeile 2369Zeile 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 2378Zeile 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)
{
if($value == 0)

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

Zeile 2460Zeile 2489
			if($moderator['isgroup'])
{
$moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/group.gif\" alt=\"{$lang->group}\" title=\"{$lang->group}\" />";

			if($moderator['isgroup'])
{
$moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/group.gif\" alt=\"{$lang->group}\" title=\"{$lang->group}\" />";

				$form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-groups&amp;action=edit&amp;gid={$moderator['id']}\">".htmlspecialchars_uni($moderator['title'])."</a>");

				$form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-groups&amp;action=edit&amp;gid={$moderator['id']}\">".htmlspecialchars_uni($moderator['title'])." ({$lang->usergroup} {$moderator['id']})</a>");

				$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=1&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=1&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"));
}

Zeile 2486Zeile 2515
		$form = new Form("index.php?module=forum-management", "post", "management");
echo $form->generate_hidden_field("fid", $mybb->input['fid']);
echo $form->generate_hidden_field("add", "moderators");

		$form = new Form("index.php?module=forum-management", "post", "management");
echo $form->generate_hidden_field("fid", $mybb->input['fid']);
echo $form->generate_hidden_field("add", "moderators");

 

// Usergroup Moderator
if(!is_array($usergroups))
{
$usergroups = $groupscache;
}

foreach($usergroups as $group)
{
$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);

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

// Autocompletion for usergroups
echo '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>
<script type="text/javascript">
<!--
new autoComplete("usergroup", "../xmlhttp.php?action=get_usergroups", {valueSpan: "usergroup"});
// -->
</script>';


		$form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_select_box('usergroup', $modgroups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
$form_container->end();











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

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

Zeile 2510Zeile 2552
		$form_container = new FormContainer($lang->add_user_as_moderator);
$form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
$form_container->end();

		$form_container = new FormContainer($lang->add_user_as_moderator);
$form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
$form_container->end();

 


		// Autocompletion for usernames
echo '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>

		// Autocompletion for usernames
echo '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>