Zeile 1325 | Zeile 1325 |
---|
} else {
|
} else {
|
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'"); while($child = $db->fetch_array($query))
| $query = $db->simple_select('forums', 'parentlist', "fid='{$pid}'"); $parents = explode(',', $db->fetch_field($query, 'parentlist')); if(in_array($mybb->input['fid'], $parents))
|
{
|
{
|
if($child['fid'] == $pid) { $errors[] = $lang->error_forum_parent_child; break; }
| $errors[] = $lang->error_forum_parent_child;
|
} }
| } }
|
Zeile 1399 | Zeile 1396 |
---|
); $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}'");
// Rebuild the parentlist of all of the subforums of this forum switch($db->type)
|
// Update the parentlist of this forum. $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)
|
{
| {
|
case "sqlite": case "pgsql": $query = $db->simple_select("forums", "fid", "','||parentlist||',' LIKE '%,$fid,%'"); break; default: $query = $db->simple_select("forums", "fid", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'");
|
case "sqlite": case "pgsql": $query = $db->simple_select("forums", "fid", "','||parentlist||',' LIKE '%,$fid,%'"); break; default: $query = $db->simple_select("forums", "fid", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'");
|
}
| }
|
while($child = $db->fetch_array($query)) { $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'");
|
while($child = $db->fetch_array($query)) { $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'");
|
} }
$inherit = $mybb->input['default_permissions'];
| } }
$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_
| 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_
|
Zeile 1511 | Zeile 1508 |
---|
$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))
|
{
| {
|
$existing_permissions[$existing['gid']] = $existing; }
| $existing_permissions[$existing['gid']] = $existing; }
|
Zeile 1867 | Zeile 1864 |
---|
if(!$mod['mid']) { flash_message($lang->error_invalid_moderator, 'error');
|
if(!$mod['mid']) { flash_message($lang->error_invalid_moderator, 'error');
|
admin_redirect("index.php?module=forum-management&fid={$fid}"); }
// User clicked no if($mybb->input['no'])
| admin_redirect("index.php?module=forum-management&fid={$fid}"); }
// User clicked no if($mybb->input['no'])
|
{ admin_redirect("index.php?module=forum-management&fid={$fid}"); }
| { admin_redirect("index.php?module=forum-management&fid={$fid}"); }
|
Zeile 2222 | Zeile 2219 |
---|
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']);
|
} } }
$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";
if($fid) { $page->add_breadcrumb_item($lang->view_forum, "index.php?module=forum-management"); }
| } } }
$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";
if($fid) { $page->add_breadcrumb_item($lang->view_forum, "index.php?module=forum-management"); }
|
$page->output_header($lang->forum_management);
if($fid)
| $page->output_header($lang->forum_management);
if($fid)
|
Zeile 2277 | Zeile 2274 |
---|
$submit_options = array();
if($form_container->num_rows() == 0)
|
$submit_options = array();
if($form_container->num_rows() == 0)
|
{
| {
|
$form_container->output_cell($lang->no_forums, array('colspan' => 3)); $form_container->construct_row(); $submit_options = array('disabled' => true);
| $form_container->output_cell($lang->no_forums, array('colspan' => 3)); $form_container->construct_row(); $submit_options = array('disabled' => true);
|
Zeile 2361 | Zeile 2358 |
---|
{ $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true;
|
{ $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true;
|
} }
if(!$perms) { $perms = $usergroup; $default_checked = true;
| } }
if(!$perms) { $perms = $usergroup; $default_checked = true;
|
} } else
| } } else
|
Zeile 2412 | Zeile 2409 |
---|
if($perms[$forum_permission] == 1) { $perms_checked[$forum_permission] = 1;
|
if($perms[$forum_permission] == 1) { $perms_checked[$forum_permission] = 1;
|
}
| }
|
else { $perms_checked[$forum_permission] = 0;
| else { $perms_checked[$forum_permission] = 0;
|
Zeile 2595 | Zeile 2592 |
---|
<script type="text/javascript"> <!-- $("#username").select2({
|
<script type="text/javascript"> <!-- $("#username").select2({
|
placeholder: "'.$lang->search_user.'", minimumInputLength: 3, maximumSelectionSize: 3,
| placeholder: "'.$lang->search_for_a_user.'", minimumInputLength: 2,
|
multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
| multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
|
Zeile 2645 | Zeile 2641 |
---|
}
/**
|
}
/**
|
*
| * @param DefaultFormContainer $form_container * @param int $pid * @param int $depth
|
*/ function build_admincp_forums_list(&$form_container, $pid=0, $depth=1) {
| */ function build_admincp_forums_list(&$form_container, $pid=0, $depth=1) {
|
Zeile 2655 | Zeile 2653 |
---|
if(!is_array($forums_by_parent)) { $forum_cache = cache_forums();
|
if(!is_array($forums_by_parent)) { $forum_cache = cache_forums();
|
|
|
foreach($forum_cache as $forum) { $forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
|
foreach($forum_cache as $forum) { $forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
|
} }
| } }
|
if(!is_array($forums_by_parent[$pid]))
|
if(!is_array($forums_by_parent[$pid]))
|
{
| {
|
return; }
| return; }
|
Zeile 2676 | Zeile 2674 |
---|
if($forum['active'] == 0) { $forum['name'] = "<em>".$forum['name']."</em>";
|
if($forum['active'] == 0) { $forum['name'] = "<em>".$forum['name']."</em>";
|
}
| }
|
if($forum['type'] == "c" && ($depth == 1 || $depth == 2)) { $sub_forums = ''; if(isset($forums_by_parent[$forum['fid']]) && $depth == 2)
|
if($forum['type'] == "c" && ($depth == 1 || $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, $forum['fid'], $depth+1);
|
}
| }
|
if($sub_forums) { $sub_forums = "<br /><small>{$lang->sub_forums}: {$sub_forums}</small>";
| if($sub_forums) { $sub_forums = "<br /><small>{$lang->sub_forums}: {$sub_forums}</small>";
|
Zeile 2693 | Zeile 2691 |
---|
$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&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("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&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"));
|
$popup = new PopupMenu("forum_{$forum['fid']}", $lang->options);
| $popup = new PopupMenu("forum_{$forum['fid']}", $lang->options);
|
$popup->add_item($lang->edit_forum, "index.php?module=forum-management&action=edit&fid={$forum['fid']}"); $popup->add_item($lang->subforums, "index.php?module=forum-management&fid={$forum['fid']}"); $popup->add_item($lang->moderators, "index.php?module=forum-management&fid={$forum['fid']}#tab_moderators");
| $popup->add_item($lang->edit_forum, "index.php?module=forum-management&action=edit&fid={$forum['fid']}"); $popup->add_item($lang->subforums, "index.php?module=forum-management&fid={$forum['fid']}"); $popup->add_item($lang->moderators, "index.php?module=forum-management&fid={$forum['fid']}#tab_moderators");
|
Zeile 2703 | Zeile 2701 |
---|
$popup->add_item($lang->copy_forum, "index.php?module=forum-management&action=copy&fid={$forum['fid']}"); $popup->add_item($lang->delete_forum, "index.php?module=forum-management&action=delete&fid={$forum['fid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");
|
$popup->add_item($lang->copy_forum, "index.php?module=forum-management&action=copy&fid={$forum['fid']}"); $popup->add_item($lang->delete_forum, "index.php?module=forum-management&action=delete&fid={$forum['fid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");
|
$form_container->output_cell($popup->fetch(), array("class" => "align_center"));
| $form_container->output_cell($popup->fetch(), array("class" => "align_center"));
|
$form_container->construct_row();
// Does this category have any sub forums? if($forums_by_parent[$forum['fid']])
|
$form_container->construct_row();
// 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, $forum['fid'], $depth+1);
|
} } elseif($forum['type'] == "f" && ($depth == 1 || $depth == 2))
| } } elseif($forum['type'] == "f" && ($depth == 1 || $depth == 2))
|
Zeile 2744 | Zeile 2742 |
---|
$popup->add_item($lang->copy_forum, "index.php?module=forum-management&action=copy&fid={$forum['fid']}"); $popup->add_item($lang->delete_forum, "index.php?module=forum-management&action=delete&fid={$forum['fid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");
|
$popup->add_item($lang->copy_forum, "index.php?module=forum-management&action=copy&fid={$forum['fid']}"); $popup->add_item($lang->delete_forum, "index.php?module=forum-management&action=delete&fid={$forum['fid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_forum_deletion}')");
|
$form_container->output_cell($popup->fetch(), array("class" => "align_center"));
| $form_container->output_cell($popup->fetch(), array("class" => "align_center"));
|
$form_container->construct_row();
if(isset($forums_by_parent[$forum['fid']]) && $depth == 1)
|
$form_container->construct_row();
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, $forum['fid'], $depth+1); } }
|
Zeile 2759 | Zeile 2757 |
---|
{ $sub_forums .= "{$comma} <a href=\"index.php?module=forum-management&fid={$forum['fid']}\">{$forum['name']}</a>"; $comma = $lang->comma;
|
{ $sub_forums .= "{$comma} <a href=\"index.php?module=forum-management&fid={$forum['fid']}\">{$forum['name']}</a>"; $comma = $lang->comma;
|
}
| }
|
// Have we reached our max visible subforums? put a nice message and break out of the loop ++$donecount;
| // Have we reached our max visible subforums? put a nice message and break out of the loop ++$donecount;
|
Zeile 2776 | Zeile 2774 |
---|
} }
|
} }
|
| /** * @param int $gid * @param int $fid * * @return string */
|
function retrieve_single_permissions_row($gid, $fid) { global $mybb, $lang, $cache, $db;
| function retrieve_single_permissions_row($gid, $fid) { global $mybb, $lang, $cache, $db;
|