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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
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 929Zeile 929
	}

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

		}
}


		}
}


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 1753Zeile 1753
		
$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 2005Zeile 2005
{
$plugins->run_hooks("admin_forum_management_start");
$fid = intval($mybb->input['fid']);

{
$plugins->run_hooks("admin_forum_management_start");
$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();
foreach($mybb->input as $id => $permission)

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

			{

			{

				// 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))
{

Zeile 2051Zeile 2053
					{
$permissions[$name][$gid] = 0;
}

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

				}
}


				}
}


			$cache->update_forums();

$canview = $permissions['canview'];

			$cache->update_forums();

$canview = $permissions['canview'];

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

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

			

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

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

			{

			{

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

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

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

			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));
$isgroup = 1;













				preg_match("/\(".$lang->usergroup." (.*?)\)/", $mybb->input['usergroup'], $match_group);

$mod_gid = intval($match_group[1]);
if(!empty($match_group) && $mod_gid > 0)
{
$query = $db->simple_select("usergroups", "gid AS id, title AS name", "gid='".$mod_gid."'", array('limit' => 1));
$isgroup = 1;
}
else
{
// 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");
}

			}
else
{

			}
else
{

Zeile 2213Zeile 2226
	$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);

Zeile 2240Zeile 2253
		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 2254Zeile 2267
			'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,
'canpostthreads' => $lang->perm_drag_canpostthreads,
'canpostreplys' => $lang->perm_drag_canpostreplys,
'canpostpolls' => $lang->perm_drag_canpostpolls,
);

		$field_list2 = array(
'canview' => $lang->perm_drag_canview,
'canpostthreads' => $lang->perm_drag_canpostthreads,
'canpostreplys' => $lang->perm_drag_canpostreplys,
'canpostpolls' => $lang->perm_drag_canpostpolls,
);

		

		

		$ids = array();

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

		$ids = array();

$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 "<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 2282Zeile 2295
			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']])

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






					}
elseif(is_array($cached_forum_perms) && $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_data['fid']][$usergroup['gid']];

						$perms = $cached_forum_perms[$forum['pid']][$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;
}
}

if(!$perms)
{

				}

if(!$perms)
{






					$perms = $usergroup;

					$perms = $usergroup;

					$default_checked = true;
}

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

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

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

				
if(!$perms)
{

Zeile 2331Zeile 2344
				}
}
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 2460Zeile 2473
			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"));
}