Vergleich admin/modules/forum/management.php - 1.8.4 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1325Zeile 1325
		}
else
{

		}
else
{

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


			$query = $db->simple_select('forums', 'parentlist', "fid='{$pid}'");
$parents = explode(',', $db->fetch_field($query, 'parentlist'));
if(in_array($mybb->input['fid'], $parents))

			{

			{

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

				$errors[] = $lang->error_forum_parent_child;





			}
}


			}
}


Zeile 1399Zeile 1396
			);
$db->update_query("forums", $update_array, "fid='{$fid}'");
if($pid != $forum_data['pid'])

			);
$db->update_query("forums", $update_array, "fid='{$fid}'");
if($pid != $forum_data['pid'])

			{

			{

				// Update the parentlist of this forum.
$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)

				// Update the parentlist of this forum.
$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)

				{

				{

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

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

				}

				}


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


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

				}
}

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


				}
}

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


			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_

			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_

Zeile 1511Zeile 1508

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

	{

	{

		$existing_permissions[$existing['gid']] = $existing;
}


		$existing_permissions[$existing['gid']] = $existing;
}


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


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


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


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


	$plugins->run_hooks("admin_forum_management_deletemod");

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

	$plugins->run_hooks("admin_forum_management_deletemod");

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

Zeile 1887Zeile 1884
				SELECT m.*, g.title
FROM ".TABLE_PREFIX."moderators m
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=m.id)

				SELECT m.*, g.title
FROM ".TABLE_PREFIX."moderators m
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=m.id)

				WHERE m.mid='{$mid}'

				WHERE m.mid='{$mid}'

			");
}
else

			");
}
else

Zeile 1898Zeile 1895
				LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=m.id)
WHERE m.mid='{$mid}'
");

				LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=m.id)
WHERE m.mid='{$mid}'
");

		}

		}

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

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

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

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

Zeile 1942Zeile 1939

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


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

	{

	{

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

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





	$plugins->run_hooks("admin_forum_management_delete");

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

	$plugins->run_hooks("admin_forum_management_delete");

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

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

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

				break;

				break;

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

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

Zeile 2008Zeile 2005
		$cache->update_forums();
$cache->update_moderators();
$cache->update_forumpermissions();

		$cache->update_forums();
$cache->update_moderators();
$cache->update_forumpermissions();





		// 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&action=delete&fid={$forum['fid']}", $lang->confirm_forum_deletion);

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

Zeile 2030Zeile 2027

$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if($fid)


$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if($fid)

	{

	{

		$forum = get_forum($fid);
}

		$forum = get_forum($fid);
}





	$plugins->run_hooks("admin_forum_management_start");

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

	$plugins->run_hooks("admin_forum_management_start");

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

Zeile 2052Zeile 2049
				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;

				}

				}

				$inherit[$gid] = 0;

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

				$inherit[$gid] = 0;

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

Zeile 2073Zeile 2070
					if($permission[$name])
{
$permissions[$name][$gid] = 1;

					if($permission[$name])
{
$permissions[$name][$gid] = 1;

					}

					}

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

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

Zeile 2134Zeile 2131
				if(empty($newmod['id']))
{
flash_message($lang->error_moderator_not_found, 'error');

				if(empty($newmod['id']))
{
flash_message($lang->error_moderator_not_found, 'error');

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


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


				$isgroup = 0;
}


				$isgroup = 0;
}


Zeile 2222Zeile 2219

flash_message($lang->success_forum_disporder_updated, 'success');
admin_redirect("index.php?module=forum-management&fid=".$mybb->input['fid']);


flash_message($lang->success_forum_disporder_updated, 'success');
admin_redirect("index.php?module=forum-management&fid=".$mybb->input['fid']);

			}
}
}

$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";

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

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

if($fid)
{
$page->output_nav_tabs($sub_tabs, 'view_forum');

			}
}
}

