Vergleich admin/modules/forum/management.php - 1.4.4 - 1.4.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: management.php 4249 2008-10-25 05:37:16Z Tikitiki $

 * $Id: management.php 5379 2011-02-21 11:06:42Z Tomm $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 88Zeile 88
				$errors[] = $lang->error_new_forum_needs_name;
}


				$errors[] = $lang->error_new_forum_needs_name;
}


			if($mybb->input['pid'] == 0 && $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 890Zeile 890
		$usergroups[$usergroup['gid']] = $usergroup;
}


		$usergroups[$usergroup['gid']] = $usergroup;
}


 
	$cached_forum_perms = $cache->read("forumpermissions");

	$field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments');

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

	$field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments');

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

Zeile 906Zeile 907
		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;
}

Zeile 916Zeile 917
				{
$perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
$default_checked = true;

				{
$perms = $cached_forum_perms[$mybb->input['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']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;

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

			}

			}

			else if(is_array($cached_forum_perms) && $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']])

			else if(is_array($cached_forum_perms) && $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']])

			{

			{

				$perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
$default_checked = true;
}

				$perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
$default_checked = true;
}

Zeile 942Zeile 943
			{
$perms = $usergroup;
$default_checked = true;

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

			}

			}

		}

$all_check = "";

		}

$all_check = "";

Zeile 953Zeile 954
			if($usergroup[$forum_permission] == 1)
{
$value = "true";

			if($usergroup[$forum_permission] == 1)
{
$value = "true";

			}

			}

			else

			else

			{

			{

				$value = "false";
}

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

				$value = "false";
}

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

			{

			{

				$value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission];
}

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

				$value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission];
}

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

				{

				{

					$all_checked = false;
}

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

					$all_checked = false;
}

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 1014Zeile 1015
	$buttons[] = $form->generate_submit_button($lang->save_forum);
$form->output_submit_wrapper($buttons);
$form->end();

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

	

	

	$page->output_footer();	
}

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

	$page->output_footer();	
}

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

	

	

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

	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)
{
flash_message($lang->error_invalid_fid, 'error');

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

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

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

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

	
if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

	
if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

		{

		{

			$errors[] = $lang->error_missing_title;

			$errors[] = $lang->error_missing_title;

		}


		}


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

if($pid == $mybb->input['fid'])

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

if($pid == $mybb->input['fid'])

		{

		{

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

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

			{

			{

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

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

			}
}

			}
}

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


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


Zeile 1070Zeile 1071
		{
$errors[] = $lang->error_no_parent;
}

		{
$errors[] = $lang->error_no_parent;
}

 
		
if($type == 'c' && $forum_data['type'] == 'f')
{
$query = $db->simple_select('threads', 'COUNT(tid) as num_threads', "fid = '{$fid}'");
if($db->fetch_field($query, "num_threads") > 0)
{
$errors[] = $lang->error_not_empty;
}
}

		
if(!$errors)
{

		
if(!$errors)
{

Zeile 1110Zeile 1120
			);
$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}'", 1);


				// Update the parentlist of this forum.
$db->update_query("forums", array("parentlist" => make_parent_list($fid)), "fid='{$fid}'", 1);


Zeile 1119Zeile 1129
				{
case "sqlite3":
case "sqlite2":

				{
case "sqlite3":
case "sqlite2":

 
					case "pgsql":

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

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

Zeile 1147Zeile 1158
					}
}
}

					}
}
}

			

			

			$cache->update_forums();

$canview = $permissions['canview'];
$canpostthreads = $permissions['canpostthreads'];

			$cache->update_forums();

$canview = $permissions['canview'];
$canpostthreads = $permissions['canpostthreads'];

			$canpostreplies = $permissions['canpostreplies'];

 
			$canpostpolls = $permissions['canpostpolls'];
$canpostattachments = $permissions['canpostattachments'];
$canpostreplies = $permissions['canpostreplys'];

			$canpostpolls = $permissions['canpostpolls'];
$canpostattachments = $permissions['canpostattachments'];
$canpostreplies = $permissions['canpostreplys'];

