Vergleich admin/modules/forum/management.php - 1.8.7 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 590Zeile 590
		<script src=\"jscripts/tabs.js\" type=\"text/javascript\"></script>\n
<script type=\"text/javascript\">
<!--

		<script src=\"jscripts/tabs.js\" type=\"text/javascript\"></script>\n
<script type=\"text/javascript\">
<!--

$(document).ready(function() {

$(function() {

	$(\"#modal_form\").on(\"click\", \"#savePermissions\", function(e) {
e.preventDefault();


	$(\"#modal_form\").on(\"click\", \"#savePermissions\", function(e) {
e.preventDefault();


Zeile 719Zeile 719
			'candeleteposts' => 'editing',
'candeletethreads' => 'editing',
'caneditattachments' => 'editing',

			'candeleteposts' => 'editing',
'candeletethreads' => 'editing',
'caneditattachments' => 'editing',

 
			'canviewdeletionnotice' => 'editing',


'modposts' => 'moderate',
'modthreads' => 'moderate',


'modposts' => 'moderate',
'modthreads' => 'moderate',

Zeile 1950Zeile 1951
		$fid = $mybb->get_input('fid', MyBB::INPUT_INT);
$forum_info = get_forum($fid);


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


		$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'");
$stats = $db->fetch_array($query);

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


		$delquery = "";






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

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

Zeile 1969Zeile 1965
		{
$fids[$forum['fid']] = $fid;
$delquery .= " OR fid='{$forum['fid']}'";

		{
$fids[$forum['fid']] = $fid;
$delquery .= " OR fid='{$forum['fid']}'";


$stats['posts'] += $forum['posts'];
$stats['unapprovedposts'] += $forum['unapprovedposts'];
$stats['threads'] += $forum['threads'];
$stats['unapprovedthreads'] += $forum['unapprovedthreads'];

 
		}


		}


 
		require_once MYBB_ROOT.'inc/class_moderation.php';
$moderation = new Moderation();

// Start pagination. Limit results to 50
$query = $db->simple_select("threads", "tid", "fid='{$fid}' {$delquery}", array("limit" => 50));

while($tid = $db->fetch_field($query, 'tid'))
{
$moderation->delete_thread($tid);
}

// Check whether all threads have been deleted
$query = $db->simple_select("threads", "tid", "fid='{$fid}' {$delquery}");

if($db->num_rows($query) > 0)
{
$page->output_header();

$form = new Form("index.php?module=forum-management", 'post');

echo $form->generate_hidden_field("fid", $fid);
echo $form->generate_hidden_field("action", "delete");
output_auto_redirect($form, $lang->confirm_proceed_deletion);

$form->end();

$page->output_footer();
exit;
}

// End pagination

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

// Delete subforums

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

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

Zeile 1986Zeile 2013
				$db->delete_query("forums", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'");
}


				$db->delete_query("forums", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'");
}


		$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}");
$db->delete_query("forumpermissions", "fid='{$fid}' {$delquery}");

$update_stats = array(
'numthreads' => "-".$stats['threads'],
'numunapprovedthreads' => "-".$stats['unapprovedthreads'],
'numposts' => "-".$stats['posts'],
'numunapprovedposts' => "-".$stats['unapprovedposts']
);
update_stats($update_stats);

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










$plugins->run_hooks("admin_forum_management_delete_commit");

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


$plugins->run_hooks("admin_forum_management_delete_commit");

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

 
		$cache->update_forumsdisplay();


// Log admin action
log_admin_action($forum_info['fid'], $forum_info['name']);


// Log admin action
log_admin_action($forum_info['fid'], $forum_info['name']);

Zeile 2061Zeile 2081
					$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					{

					{

						$permission[$name] = 1;
}
}

						$permission[$name] = 1;
}
}

Zeile 2250Zeile 2270
			'subforums' => $lang->subforums,
'permissions' => $lang->forum_permissions,
'moderators' => $lang->moderators,

			'subforums' => $lang->subforums,
'permissions' => $lang->forum_permissions,
'moderators' => $lang->moderators,

		);

		);

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


Zeile 2262Zeile 2282
		$form_container = new FormContainer($lang->sprintf($lang->in_forums, $forum_cache[$fid]['name']));
}
else

		$form_container = new FormContainer($lang->sprintf($lang->in_forums, $forum_cache[$fid]['name']));
}
else

	{

	{

		$form_container = new FormContainer($lang->manage_forums);
}
$form_container->output_row_header($lang->forum);
$form_container->output_row_header($lang->order, array("class" => "align_center", 'width' => '5%'));
$form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));


		$form_container = new FormContainer($lang->manage_forums);
}
$form_container->output_row_header($lang->forum);
$form_container->output_row_header($lang->order, array("class" => "align_center", 'width' => '5%'));
$form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));


	build_admincp_forums_list($form_container, $fid);

	build_admincp_forums_list($form_container, $form, $fid);


$submit_options = array();



$submit_options = array();


Zeile 2345Zeile 2365
				if($mybb->input['default_permissions'][$usergroup['gid']])
{
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

				if($mybb->input['default_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 2531Zeile 2551
				$form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$moderator['id']}\">".htmlspecialchars_uni($moderator['username'])."</a>");
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=editmod&amp;mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center"));
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=deletemod&amp;id={$moderator['id']}&amp;isgroup=0&amp;fid={$fid}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));

				$form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$moderator['id']}\">".htmlspecialchars_uni($moderator['username'])."</a>");
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=editmod&amp;mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center"));
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=deletemod&amp;id={$moderator['id']}&amp;isgroup=0&amp;fid={$fid}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));

			}
