Vergleich admin/modules/forum/management.php - 1.4.0 - 1.4.9

  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 4049 2008-07-26 22:11:03Z Tikitiki $

 * $Id: management.php 4376 2009-06-03 21:56:15Z RyanGordon $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 618Zeile 618
		
if(!$errors)
{

		
if(!$errors)
{

 
			if($pid < 0)
{
$pid = 0;
}

			$insert_array = array(
"name" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			$insert_array = array(
"name" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

Zeile 641Zeile 645
				"modthreads" => intval($mybb->input['modthreads']),
"mod_edit_posts" => intval($mybb->input['mod_edit_posts']),
"modattachments" => intval($mybb->input['modattachments']),

				"modthreads" => intval($mybb->input['modthreads']),
"mod_edit_posts" => intval($mybb->input['mod_edit_posts']),
"modattachments" => intval($mybb->input['modattachments']),

				"style" => intval($mybb->input['fstyle']),

				"style" => intval($mybb->input['style']),

				"overridestyle" => intval($mybb->input['overridestyle']),
"rulestype" => intval($mybb->input['rulestype']),
"rulestitle" => $db->escape_string($mybb->input['rulestitle']),

				"overridestyle" => intval($mybb->input['overridestyle']),
"rulestype" => intval($mybb->input['rulestype']),
"rulestitle" => $db->escape_string($mybb->input['rulestitle']),

Zeile 696Zeile 700
	$page->output_nav_tabs($sub_tabs, 'add_forum');

$form = new Form("index.php?module=forum/management&amp;action=add", "post");

	$page->output_nav_tabs($sub_tabs, 'add_forum');

$form = new Form("index.php?module=forum/management&amp;action=add", "post");





	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

Zeile 776Zeile 780
	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_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->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->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 886Zeile 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 931Zeile 936
			else if(is_array($cached_forum_perms) && $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']])
{
$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;
}

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

$perm_check = "";


				$default_checked = true;
}

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

$all_check = "";
$perm_check = "";

		$all_checked = true;
foreach($field_list as $forum_permission)
{

		$all_checked = true;
foreach($field_list as $forum_permission)
{

Zeile 957Zeile 963
			if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
{
$value = $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'])
{
$all_checked = false;

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

				}

				}

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

				
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 988Zeile 994
				else
{
$perms_checked[$forum_permission] = 0;

				else
{
$perms_checked[$forum_permission] = 0;

				}
}

				}
}

			$all_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = \$('permissions_{$usergroup['gid']}_all').checked;\n";
$perm_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = $value;\n";
}

			$all_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = \$('permissions_{$usergroup['gid']}_all').checked;\n";
$perm_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = $value;\n";
}

Zeile 1018Zeile 1024
	$plugins->run_hooks("admin_forum_management_edit");

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

	$plugins->run_hooks("admin_forum_management_edit");

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)

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

		flash_message($lang->error_invalid_fid, 'error');
admin_redirect("index.php?module=forum/management");
}

	

	

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

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

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

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

		{

		{

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


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


Zeile 1068Zeile 1074
		
if(!$errors)
{

		
if(!$errors)
{

 
			if($pid < 0)
{
$pid = 0;
}

			$update_array = array(
"name" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			$update_array = array(
"name" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

Zeile 1090Zeile 1100
				"modthreads" => intval($mybb->input['modthreads']),
"mod_edit_posts" => intval($mybb->input['mod_edit_posts']),
"modattachments" => intval($mybb->input['modattachments']),

				"modthreads" => intval($mybb->input['modthreads']),
"mod_edit_posts" => intval($mybb->input['mod_edit_posts']),
"modattachments" => intval($mybb->input['modattachments']),

				"style" => intval($mybb->input['fstyle']),

				"style" => intval($mybb->input['style']),

				"overridestyle" => intval($mybb->input['overridestyle']),
"rulestype" => intval($mybb->input['rulestype']),
"rulestitle" => $db->escape_string($mybb->input['rulestitle']),

				"overridestyle" => intval($mybb->input['overridestyle']),
"rulestype" => intval($mybb->input['rulestype']),
"rulestitle" => $db->escape_string($mybb->input['rulestitle']),

Zeile 1143Zeile 1153
			
$canview = $permissions['canview'];
$canpostthreads = $permissions['canpostthreads'];

			
$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 1389Zeile 1398
				$default_checked = true;
}
}

				$default_checked = true;
}
}

 
		$all_check = "";

		$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

		$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

Zeile 1397Zeile 1407
			{
$value = "true";
}

			{
$value = "true";
}

			else
{
$value = "false";
}

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

			else
{
$value = "false";
}

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

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

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

Zeile 1412Zeile 1422
				if($mybb->input['permissions'][$usergroup['gid']]['all'])
{
$all_checked = false;

				if($mybb->input['permissions'][$usergroup['gid']]['all'])
{
$all_checked = false;

				}

				}

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

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

				}

				}

				else
{
$perms_checked[$forum_permission] = 0;

				else
{
$perms_checked[$forum_permission] = 0;

Zeile 1426Zeile 1436
			else
{
if($perms[$forum_permission] != 1)

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

				{

				{

					$all_checked = false;
}
if($perms[$forum_permission] == 1)

					$all_checked = false;
}
if($perms[$forum_permission] == 1)

Zeile 1503Zeile 1513
		
$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 1618Zeile 1628
		$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 1650Zeile 1661
		if($mybb->input['update'] == "permissions")
{
$inherit = $mybb->input['default_permissions'];

		if($mybb->input['update'] == "permissions")
{
$inherit = $mybb->input['default_permissions'];

 
			
if(empty($mybb->input['permissions']))
{
$mybb->input['permissions'] = array();
}

			
foreach($mybb->input['permissions'] as $gid => $permission)
{

			
foreach($mybb->input['permissions'] as $gid => $permission)
{

Zeile 1911Zeile 1927
					$default_checked = true;
}
}

					$default_checked = true;
}
}

 
			
$all_check = "";

			$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

			$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

Zeile 2035Zeile 2053

foreach($forum_cache as $forum)
{


foreach($forum_cache as $forum)
{

			$forums_by_parent[$forum['pid']][$val['disporder']][$forum['fid']] = $forum;

			$forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

		}
}


		}
}


Zeile 2094Zeile 2112
			{
if($forum['description'])
{

			{
if($forum['description'])
{

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

           			$forum['description'] = "<br /><small>".$forum['description']."</small>";
}


           			$forum['description'] = "<br /><small>".$forum['description']."</small>";
}


Zeile 2141Zeile 2160
				++$donecount;
if($donecount == $mybb->settings['subforumsindex'])
{

				++$donecount;
if($donecount == $mybb->settings['subforumsindex'])
{

					if(count($children) > $donecount)

					if(subforums_count($forums_by_parent[$pid]) > $donecount)

					{

					{

						$sub_forums .= $comma.$lang->sprintf($lang->more_subforums, (count($children) - $donecount));

						$sub_forums .= $comma.$lang->sprintf($lang->more_subforums, (subforums_count($forums_by_parent[$pid]) - $donecount));

						return;
}
}

						return;
}
}