Zeile 167 | Zeile 167 |
---|
// Log admin action (no group permissions) log_admin_action($from, $from_forum['name'], $to, $new_forum['name']); }
|
// Log admin action (no group permissions) log_admin_action($from, $from_forum['name'], $to, $new_forum['name']); }
|
| $plugins->run_hooks("admin_forum_management_copy_commit");
|
$cache->update_forums(); $cache->update_forumpermissions();
|
$cache->update_forums(); $cache->update_forumpermissions();
|
$plugins->run_hooks("admin_forum_management_copy_commit");
| |
flash_message($lang->success_forum_copied, 'success'); admin_redirect("index.php?module=forum-management&action=edit&fid={$to}");
|
flash_message($lang->success_forum_copied, 'success'); admin_redirect("index.php?module=forum-management&action=edit&fid={$to}");
|
} }
| } }
|
$page->add_breadcrumb_item($lang->copy_forum); $page->output_header($lang->copy_forum); $page->output_nav_tabs($sub_tabs, 'copy_forum');
|
$page->add_breadcrumb_item($lang->copy_forum); $page->output_header($lang->copy_forum); $page->output_nav_tabs($sub_tabs, 'copy_forum');
|
|
|
$form = new Form("index.php?module=forum-management&action=copy", "post");
if($errors)
| $form = new Form("index.php?module=forum-management&action=copy", "post");
if($errors)
|
Zeile 195 | Zeile 196 |
---|
$copy_data['description'] = "";
if(!$mybb->input['pid'])
|
$copy_data['description'] = "";
if(!$mybb->input['pid'])
|
{
| {
|
$copy_data['pid'] = "-1"; } else
| $copy_data['pid'] = "-1"; } else
|
Zeile 206 | Zeile 207 |
---|
$copy_data['from'] = $mybb->input['fid']; $copy_data['copyforumsettings'] = 0; $copy_data['pid'] = 0;
|
$copy_data['from'] = $mybb->input['fid']; $copy_data['copyforumsettings'] = 0; $copy_data['pid'] = 0;
|
}
| }
|
$types = array( 'f' => $lang->forum, 'c' => $lang->category
| $types = array( 'f' => $lang->forum, 'c' => $lang->category
|
Zeile 330 | Zeile 331 |
---|
'canmanagereportedposts' => (int)$mybb->input['canmanagereportedposts'], 'canviewmodlog' => (int)$mybb->input['canviewmodlog'] );
|
'canmanagereportedposts' => (int)$mybb->input['canmanagereportedposts'], 'canviewmodlog' => (int)$mybb->input['canviewmodlog'] );
|
| $plugins->run_hooks("admin_forum_management_editmod_commit");
|
$db->update_query("moderators", $update_array, "mid='".$mybb->get_input('mid', 1)."'");
$cache->update_moderators();
|
$db->update_query("moderators", $update_array, "mid='".$mybb->get_input('mid', 1)."'");
$cache->update_moderators();
|
$plugins->run_hooks("admin_forum_management_editmod_commit");
| |
// Log admin action log_admin_action($fid, $forum['name'], $mid, $mod[$fieldname]);
| // Log admin action log_admin_action($fid, $forum['name'], $mid, $mod[$fieldname]);
|
Zeile 412 | Zeile 414 |
---|
$form_container->output_row($lang->moderator_cp_permissions, $lang->moderator_cp_permissions_desc, "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_cp_permissions)."</div>");
$form_container->end();
|
$form_container->output_row($lang->moderator_cp_permissions, $lang->moderator_cp_permissions_desc, "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_cp_permissions)."</div>");
$form_container->end();
|
|
|
$buttons[] = $form->generate_submit_button($lang->save_mod); $form->output_submit_wrapper($buttons); $form->end();
|
$buttons[] = $form->generate_submit_button($lang->save_mod); $form->output_submit_wrapper($buttons); $form->end();
|
|
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 431 | Zeile 433 |
---|
{ admin_redirect("index.php?module=forum-management&fid={$fid}"); }
|
{ admin_redirect("index.php?module=forum-management&fid={$fid}"); }
|
|
|
$plugins->run_hooks("admin_forum_management_deletemod");
if($mybb->request_method == "post")
| $plugins->run_hooks("admin_forum_management_deletemod");
if($mybb->request_method == "post")
|
Zeile 451 | Zeile 453 |
---|
else { $db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'");
|
else { $db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'");
|
}
$cache->update_forumpermissions();
| }
$cache->update_forumpermissions();
|
flash_message($lang->success_custom_permission_cleared, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); } else
|
flash_message($lang->success_custom_permission_cleared, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); } else
|
{
| {
|
$page->output_confirm_action("index.php?module=forum-management&action=clear_permission&pid={$pid}&gid={$gid}&fid={$fid}", $lang->confirm_clear_custom_permission); } }
| $page->output_confirm_action("index.php?module=forum-management&action=clear_permission&pid={$pid}&gid={$gid}&fid={$fid}", $lang->confirm_clear_custom_permission); } }
|
Zeile 474 | Zeile 476 |
---|
$fid = $mybb->get_input('fid', 1); $gid = (int)$mybb->input['gid']; $forum = get_forum($fid);
|
$fid = $mybb->get_input('fid', 1); $gid = (int)$mybb->input['gid']; $forum = get_forum($fid);
|
|
|
if((!$fid || !$gid) && $pid) { $query = $db->simple_select("forumpermissions", "fid, gid", "pid='{$pid}'");
| if((!$fid || !$gid) && $pid) { $query = $db->simple_select("forumpermissions", "fid, gid", "pid='{$pid}'");
|
Zeile 494 | Zeile 496 |
---|
if(strpos($field['Field'], 'can') !== false || strpos($field['Field'], 'mod') !== false) { if(array_key_exists($field['Field'], $mybb->input['permissions']))
|
if(strpos($field['Field'], 'can') !== false || strpos($field['Field'], 'mod') !== false) { if(array_key_exists($field['Field'], $mybb->input['permissions']))
|
{
| {
|
$update_array[$db->escape_string($field['Field'])] = (int)$mybb->input['permissions'][$field['Field']]; } else { $update_array[$db->escape_string($field['Field'])] = 0; }
|
$update_array[$db->escape_string($field['Field'])] = (int)$mybb->input['permissions'][$field['Field']]; } else { $update_array[$db->escape_string($field['Field'])] = 0; }
|
} } }
| } } }
|
else { // Else, we assume that the group has no permissions...
| else { // Else, we assume that the group has no permissions...
|
Zeile 521 | Zeile 523 |
---|
$update_array['fid'] = $fid; $update_array['gid'] = (int)$mybb->input['gid']; $db->insert_query("forumpermissions", $update_array);
|
$update_array['fid'] = $fid; $update_array['gid'] = (int)$mybb->input['gid']; $db->insert_query("forumpermissions", $update_array);
|
} else
| }
$plugins->run_hooks("admin_forum_management_permissions_commit");
if(!($fid && !$pid))
|
{ $db->update_query("forumpermissions", $update_array, "pid='{$pid}'"); }
$cache->update_forumpermissions();
|
{ $db->update_query("forumpermissions", $update_array, "pid='{$pid}'"); }
$cache->update_forumpermissions();
|
$plugins->run_hooks("admin_forum_management_permissions_commit");
| |
// Log admin action log_admin_action($fid, $forum['name']);
| // Log admin action log_admin_action($fid, $forum['name']);
|
Zeile 570 | Zeile 573 |
---|
'link' => "index.php?module=forum-management&action=permissions&pid=".$mybb->get_input('pid', 1), 'description' => $lang->forum_permissions_desc );
|
'link' => "index.php?module=forum-management&action=permissions&pid=".$mybb->get_input('pid', 1), 'description' => $lang->forum_permissions_desc );
|
|
|
$page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions"); }
| $page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions"); }
|
Zeile 609 | Zeile 612 |
---|
// --> </script> <div style=\"overflow-y: auto; max-height: 400px\">";
|
// --> </script> <div style=\"overflow-y: auto; max-height: 400px\">";
|
}
| }
|
if($mybb->input['pid'] || ($mybb->input['gid'] && $mybb->input['fid'])) { if($mybb->input['ajax'] != 1) { $form = new Form("index.php?module=forum-management&action=permissions", "post");
|
if($mybb->input['pid'] || ($mybb->input['gid'] && $mybb->input['fid'])) { if($mybb->input['ajax'] != 1) { $form = new Form("index.php?module=forum-management&action=permissions", "post");
|
} else {
| } else {
|
$form = new Form("index.php?module=forum-management&action=permissions&ajax=1&pid=".$mybb->get_input('pid', 1)."&gid=".(int)$mybb->input['gid']."&fid=".(int)$mybb->input['gid'], "post", "modal_form"); } echo $form->generate_hidden_field("usecustom", "1");
| $form = new Form("index.php?module=forum-management&action=permissions&ajax=1&pid=".$mybb->get_input('pid', 1)."&gid=".(int)$mybb->input['gid']."&fid=".(int)$mybb->input['gid'], "post", "modal_form"); } echo $form->generate_hidden_field("usecustom", "1");
|
Zeile 627 | Zeile 630 |
---|
{ $page->output_inline_error($errors); $permission_data = $mybb->input;
|
{ $page->output_inline_error($errors); $permission_data = $mybb->input;
|
|
|
$query = $db->simple_select("usergroups", "*", "gid='{$permission_data['gid']}'"); $usergroup = $db->fetch_array($query);
| $query = $db->simple_select("usergroups", "*", "gid='{$permission_data['gid']}'"); $usergroup = $db->fetch_array($query);
|
Zeile 647 | Zeile 650 |
---|
else { $query = $db->simple_select("forumpermissions", "*", "fid='{$fid}' AND gid='{$gid}'", array('limit' => 1));
|
else { $query = $db->simple_select("forumpermissions", "*", "fid='{$fid}' AND gid='{$gid}'", array('limit' => 1));
|
}
| }
|
$permission_data = $db->fetch_array($query);
| $permission_data = $db->fetch_array($query);
|
Zeile 724 | Zeile 727 |
---|
'canvotepolls' => 'polls', 'cansearch' => 'misc', );
|
'canvotepolls' => 'polls', 'cansearch' => 'misc', );
|
|
|
$groups = $plugins->run_hooks("admin_forum_management_permission_groups", $groups);
$tabs = array();
| $groups = $plugins->run_hooks("admin_forum_management_permission_groups", $groups);
$tabs = array();
|
Zeile 778 | Zeile 781 |
---|
if($mybb->input['ajax'] == 1) {
|
if($mybb->input['ajax'] == 1) {
|
$buttons[] = $form->generate_submit_button($lang->cancel, array('onclick' => '$.modal.close();'));
| $buttons[] = $form->generate_submit_button($lang->cancel, array('onclick' => '$.modal.close(); return false;'));
|
$buttons[] = $form->generate_submit_button($lang->save_permissions, array('id' => 'savePermissions')); $form->output_submit_wrapper($buttons); $form->end();
| $buttons[] = $form->generate_submit_button($lang->save_permissions, array('id' => 'savePermissions')); $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 803 | Zeile 806 |
---|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_forum_management_add");
|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_forum_management_add");
|
if($mybb->request_method == "post") { if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title; }
$pid = $mybb->get_input('pid', 1); $type = $mybb->input['type'];
if($pid <= 0 && $type == "f") { $errors[] = $lang->error_no_parent; }
if(!$errors) { if($pid < 0) { $pid = 0;
| if($mybb->request_method == "post") { if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title; }
$pid = $mybb->get_input('pid', 1); $type = $mybb->input['type'];
if($pid <= 0 && $type == "f") { $errors[] = $lang->error_no_parent; }
if(!$errors) { if($pid < 0) { $pid = 0;
|
} $insert_array = array( "name" => $db->escape_string($mybb->input['title']),
| } $insert_array = array( "name" => $db->escape_string($mybb->input['title']),
|
Zeile 864 | Zeile 867 |
---|
$inherit = $mybb->input['default_permissions'];
foreach($mybb->input as $id => $permission)
|
$inherit = $mybb->input['default_permissions'];
foreach($mybb->input as $id => $permission)
|
{
| {
|
if(strpos($id, 'fields_') === false) { continue;
|
if(strpos($id, 'fields_') === false) { continue;
|
}
list(, $gid) = explode('fields_', $id);
| }
list(, $gid) = explode('fields_', $id);
|
// If it isn't an array then it came from the javascript form if(!is_array($permission)) {
| // If it isn't an array then it came from the javascript form if(!is_array($permission)) {
|
Zeile 895 | Zeile 898 |
---|
} } }
|
} } }
|
$cache->update_forums();
| |
$canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
| $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
|
Zeile 906 | Zeile 907 |
---|
save_quick_perms($fid);
$plugins->run_hooks("admin_forum_management_add_commit");
|
save_quick_perms($fid);
$plugins->run_hooks("admin_forum_management_add_commit");
|
| $cache->update_forums();
|
// Log admin action log_admin_action($fid, $insert_array['name']);
| // Log admin action log_admin_action($fid, $insert_array['name']);
|
Zeile 995 | Zeile 998 |
---|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $forum_data['disporder'], array('id' => 'disporder')), 'disporder');
| $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $forum_data['disporder'], array('id' => 'disporder')), 'disporder');
|
$form_container->end();
echo "<div id=\"additional_options_link\"><strong><a href=\"#\" onclick=\"$('#additional_options_link').toggle(); $('#additional_options').fadeToggle('fast'); return false;\">{$lang->show_additional_options}</a></strong><br /><br /></div>";
| $form_container->end();
echo "<div id=\"additional_options_link\"><strong><a href=\"#\" onclick=\"$('#additional_options_link').toggle(); $('#additional_options').fadeToggle('fast'); return false;\">{$lang->show_additional_options}</a></strong><br /><br /></div>";
|
Zeile 1111 | Zeile 1114 |
---|
'canpostthreads' => $lang->permissions_canpostthreads, 'canpostreplys' => $lang->permissions_canpostreplys, 'canpostpolls' => $lang->permissions_canpostpolls,
|
'canpostthreads' => $lang->permissions_canpostthreads, 'canpostreplys' => $lang->permissions_canpostreplys, 'canpostpolls' => $lang->permissions_canpostpolls,
|
);
| );
|
$field_list2 = array( 'canview' => $lang->perm_drag_canview,
| $field_list2 = array( 'canview' => $lang->perm_drag_canview,
|
Zeile 1130 | Zeile 1133 |
---|
if($mybb->request_method == "post") { foreach($usergroups as $usergroup)
|
if($mybb->request_method == "post") { foreach($usergroups as $usergroup)
|
{
| {
|
if(isset($mybb->input['fields_'.$usergroup['gid']])) { $input_permissions = $mybb->input['fields_'.$usergroup['gid']]; if(!is_array($input_permissions))
|
if(isset($mybb->input['fields_'.$usergroup['gid']])) { $input_permissions = $mybb->input['fields_'.$usergroup['gid']]; if(!is_array($input_permissions))
|
{
| {
|
// Convering the comma separated list from Javascript form into a variable $input_permissions = explode(',' , $input_permissions); }
| // Convering the comma separated list from Javascript form into a variable $input_permissions = explode(',' , $input_permissions); }
|
Zeile 1151 | Zeile 1154 |
---|
{ $perms = array(); if(isset($mybb->input['default_permissions']) && $mybb->input['default_permissions'][$usergroup['gid']])
|
{ $perms = array(); if(isset($mybb->input['default_permissions']) && $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 1160 | Zeile 1163 |
---|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
$default_checked = true; }
| $default_checked = true; }
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
| else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
|
Zeile 1170 | Zeile 1173 |
---|
}
if(!$perms)
|
}
if(!$perms)
|
{
| {
|
$perms = $usergroup; $default_checked = true; }
| $perms = $usergroup; $default_checked = true; }
|
Zeile 1184 | Zeile 1187 |
---|
$default_checked = true; } else
|
$default_checked = true; } else
|
{
| {
|
$default_checked = false;
|
$default_checked = false;
|
}
| }
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
{ $perms_checked[$forum_permission] = 1; }
| { $perms_checked[$forum_permission] = 1; }
|
else { $perms_checked[$forum_permission] = 0;
| else { $perms_checked[$forum_permission] = 0;
|
Zeile 1310 | Zeile 1313 |
---|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
}
$pid = $mybb->get_input('pid', 1);
| }
$pid = $mybb->get_input('pid', 1);
|
if($pid == $mybb->input['fid']) {
| if($pid == $mybb->input['fid']) {
|
Zeile 1328 | Zeile 1331 |
---|
$errors[] = $lang->error_forum_parent_child; break; }
|
$errors[] = $lang->error_forum_parent_child; break; }
|
}
| }
|
}
$type = $mybb->input['type'];
| }
$type = $mybb->input['type'];
|
Zeile 1353 | Zeile 1356 |
---|
if($db->fetch_field($query, "num_threads") > 0) { $errors[] = $lang->error_forum_link_not_empty;
|
if($db->fetch_field($query, "num_threads") > 0) { $errors[] = $lang->error_forum_link_not_empty;
|
}
| }
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 1475 | Zeile 1478 |
---|
flash_message($lang->success_forum_updated, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}");
|
flash_message($lang->success_forum_updated, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}");
|
} }
$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";
| } }
$page->extra_header .= "<script src=\"jscripts/quick_perm_editor.js\" type=\"text/javascript\"></script>\n";
|
$page->add_breadcrumb_item($lang->edit_forum); $page->output_header($lang->edit_forum);
| $page->add_breadcrumb_item($lang->edit_forum); $page->output_header($lang->edit_forum);
|
Zeile 1537 | Zeile 1540 |
---|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
$form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $forum_data['disporder'], array('id' => 'disporder')), 'disporder');
| $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $forum_data['disporder'], array('id' => 'disporder')), 'disporder');
|
$form_container->end();
$form_container = new FormContainer($lang->additional_forum_options);
| $form_container->end();
$form_container = new FormContainer($lang->additional_forum_options);
|
Zeile 1897 | Zeile 1900 |
---|
$mod = $db->fetch_array($query);
$db->delete_query("moderators", "mid='{$mid}'");
|
$mod = $db->fetch_array($query);
$db->delete_query("moderators", "mid='{$mid}'");
|
$cache->update_moderators();
|
|
$plugins->run_hooks("admin_forum_management_deletemod_commit");
|
$plugins->run_hooks("admin_forum_management_deletemod_commit");
|
| $cache->update_moderators();
|
$forum = get_forum($fid);
| $forum = get_forum($fid);
|
Zeile 1952 | Zeile 1956 |
---|
// Delete the forum $db->delete_query("forums", "fid='$fid'");
|
// Delete the forum $db->delete_query("forums", "fid='$fid'");
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
case "sqlite": $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'"); break;
| case "sqlite": $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'"); break;
|
Zeile 1987 | Zeile 1991 |
---|
$db->delete_query("posts", "fid='{$fid}' {$delquery}"); $db->delete_query("moderators", "fid='{$fid}' {$delquery}"); $db->delete_query("forumsubscriptions", "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_forumpermissions();
| |
$update_stats = array( 'numthreads' => "-".$stats['threads'],
| $update_stats = array( 'numthreads' => "-".$stats['threads'],
|
Zeile 1999 | Zeile 1999 |
---|
'numunapprovedposts' => "-".$stats['unapprovedposts'] ); update_stats($update_stats);
|
'numunapprovedposts' => "-".$stats['unapprovedposts'] ); update_stats($update_stats);
|
|
|
$plugins->run_hooks("admin_forum_management_delete_commit");
|
$plugins->run_hooks("admin_forum_management_delete_commit");
|
| $cache->update_forums(); $cache->update_moderators(); $cache->update_forumpermissions();
|
// 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 2073 | Zeile 2077 |
---|
} } }
|
} } }
|
$cache->update_forums();
| |
$canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
| $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
|
Zeile 2085 | Zeile 2087 |
---|
save_quick_perms($fid);
$plugins->run_hooks("admin_forum_management_start_permissions_commit");
|
save_quick_perms($fid);
$plugins->run_hooks("admin_forum_management_start_permissions_commit");
|
| $cache->update_forums();
|
// Log admin action log_admin_action('quickpermissions', $fid, $forum['name']);
|
// Log admin action log_admin_action('quickpermissions', $fid, $forum['name']);
|
|
|
flash_message($lang->success_forum_permissions_updated, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); }
| flash_message($lang->success_forum_permissions_updated, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); }
|
Zeile 2104 | Zeile 2108 |
---|
{ $isgroup = 1; $gid = (int)$mybb->input['usergroup'];
|
{ $isgroup = 1; $gid = (int)$mybb->input['usergroup'];
|
|
|
if(!$groupscache[$gid]) { // Didn't select a valid moderator
| if(!$groupscache[$gid]) { // Didn't select a valid moderator
|
Zeile 2115 | Zeile 2119 |
---|
$newmod = array( "id" => $gid, "name" => $groupscache[$gid]['title']
|
$newmod = array( "id" => $gid, "name" => $groupscache[$gid]['title']
|
);
| );
|
} else {
| } else {
|
Zeile 2123 | Zeile 2127 |
---|
'fields' => array('uid AS id', 'username AS name') ); $newmod = get_user_by_username($mybb->input['username'], $options);
|
'fields' => array('uid AS id', 'username AS name') ); $newmod = get_user_by_username($mybb->input['username'], $options);
|
|
|
if(empty($newmod['id'])) { flash_message($lang->error_moderator_not_found, 'error');
| if(empty($newmod['id'])) { flash_message($lang->error_moderator_not_found, 'error');
|
Zeile 2134 | Zeile 2138 |
---|
}
if($newmod['id'])
|
}
if($newmod['id'])
|
{ $query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));
| { $query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));
|
if(!$db->num_rows($query)) { $new_mod = array(
| if(!$db->num_rows($query)) { $new_mod = array(
|
Zeile 2173 | Zeile 2177 |
---|
if(!$isgroup) { $db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'");
|
if(!$isgroup) { $db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'");
|
}
$cache->update_moderators(); $plugins->run_hooks("admin_forum_management_start_moderators_commit");
| }
$plugins->run_hooks("admin_forum_management_start_moderators_commit");
$cache->update_moderators();
|
// Log admin action log_admin_action('addmod', $mid, $newmod['name'], $fid, $forum['name']);
flash_message($lang->success_moderator_added, 'success'); admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");
|
// Log admin action log_admin_action('addmod', $mid, $newmod['name'], $fid, $forum['name']);
flash_message($lang->success_moderator_added, 'success'); admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");
|
}
| }
|
else { flash_message($lang->error_moderator_already_added, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");
|
else { flash_message($lang->error_moderator_already_added, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");
|
}
| }
|
} else {
| } else {
|
Zeile 2204 | Zeile 2209 |
---|
{ $db->update_query("forums", array('disporder' => (int)$order), "fid='".(int)$update_fid."'"); }
|
{ $db->update_query("forums", array('disporder' => (int)$order), "fid='".(int)$update_fid."'"); }
|
$cache->update_forums();
| |
$plugins->run_hooks("admin_forum_management_start_disporder_commit");
|
$plugins->run_hooks("admin_forum_management_start_disporder_commit");
|
| $cache->update_forums();
|
// Log admin action log_admin_action('orders', $forum['fid'], $forum['name']);
flash_message($lang->success_forum_disporder_updated, 'success'); admin_redirect("index.php?module=forum-management&fid=".$mybb->input['fid']);
|
// Log admin action log_admin_action('orders', $forum['fid'], $forum['name']);
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";
| } } }
$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");
|
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 2234 | Zeile 2239 |
---|
else { $page->output_nav_tabs($sub_tabs, 'forum_management');
|
else { $page->output_nav_tabs($sub_tabs, 'forum_management');
|
}
| }
|
$form = new Form("index.php?module=forum-management", "post", "management"); echo $form->generate_hidden_field("fid", $mybb->input['fid']);
| $form = new Form("index.php?module=forum-management", "post", "management"); echo $form->generate_hidden_field("fid", $mybb->input['fid']);
|
Zeile 2259 | Zeile 2264 |
---|
else { $form_container = new FormContainer($lang->manage_forums);
|
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'));
build_admincp_forums_list($form_container, $fid);
|
$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);
|
|
|
$submit_options = array();
if($form_container->num_rows() == 0)
| $submit_options = array();
if($form_container->num_rows() == 0)
|
Zeile 2273 | Zeile 2278 |
---|
$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);
|
}
$form_container->end();
| }
$form_container->end();
|
$buttons[] = $form->generate_submit_button($lang->update_forum_orders, $submit_options); $buttons[] = $form->generate_reset_button($lang->reset);
| $buttons[] = $form->generate_submit_button($lang->update_forum_orders, $submit_options); $buttons[] = $form->generate_reset_button($lang->reset);
|
Zeile 2300 | Zeile 2305 |
---|
$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 2420 | Zeile 2425 |
---|
else { $inherited_text = $lang->custom_permission;
|
else { $inherited_text = $lang->custom_permission;
|
}
$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>");
| }
$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>");
|
$field_select = "<div class=\"quick_perm_fields\">\n"; $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n"; foreach($perms_checked as $perm => $value) { if($value == 1)
|
$field_select = "<div class=\"quick_perm_fields\">\n"; $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n"; foreach($perms_checked as $perm => $value) { if($value == 1)
|
{
| {
|
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>"; } }
| $field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>"; } }
|
Zeile 2462 | Zeile 2467 |
---|
if($perms_checked[$forum_permission]) { $field_selected[] = $forum_permission;
|
if($perms_checked[$forum_permission]) { $field_selected[] = $forum_permission;
|
} }
| } }
|
$field_select .= "<noscript>".$form->generate_select_box('fields_'.$usergroup['gid'].'[]', $field_options, $field_selected, array('id' => 'fields_'.$usergroup['gid'].'[]', 'multiple' => true))."</noscript>\n"; $form_container->output_cell($field_select, array('colspan' => 2));
| $field_select .= "<noscript>".$form->generate_select_box('fields_'.$usergroup['gid'].'[]', $field_options, $field_selected, array('id' => 'fields_'.$usergroup['gid'].'[]', 'multiple' => true))."</noscript>\n"; $form_container->output_cell($field_select, array('colspan' => 2));
|
Zeile 2666 | Zeile 2671 |
---|
}
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); } if($sub_forums) { $sub_forums = "<br /><small>{$lang->sub_forums}: {$sub_forums}</small>";
|
build_admincp_forums_list($form_container, $forum['fid'], $depth+1); } if($sub_forums) { $sub_forums = "<br /><small>{$lang->sub_forums}: {$sub_forums}</small>";
|
}
| }
|
$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->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 = 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']}");
|
Zeile 2709 | Zeile 2714 |
---|
}
$sub_forums = '';
|
}
$sub_forums = '';
|
if(isset($forums_by_parent[$forum['fid']]) && $depth == 2) {
| if(isset($forums_by_parent[$forum['fid']]) && $depth == 2) {
|
build_admincp_forums_list($form_container, $forum['fid'], $depth+1); } if($sub_forums)
| build_admincp_forums_list($form_container, $forum['fid'], $depth+1); } if($sub_forums)
|
Zeile 2788 | Zeile 2793 |
---|
);
$field_list2 = array(
|
);
$field_list2 = array(
|
'canview' => $lang->permissions_canview, 'canpostthreads' => $lang->permissions_canpostthreads, 'canpostreplys' => $lang->permissions_canpostreplys, 'canpostpolls' => $lang->permissions_canpostpolls,
| 'canview' => $lang->perm_drag_canview, 'canpostthreads' => $lang->perm_drag_canpostthreads, 'canpostreplys' => $lang->perm_drag_canpostreplys, 'canpostpolls' => $lang->perm_drag_canpostpolls,
|
);
$form = new Form('', '', "", 0, "", true);
| );
$form = new Form('', '', "", 0, "", true);
|