$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";

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








	}

	}

	else









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

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

	{
$page->output_nav_tabs($sub_tabs, 'forum_management');
}

	{
$page->output_nav_tabs($sub_tabs, 'forum_management');
}

Zeile 2256Zeile 2253
		);
$tabs = $plugins->run_hooks("admin_forum_management_start_graph_tabs", $tabs);
$page->output_tab_control($tabs);

		);
$tabs = $plugins->run_hooks("admin_forum_management_start_graph_tabs", $tabs);
$page->output_tab_control($tabs);





		echo "<div id=\"tab_subforums\">\n";
if(!isset($forum_cache) || !is_array($forum_cache))
{

		echo "<div id=\"tab_subforums\">\n";
if(!isset($forum_cache) || !is_array($forum_cache))
{

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

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

				{

				{

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

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

					elseif(is_array($cached_forum_perms) && $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']];
$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
{

Zeile 2412Zeile 2409
					if($perms[$forum_permission] == 1)
{
$perms_checked[$forum_permission] = 1;

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

					}
else

					}
else

					{
$perms_checked[$forum_permission] = 0;
}

					{
$perms_checked[$forum_permission] = 0;
}

Zeile 2595Zeile 2592
		<script type="text/javascript">
<!--
$("#username").select2({

		<script type="text/javascript">
<!--
$("#username").select2({

			placeholder: "'.$lang->search_user.'",

			placeholder: "'.$lang->search_for_a_user.'",

			minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,

			minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,

Zeile 2645Zeile 2642
}

/**

}

/**

 *



 * @param DefaultFormContainer $form_container
* @param int $pid
* @param int $depth

 */
function build_admincp_forums_list(&$form_container, $pid=0, $depth=1)
{

 */
function build_admincp_forums_list(&$form_container, $pid=0, $depth=1)
{

Zeile 2655Zeile 2654
	if(!is_array($forums_by_parent))
{
$forum_cache = cache_forums();

	if(!is_array($forums_by_parent))
{
$forum_cache = cache_forums();





		foreach($forum_cache as $forum)
{
$forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

		foreach($forum_cache as $forum)
{
$forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

		}
}


		}
}


	if(!is_array($forums_by_parent[$pid]))

	if(!is_array($forums_by_parent[$pid]))

	{

	{

		return;
}


		return;
}


Zeile 2676Zeile 2675
			if($forum['active'] == 0)
{
$forum['name'] = "<em>".$forum['name']."</em>";

			if($forum['active'] == 0)
{
$forum['name'] = "<em>".$forum['name']."</em>";

			}


			}


			if($forum['type'] == "c" && ($depth == 1 || $depth == 2))
{
$sub_forums = '';
if(isset($forums_by_parent[$forum['fid']]) && $depth == 2)

			if($forum['type'] == "c" && ($depth == 1 || $depth == 2))
{
$sub_forums = '';
if(isset($forums_by_parent[$forum['fid']]) && $depth == 2)

				{

				{

					build_admincp_forums_list($form_container, $forum['fid'], $depth+1);

					build_admincp_forums_list($form_container, $forum['fid'], $depth+1);

				}

				}

				if($sub_forums)
{
$sub_forums = "<br /><small>{$lang->sub_forums}: {$sub_forums}</small>";

				if($sub_forums)
{
$sub_forums = "<br /><small>{$lang->sub_forums}: {$sub_forums}</small>";

Zeile 2693Zeile 2692
				$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&amp;fid={$forum['fid']}\"><strong>{$forum['name']}</strong></a>{$sub_forums}</div>");

$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));

				$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&amp;fid={$forum['fid']}\"><strong>{$forum['name']}</strong></a>{$sub_forums}</div>");

$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));


$popup = new PopupMenu("forum_{$forum['fid']}", $lang->options);


$popup = new PopupMenu("forum_{$forum['fid']}", $lang->options);

				$popup->add_item($lang->edit_forum, "index.php?module=forum-management&amp;action=edit&amp;fid={$forum['fid']}");
$popup->add_item($lang->subforums, "index.php?module=forum-management&amp;fid={$forum['fid']}");
$popup->add_item($lang->moderators, "index.php?module=forum-management&amp;fid={$forum['fid']}#tab_moderators");

				$popup->add_item($lang->edit_forum, "index.php?module=forum-management&amp;action=edit&amp;fid={$forum['fid']}");
$popup->add_item($lang->subforums, "index.php?module=forum-management&amp;fid={$forum['fid']}");
$popup->add_item($lang->moderators, "index.php?module=forum-management&amp;fid={$forum['fid']}#tab_moderators");

Zeile 2703Zeile 2702
				$popup->add_item($lang->copy_forum, "index.php?module=forum-management&amp;action=copy&amp;fid={$forum['fid']}");
$popup->add_item($lang->delete_forum, "index.php?module=forum-management&amp;action=delete&amp;fid={$forum['fid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");


				$popup->add_item($lang->copy_forum, "index.php?module=forum-management&amp;action=copy&amp;fid={$forum['fid']}");
$popup->add_item($lang->delete_forum, "index.php?module=forum-management&amp;action=delete&amp;fid={$forum['fid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");


				$form_container->output_cell($popup->fetch(), array("class" => "align_center"));


				$form_container->output_cell($popup->fetch(), array("class" => "align_center"));


				$form_container->construct_row();

// Does this category have any sub forums?
if($forums_by_parent[$forum['fid']])

				$form_container->construct_row();

// Does this category have any sub forums?
if($forums_by_parent[$forum['fid']])

				{
build_admincp_forums_list($form_container, $forum['fid'], $depth+1);

				{
build_admincp_forums_list($form_container, $forum['fid'], $depth+1);

				}
}
elseif($forum['type'] == "f" && ($depth == 1 || $depth == 2))

				}
}
elseif($forum['type'] == "f" && ($depth == 1 || $depth == 2))

Zeile 2744Zeile 2743
				$popup->add_item($lang->copy_forum, "index.php?module=forum-management&amp;action=copy&amp;fid={$forum['fid']}");
$popup->add_item($lang->delete_forum, "index.php?module=forum-management&amp;action=delete&amp;fid={$forum['fid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");


				$popup->add_item($lang->copy_forum, "index.php?module=forum-management&amp;action=copy&amp;fid={$forum['fid']}");
$popup->add_item($lang->delete_forum, "index.php?module=forum-management&amp;action=delete&amp;fid={$forum['fid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");


				$form_container->output_cell($popup->fetch(), array("class" => "align_center"));


				$form_container->output_cell($popup->fetch(), array("class" => "align_center"));


				$form_container->construct_row();

if(isset($forums_by_parent[$forum['fid']]) && $depth == 1)

				$form_container->construct_row();

if(isset($forums_by_parent[$forum['fid']]) && $depth == 1)

				{

				{

					build_admincp_forums_list($form_container, $forum['fid'], $depth+1);
}
}

					build_admincp_forums_list($form_container, $forum['fid'], $depth+1);
}
}

Zeile 2759Zeile 2758
				{
$sub_forums .= "{$comma} <a href=\"index.php?module=forum-management&amp;fid={$forum['fid']}\">{$forum['name']}</a>";
$comma = $lang->comma;

				{
$sub_forums .= "{$comma} <a href=\"index.php?module=forum-management&amp;fid={$forum['fid']}\">{$forum['name']}</a>";
$comma = $lang->comma;

				}

				}


// Have we reached our max visible subforums? put a nice message and break out of the loop
++$donecount;


// Have we reached our max visible subforums? put a nice message and break out of the loop
++$donecount;

Zeile 2776Zeile 2775
	}
}


	}
}


 
/**
* @param int $gid
* @param int $fid
*
* @return string
*/

function retrieve_single_permissions_row($gid, $fid)
{
global $mybb, $lang, $cache, $db;

function retrieve_single_permissions_row($gid, $fid)
{
global $mybb, $lang, $cache, $db;