Zeile 1181Zeile 1191
		$page->output_inline_error($errors);
$forum_data = $mybb->input;
}

		$page->output_inline_error($errors);
$forum_data = $mybb->input;
}

	else
{
$forum_data['title'] = $forum_data['name'];
}

	else
{
$forum_data['title'] = $forum_data['name'];
}

	
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
while($usergroup = $db->fetch_array($query))

	
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
while($usergroup = $db->fetch_array($query))

Zeile 1257Zeile 1267
	{
$styles[$style['tid']] = $style['name'];
}

	{
$styles[$style['tid']] = $style['name'];
}

	

	

	$style_options = array(
$form->generate_check_box('overridestyle', 1, $lang->override_user_style, array('checked' => $forum_data['overridestyle'], 'id' => 'overridestyle')),
$lang->forum_specific_style."<br />\n".$form->generate_select_box('style', $styles, $forum_data['style'], array('id' => 'style'))

	$style_options = array(
$form->generate_check_box('overridestyle', 1, $lang->override_user_style, array('checked' => $forum_data['overridestyle'], 'id' => 'overridestyle')),
$lang->forum_specific_style."<br />\n".$form->generate_select_box('style', $styles, $forum_data['style'], array('id' => 'style'))

	);

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

	);

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

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

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

	);


	);


	$forum_rules = array(
$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'))

	$forum_rules = array(
$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>");

$default_date_cut = array(

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

Zeile 1329Zeile 1339
	);

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

	);

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

	$form_container->end();


	$form_container->end();


	$cached_forum_perms = $cache->read("forumpermissions");
$field_list = array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments');


	$cached_forum_perms = $cache->read("forumpermissions");
$field_list = array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments');


Zeile 1365Zeile 1375
				{
$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)
{
$perms = $usergroup;

			if(!$perms)
{
$perms = $usergroup;

Zeile 1404Zeile 1414
		foreach($field_list as $forum_permission)
{
if($usergroup[$forum_permission] == 1)

		foreach($field_list as $forum_permission)
{
if($usergroup[$forum_permission] == 1)

			{

			{

				$value = "true";
}
else
{
$value = "false";

				$value = "true";
}
else
{
$value = "false";

			}


			}


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

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

			{

			{

				$value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission];
}

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

				$value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission];
}

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

				{
$all_checked = false;
}

				{
$all_checked = false;
}

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

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

Zeile 1476Zeile 1486
	$buttons[] = $form->generate_submit_button($lang->save_forum);
$form->output_submit_wrapper($buttons);
$form->end();

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

	
$page->output_footer();

	
$page->output_footer();

}

if($mybb->input['action'] == "deletemod")

}

if($mybb->input['action'] == "deletemod")

Zeile 1513Zeile 1523
		
$db->delete_query("moderators", "mid='{$mid}'");
$query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");

		
$db->delete_query("moderators", "mid='{$mid}'");
$query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");

		if($db->fetch_array($query))

		if($db->num_rows($query) == 0)

		{
$updatequery = array(
"usergroup" => "2"

		{
$updatequery = array(
"usergroup" => "2"

Zeile 1628Zeile 1638
		$db->delete_query("threads", "fid='{$fid}' {$delquery}");
$db->delete_query("posts", "fid='{$fid}' {$delquery}");
$db->delete_query("moderators", "fid='{$fid}' {$delquery}");

		$db->delete_query("threads", "fid='{$fid}' {$delquery}");
$db->delete_query("posts", "fid='{$fid}' {$delquery}");
$db->delete_query("moderators", "fid='{$fid}' {$delquery}");

 
		$db->delete_query("forumsubscriptions", "fid='{$fid}' {$delquery}");


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


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

Zeile 1766Zeile 1777
			
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']);

			}
}
}

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

			}
}
}

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

	}

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

	}

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

Zeile 2065Zeile 2076
	{
foreach($children as $forum)
{

	{
foreach($children as $forum)
{

			$forum['name'] = htmlspecialchars_uni($forum['name']);


			$forum['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&amp;", $forum['name']);


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

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