Vergleich admin/modules/forum/management.php - 1.6.7 - 1.6.15

  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 5718 2011-12-09 01:30:20Z Tomm $

 * $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(!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 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 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 938Zeile 939
	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);

	$form_container->output_row($lang->forum_link, $lang->forum_link_desc, $form->generate_text_box('linkto', $forum_data['linkto'], array('id' => 'linkto')), 'linkto');
$form_container->output_row($lang->forum_password, $lang->forum_password_desc, $form->generate_text_box('password', $forum_data['password'], array('id' => 'password')), 'password');

$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->forum_link, $lang->forum_link_desc, $form->generate_text_box('linkto', $forum_data['linkto'], array('id' => 'linkto')), 'linkto');
$form_container->output_row($lang->forum_password, $lang->forum_password_desc, $form->generate_text_box('password', $forum_data['password'], array('id' => 'password')), 'password');

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


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

	);

$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 964Zeile 965
	$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 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 1094Zeile 1095
	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 1118
		{
$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']))

Zeile 1164Zeile 1165
			$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 1177
			}
}
$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 1290Zeile 1291
				$errors[] = $lang->error_not_empty;
}
}

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

Zeile 1348Zeile 1359
				
while($child = $db->fetch_array($query))
{

				
while($child = $db->fetch_array($query))
{

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

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

				}
}


				}
}


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


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 1560Zeile 1571
		"" => $lang->board_default,
"asc" => $lang->sort_order_asc,
"desc" => $lang->sort_order_desc,

		"" => $lang->board_default,
"asc" => $lang->sort_order_asc,
"desc" => $lang->sort_order_desc,

	);

	);

	
$view_options = array(
$lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')),

	
$view_options = array(
$lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')),

Zeile 1664Zeile 1675
			{
$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_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 1737Zeile 1748
			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>";

			}

			}

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

$plugins->run_hooks("admin_forum_management_deletemod_commit");

		$cache->update_moderators();

$plugins->run_hooks("admin_forum_management_deletemod_commit");

Zeile 1860Zeile 1863
		// 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 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 1992Zeile 1961
		
// 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");

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

	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 2021Zeile 1995
			{
// 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)

				{

				{

					$inherit[$gid] = 1;
continue;
}

					$inherit[$gid] = 1;
continue;
}

Zeile 2036Zeile 2010
				
// If it isn't an array then it came from the javascript form
if(!is_array($permission))

				
// 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 = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					{

					{

						$permission[$name] = 1;
}
}

						$permission[$name] = 1;
}
}

Zeile 2053Zeile 2027
					else
{
$permissions[$name][$gid] = 0;

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

					}

					}

				}
}


				}
}


Zeile 2117Zeile 2091
			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));





				if(!$db->num_rows($query))
{
$new_mod = array(

				if(!$db->num_rows($query))
{
$new_mod = array(

Zeile 2132Zeile 2106
						"canmovetononmodforum" => 1,
"canusecustomtools" => 1
);

						"canmovetononmodforum" => 1,
"canusecustomtools" => 1
);





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

if(!$isgroup)

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

if(!$isgroup)

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

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

				{

				{

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

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

				}

				}

			}
else
{

			}
else
{

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

				admin_redirect("index.php?module=forum-management&fid=".$mybb->input['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/imodal.js\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/default/imodal.css\" />\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";
$page->extra_header .= "<script src=\"jscripts/imodal.js\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/default/imodal.css\" />\n";

	
if($fid)

	
if($fid)

	{
$page->add_breadcrumb_item($lang->view_forum, "index.php?module=forum-management");

	{
$page->add_breadcrumb_item($lang->view_forum, "index.php?module=forum-management");

	}

$page->output_header($lang->forum_management);

if($fid)
{

	}

$page->output_header($lang->forum_management);

if($fid)
{

		$page->output_nav_tabs($sub_tabs, 'view_forum');
}
else

		$page->output_nav_tabs($sub_tabs, 'view_forum');
}
else

Zeile 2213Zeile 2187
			'subforums' => $lang->subforums,
'permissions' => $lang->forum_permissions,
'moderators' => $lang->moderators,

			'subforums' => $lang->subforums,
'permissions' => $lang->forum_permissions,
'moderators' => $lang->moderators,

		);


		);


		$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 2233Zeile 2207
	$form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));

build_admincp_forums_list($form_container, $fid);

	$form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));

