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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19

if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action'])
{


if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action'])
{

	if(isset($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 1291Zeile 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 1332Zeile 1342
			);
$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.

				// 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 1358
				}

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

			}

			}

			

			

			$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_
if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))

			$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_
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)
{
$inherit[$gid] = 1;

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

Zeile 1374Zeile 1384
				
// 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)

Zeile 1414Zeile 1424
			flash_message($lang->success_forum_updated, 'success');
admin_redirect("index.php?module=forum-management&fid={$fid}");
}

			flash_message($lang->success_forum_updated, 'success');
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 1443Zeile 1453
	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 1844Zeile 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 1870Zeile 1872
		
flash_message($lang->success_moderator_deleted, 'success');
admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");

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

	}

	}

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

Zeile 1888Zeile 1890
	if(!$forum['fid'])
{
flash_message($lang->error_invalid_forum, 'error');

	if(!$forum['fid'])
{
flash_message($lang->error_invalid_forum, 'error');

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

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

	}

// User clicked no

	}

// User clicked no

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

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

		

		

		switch($db->type)
{
case "pgsql":

		switch($db->type)
{
case "pgsql":

Zeile 1926Zeile 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)