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

  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 4249 2008-10-25 05:37:16Z Tikitiki $

 */

// 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 931Zeile 935
			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 952Zeile 957
			else
{
$value = "false";

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

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] = 1;
}
else

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

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

				{

				{

					$perms_checked[$forum_permission] = 1;
}
else

					$perms_checked[$forum_permission] = 1;
}
else

Zeile 1018Zeile 1023
	$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)

Zeile 1030Zeile 1035
		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")

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

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

Zeile 1043Zeile 1048
		$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

			$errors[] = $lang->error_forum_parent_itself;
}
else

Zeile 1068Zeile 1073
		
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 1099
				"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 1104Zeile 1113
			{
// 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);

				

				

				// 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 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 1650Zeile 1660
		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 1926
					$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 2052

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 2111
			{
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 2159
				++$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;
}
}