build_admincp_forums_list($form_container, $fid);

	

	

	$submit_options = array();

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

	$submit_options = array();

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

	{

	{

		$form_container->output_cell($lang->no_forums, array('colspan' => 3));
$form_container->construct_row();
$submit_options = array('disabled' => true);
}

		$form_container->output_cell($lang->no_forums, array('colspan' => 3));
$form_container->construct_row();
$submit_options = array('disabled' => true);
}

	

	

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->update_forum_orders, $submit_options);

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->update_forum_orders, $submit_options);

Zeile 2251Zeile 2225
	$form->output_submit_wrapper($buttons);

if(!$fid)

	$form->output_submit_wrapper($buttons);

if(!$fid)

	{

	{

		$form->end();
}


		$form->end();
}


Zeile 2259Zeile 2233
	{
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;

		}


		}


		$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'");
while($existing = $db->fetch_array($query))
{

		$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'");
while($existing = $db->fetch_array($query))
{

Zeile 2278Zeile 2252
			'canpostthreads' => $lang->permissions_canpostthreads,
'canpostreplys' => $lang->permissions_canpostreplys,
'canpostpolls' => $lang->permissions_canpostpolls,

			'canpostthreads' => $lang->permissions_canpostthreads,
'canpostreplys' => $lang->permissions_canpostreplys,
'canpostpolls' => $lang->permissions_canpostpolls,

		);

		);

		
$field_list2 = array(
'canview' => $lang->perm_drag_canview,

		
$field_list2 = array(
'canview' => $lang->perm_drag_canview,

Zeile 2288Zeile 2262
		);

$ids = array();

		);

$ids = array();

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

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

		echo $form->generate_hidden_field("update", "permissions");

		echo $form->generate_hidden_field("update", "permissions");

				

				

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

$form_container = new FormContainer($lang->sprintf($lang->forum_permissions_in, $forum_cache[$fid]['name']));

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

$form_container = new FormContainer($lang->sprintf($lang->forum_permissions_in, $forum_cache[$fid]['name']));

Zeile 2308Zeile 2282
				if($mybb->input['default_permissions'][$usergroup['gid']])
{
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

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

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

					}
}

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

					}
}

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

			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']];

				{
$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['pid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];

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

				}

if(!$perms)

				}

if(!$perms)

				{

				{

					$perms = $usergroup;
$default_checked = true;
}

					$perms = $usergroup;
$default_checked = true;
}

Zeile 2359Zeile 2333
				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
{
if($perms[$forum_permission] == 1)

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

Zeile 2393Zeile 2367
			$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 2376
				}
}
$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)

				{

				{

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

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

Zeile 2416Zeile 2390
			$field_select .= $form->generate_hidden_field("fields_default_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_default_'.$usergroup['gid']));
$field_select = str_replace("'", "\\'", $field_select);
$field_select = str_replace("\n", "", $field_select);

			$field_select .= $form->generate_hidden_field("fields_default_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_default_'.$usergroup['gid']));
$field_select = str_replace("'", "\\'", $field_select);
$field_select = str_replace("\n", "", $field_select);

			

			

			$field_select = "<script type=\"text/javascript\">
//<![CDATA[
document.write('".str_replace("/", "\/", $field_select)."');

			$field_select = "<script type=\"text/javascript\">
//<![CDATA[
document.write('".str_replace("/", "\/", $field_select)."');

Zeile 2425Zeile 2399
			
$field_selected = array();
foreach($field_list as $forum_permission => $permission_title)

			
$field_selected = array();
foreach($field_list as $forum_permission => $permission_title)

			{

			{

				$field_options[$forum_permission] = $permission_title;
if($perms_checked[$forum_permission])
{

				$field_options[$forum_permission] = $permission_title;
if($perms_checked[$forum_permission])
{

Zeile 2444Zeile 2418
			else
{
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;gid={$usergroup['gid']}&amp;fid={$fid}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));

			else
{
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;gid={$usergroup['gid']}&amp;fid={$fid}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));

			}

			}

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

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

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

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

Zeile 2482Zeile 2456
		while($moderator = $db->fetch_array($query))
{
if($moderator['isgroup'])

		while($moderator = $db->fetch_array($query))
{
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'])." ({$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"));

				$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'])." ({$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"));

			}

			}

			else
{
$moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/user.gif\" alt=\"{$lang->user}\" title=\"{$lang->user}\" />";

			else
{
$moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/user.gif\" alt=\"{$lang->user}\" title=\"{$lang->user}\" />";

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

Zeile 2510Zeile 2484
		$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))

		// Usergroup Moderator
if(!is_array($usergroups))

		{

		{

			$usergroups = $groupscache;
}


			$usergroups = $groupscache;
}


		foreach($usergroups as $group)











		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']))

		{

		{

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

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

		}

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

		}

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