$form_container->construct_row();
}


			}
$form_container->construct_row();
}


		if($form_container->num_rows() == 0)
{
$form_container->output_cell($lang->no_moderators, array('colspan' => 3));

		if($form_container->num_rows() == 0)
{
$form_container->output_cell($lang->no_moderators, array('colspan' => 3));

Zeile 2544Zeile 2564

// Users
$buttons = array();


// Users
$buttons = array();

		$form = new Form("index.php?module=forum-management", "post", "management");
echo $form->generate_hidden_field("fid", $mybb->input['fid']);
echo $form->generate_hidden_field("add", "moderators");

		$form = new Form("index.php?module=forum-management", "post", "management");
echo $form->generate_hidden_field("fid", $mybb->input['fid']);
echo $form->generate_hidden_field("add", "moderators");


// Usergroup Moderator
if(!is_array($usergroups))


// Usergroup Moderator
if(!is_array($usergroups))

Zeile 2557Zeile 2577
		foreach($usergroups as $group)
{
$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".htmlspecialchars_uni($group['title']);

		foreach($usergroups as $group)
{
$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".htmlspecialchars_uni($group['title']);

		}


		}


		if(!isset($mybb->input['usergroup']))
{
$mybb->input['usergroup'] = '';

		if(!isset($mybb->input['usergroup']))
{
$mybb->input['usergroup'] = '';

Zeile 2582Zeile 2602
		echo $form->generate_hidden_field("fid", $mybb->input['fid']);
echo $form->generate_hidden_field("add", "moderators");
$form_container = new FormContainer($lang->add_user_as_moderator);

		echo $form->generate_hidden_field("fid", $mybb->input['fid']);
echo $form->generate_hidden_field("add", "moderators");
$form_container = new FormContainer($lang->add_user_as_moderator);

		$form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');

		$form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', htmlspecialchars_uni($mybb->get_input('username')), array('id' => 'username')), 'username');

		$form_container->end();

// Autocompletion for usernames

		$form_container->end();

// Autocompletion for usernames

Zeile 2606Zeile 2626
				results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};

				results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};

				}
},

				}
},

			initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {

			initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {

Zeile 2619Zeile 2639
					}).done(function(data) { callback(data); });
}
},

					}).done(function(data) { callback(data); });
}
},

		});

		});





		$(\'[for=username]\').click(function(){

		$(\'[for=username]\').on(\'click\', function(){

			$("#username").select2(\'open\');
return false;
});

			$("#username").select2(\'open\');
return false;
});

Zeile 2631Zeile 2651
		$buttons = array($form->generate_submit_button($lang->add_user_moderator));
$form->output_submit_wrapper($buttons);
$form->end();

		$buttons = array($form->generate_submit_button($lang->add_user_moderator));
$form->output_submit_wrapper($buttons);
$form->end();





		echo "</div>\n";

$plugins->run_hooks("admin_forum_management_start_graph");

		echo "</div>\n";

$plugins->run_hooks("admin_forum_management_start_graph");

Zeile 2642Zeile 2662

/**
* @param DefaultFormContainer $form_container


/**
* @param DefaultFormContainer $form_container

 
 * @param DefaultForm $form

 * @param int $pid
* @param int $depth
*/

 * @param int $pid
* @param int $depth
*/

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

function build_admincp_forums_list(&$form_container, &$form, $pid=0, $depth=1)

{
global $mybb, $lang, $db, $sub_forums;
static $forums_by_parent;

{
global $mybb, $lang, $db, $sub_forums;
static $forums_by_parent;

Zeile 2677Zeile 2698
			}

if($forum['type'] == "c" && ($depth == 1 || $depth == 2))

			}

if($forum['type'] == "c" && ($depth == 1 || $depth == 2))

			{
$sub_forums = '';
if(isset($forums_by_parent[$forum['fid']]) && $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, $form, $forum['fid'], $depth+1);

				}
if($sub_forums)
{

				}
if($sub_forums)
{

Zeile 2690Zeile 2711

$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("<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($form->generate_numeric_field("disporder[{$forum['fid']}]", "{$forum['disporder']}", array('min' => 0, 'class' => 'align_center', 'style' => 'width:80%; font-weight:bold')), array("class" => "align_center"));


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

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

				// 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, $form, $forum['fid'], $depth+1);

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

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

Zeile 2718Zeile 2739
					$forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&amp;", $forum['description']);
$forum['description'] = "<br /><small>".$forum['description']."</small>";
}

					$forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&amp;", $forum['description']);
$forum['description'] = "<br /><small>".$forum['description']."</small>";
}





				$sub_forums = '';
if(isset($forums_by_parent[$forum['fid']]) && $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, $form, $forum['fid'], $depth+1);

				}
if($sub_forums)
{

				}
if($sub_forums)
{

Zeile 2731Zeile 2752

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



$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&amp;fid={$forum['fid']}\">{$forum['name']}</a>{$forum['description']}{$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%;\" />", array("class" => "align_center"));


				$form_container->output_cell($form->generate_numeric_field("disporder[{$forum['fid']}]", "{$forum['disporder']}", array('min' => 0, 'class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));


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

Zeile 2748Zeile 2768

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


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, $form, $forum['fid'], $depth+1);

				}
}
else if($depth == 3)

				}
}
else if($depth == 3)