Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: management.php 5620 2011-09-26 18:23:52Z ralgith $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 19 | Zeile 19 |
---|
if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action']) {
|
if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action']) {
|
if($mybb->input['fid'] && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))
| if(!empty($mybb->input['fid']) && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))
|
{ $sub_tabs['view_forum'] = array( 'title' => $lang->view_forum,
| { $sub_tabs['view_forum'] = array( 'title' => $lang->view_forum,
|
Zeile 30 | Zeile 30 |
---|
$sub_tabs['add_child_forum'] = array( 'title' => $lang->add_child_forum, 'link' => "index.php?module=forum-management&action=add&pid=".$mybb->input['fid'],
|
$sub_tabs['add_child_forum'] = array( 'title' => $lang->add_child_forum, 'link' => "index.php?module=forum-management&action=add&pid=".$mybb->input['fid'],
|
'description' => $lang->add_child_forum_desc
| 'description' => $lang->view_forum_desc
|
); $sub_tabs['edit_forum_settings'] = array( 'title' => $lang->edit_forum_settings, 'link' => "index.php?module=forum-management&action=edit&fid=".$mybb->input['fid'], 'description' => $lang->edit_forum_settings_desc
|
); $sub_tabs['edit_forum_settings'] = array( 'title' => $lang->edit_forum_settings, 'link' => "index.php?module=forum-management&action=edit&fid=".$mybb->input['fid'], 'description' => $lang->edit_forum_settings_desc
|
);
| );
|
$sub_tabs['copy_forum'] = array( 'title' => $lang->copy_forum, 'link' => "index.php?module=forum-management&action=copy&fid=".$mybb->input['fid'], 'description' => $lang->copy_forum_desc
|
$sub_tabs['copy_forum'] = array( 'title' => $lang->copy_forum, 'link' => "index.php?module=forum-management&action=copy&fid=".$mybb->input['fid'], 'description' => $lang->copy_forum_desc
|
);
| );
|
} else {
| } else {
|
Zeile 51 | Zeile 51 |
---|
'title' => $lang->forum_management, 'link' => "index.php?module=forum-management", 'description' => $lang->forum_management_desc
|
'title' => $lang->forum_management, 'link' => "index.php?module=forum-management", 'description' => $lang->forum_management_desc
|
);
| );
|
$sub_tabs['add_forum'] = array( 'title' => $lang->add_forum, 'link' => "index.php?module=forum-management&action=add",
| $sub_tabs['add_forum'] = array( 'title' => $lang->add_forum, 'link' => "index.php?module=forum-management&action=add",
|
Zeile 66 | Zeile 66 |
---|
if($mybb->input['action'] == "copy") { $plugins->run_hooks("admin_forum_management_copy");
|
if($mybb->input['action'] == "copy") { $plugins->run_hooks("admin_forum_management_copy");
|
if($mybb->request_method == "post") {
| if($mybb->request_method == "post") {
|
$from = intval($mybb->input['from']); $to = intval($mybb->input['to']);
| $from = intval($mybb->input['from']); $to = intval($mybb->input['to']);
|
Zeile 106 | Zeile 106 |
---|
$new_forum['parentlist'] = ''; $to = $db->insert_query("forums", $new_forum);
|
$new_forum['parentlist'] = ''; $to = $db->insert_query("forums", $new_forum);
|
|
|
// Generate parent list $parentlist = make_parent_list($to); $updatearray = array(
| // Generate parent list $parentlist = make_parent_list($to); $updatearray = array(
|
Zeile 116 | Zeile 116 |
---|
} } elseif($mybb->input['copyforumsettings'] == 1)
|
} } elseif($mybb->input['copyforumsettings'] == 1)
|
{
| {
|
// Copy settings to existing forum $query = $db->simple_select("forums", '*', "fid='{$to}'"); $to_forum = $db->fetch_array($query); if(!$db->num_rows($query))
|
// Copy settings to existing forum $query = $db->simple_select("forums", '*', "fid='{$to}'"); $to_forum = $db->fetch_array($query); if(!$db->num_rows($query))
|
{
| {
|
$errors[] = $lang->error_invalid_destination_forum; }
| $errors[] = $lang->error_invalid_destination_forum; }
|
Zeile 144 | Zeile 144 |
---|
{ // Copy permissions if(is_array($mybb->input['copygroups']) && count($mybb->input['copygroups'] > 0))
|
{ // Copy permissions if(is_array($mybb->input['copygroups']) && count($mybb->input['copygroups'] > 0))
|
{
| {
|
foreach($mybb->input['copygroups'] as $gid) { $groups[] = intval($gid);
| foreach($mybb->input['copygroups'] as $gid) { $groups[] = intval($gid);
|
Zeile 236 | Zeile 236 |
---|
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query)) {
|
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query)) {
|
$usergroups[$usergroup['gid']] = $usergroup['title'];
| $usergroups[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
|
} $form_container = new FormContainer($lang->copy_forum);
| } $form_container = new FormContainer($lang->copy_forum);
|
Zeile 299 | Zeile 299 |
---|
$forum = get_forum($fid); if($mod_data['isgroup']) {
|
$forum = get_forum($fid); if($mod_data['isgroup']) {
|
$mod = $mybb->usergroups[$mod_data['id']];
| $mod = $groupscache[$mod_data['id']];
|
} else {
| } else {
|
Zeile 312 | Zeile 312 |
---|
'canviewips' => intval($mybb->input['canviewips']), 'canopenclosethreads' => intval($mybb->input['canopenclosethreads']), 'canmanagethreads' => intval($mybb->input['canmanagethreads']),
|
'canviewips' => intval($mybb->input['canviewips']), 'canopenclosethreads' => intval($mybb->input['canopenclosethreads']), 'canmanagethreads' => intval($mybb->input['canmanagethreads']),
|
'canmovetononmodforum' => intval($mybb->input['canmovetononmodforum'])
| 'canmovetononmodforum' => intval($mybb->input['canmovetononmodforum']), 'canusecustomtools' => intval($mybb->input['canusecustomtools'])
|
); $db->update_query("moderators", $update_array, "mid='".intval($mybb->input['mid'])."'");
| ); $db->update_query("moderators", $update_array, "mid='".intval($mybb->input['mid'])."'");
|
Zeile 337 | Zeile 338 |
---|
{ $query = $db->simple_select("users", "username", "uid='{$mod_data['id']}'"); $mod_data[$fieldname] = $db->fetch_field($query, 'username');
|
{ $query = $db->simple_select("users", "username", "uid='{$mod_data['id']}'"); $mod_data[$fieldname] = $db->fetch_field($query, 'username');
|
}
| }
|
$sub_tabs = array();
| $sub_tabs = array();
|
Zeile 363 | Zeile 364 |
---|
$form_container = new FormContainer($lang->sprintf($lang->edit_mod_for, $mod_data[$fieldname])); $form_container->output_row($lang->forum, $lang->forum_desc, $form->generate_forum_select('fid', $mod_data['fid'], array('id' => 'fid')), 'fid');
|
$form_container = new FormContainer($lang->sprintf($lang->edit_mod_for, $mod_data[$fieldname])); $form_container->output_row($lang->forum, $lang->forum_desc, $form->generate_forum_select('fid', $mod_data['fid'], array('id' => 'fid')), 'fid');
|
|
|
$moderator_permissions = array( $form->generate_check_box('caneditposts', 1, $lang->can_edit_posts, array('checked' => $mod_data['caneditposts'], 'id' => 'caneditposts')), $form->generate_check_box('candeleteposts', 1, $lang->can_delete_posts, array('checked' => $mod_data['candeleteposts'], 'id' => 'candeleteposts')), $form->generate_check_box('canviewips', 1, $lang->can_view_ips, array('checked' => $mod_data['canviewips'], 'id' => 'canviewips')), $form->generate_check_box('canopenclosethreads', 1, $lang->can_open_close_threads, array('checked' => $mod_data['canopenclosethreads'], 'id' => 'canopenclosethreads')), $form->generate_check_box('canmanagethreads', 1, $lang->can_manage_threads, array('checked' => $mod_data['canmanagethreads'], 'id' => 'canmanagethreads')),
|
$moderator_permissions = array( $form->generate_check_box('caneditposts', 1, $lang->can_edit_posts, array('checked' => $mod_data['caneditposts'], 'id' => 'caneditposts')), $form->generate_check_box('candeleteposts', 1, $lang->can_delete_posts, array('checked' => $mod_data['candeleteposts'], 'id' => 'candeleteposts')), $form->generate_check_box('canviewips', 1, $lang->can_view_ips, array('checked' => $mod_data['canviewips'], 'id' => 'canviewips')), $form->generate_check_box('canopenclosethreads', 1, $lang->can_open_close_threads, array('checked' => $mod_data['canopenclosethreads'], 'id' => 'canopenclosethreads')), $form->generate_check_box('canmanagethreads', 1, $lang->can_manage_threads, array('checked' => $mod_data['canmanagethreads'], 'id' => 'canmanagethreads')),
|
$form->generate_check_box('canmovetononmodforum', 1, $lang->can_move_to_other_forums, array('checked' => $mod_data['canmovetononmodforum'], 'id' => 'canmovetononmodforum'))
| $form->generate_check_box('canmovetononmodforum', 1, $lang->can_move_to_other_forums, array('checked' => $mod_data['canmovetononmodforum'], 'id' => 'canmovetononmodforum')), $form->generate_check_box('canusecustomtools', 1, $lang->can_use_custom_tools, array('checked' => $mod_data['canusecustomtools'], 'id' => 'canusecustomtools'))
|
); $form_container->output_row($lang->moderator_permissions, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_permissions)."</div>");
| ); $form_container->output_row($lang->moderator_permissions, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_permissions)."</div>");
|
Zeile 391 | Zeile 393 |
---|
$pid = intval($mybb->input['pid']); $fid = intval($mybb->input['fid']); $gid = intval($mybb->input['gid']);
|
$pid = intval($mybb->input['pid']); $fid = intval($mybb->input['fid']); $gid = intval($mybb->input['gid']);
|
|
|
// User clicked no if($mybb->input['no'])
|
// 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}");
|
} if($mybb->request_method == "post") { if((!$fid || !$gid) && $pid) { $query = $db->simple_select("forumpermissions", "fid, gid", "pid='{$pid}'"); $result = $db->fetch_array($query); $fid = $result['fid'];
| } if($mybb->request_method == "post") { if((!$fid || !$gid) && $pid) { $query = $db->simple_select("forumpermissions", "fid, gid", "pid='{$pid}'"); $result = $db->fetch_array($query); $fid = $result['fid'];
|
$gid = $result['gid'];
|
$gid = $result['gid'];
|
}
| }
|
if($pid) { $db->delete_query("forumpermissions", "pid='{$pid}'");
|
if($pid) { $db->delete_query("forumpermissions", "pid='{$pid}'");
|
}
| }
|
else { $db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'"); } $cache->update_forumpermissions();
|
else { $db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'"); } $cache->update_forumpermissions();
|
|
|
flash_message($lang->success_custom_permission_cleared, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); }
| flash_message($lang->success_custom_permission_cleared, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); }
|
Zeile 445 | Zeile 447 |
---|
$result = $db->fetch_array($query); $fid = $result['fid']; $gid = $result['gid'];
|
$result = $db->fetch_array($query); $fid = $result['fid']; $gid = $result['gid'];
|
| $forum = get_forum($fid);
|
}
$field_list = array();
| }
$field_list = array();
|
Zeile 499 | Zeile 502 |
---|
if($mybb->input['ajax'] == 1) {
|
if($mybb->input['ajax'] == 1) {
|
echo "<script type=\"text/javascript\"> $('row_{$gid}').innerHTML = '".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'; QuickPermEditor.init({$gid}); </script>\n";
| echo "<script type=\"text/javascript\">$('row_{$gid}').update('".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'); QuickPermEditor.init({$gid});</script>";
|
die; } else
| die; } else
|
Zeile 939 | Zeile 939 |
---|
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->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>"); $moderator_options = array(
| $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_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'))
|
$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>");
|
Zeile 965 | Zeile 965 |
---|
$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name')); while($style = $db->fetch_array($query)) {
|
$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name')); while($style = $db->fetch_array($query)) {
|
$styles[$style['tid']] = $style['name'];
| $styles[$style['tid']] = htmlspecialchars_uni($style['name']);
|
} $style_options = array(
| } $style_options = array(
|
Zeile 978 | Zeile 978 |
---|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
| '3' => $lang->display_rules_inline_new,
|
'2' => $lang->display_rules_link );
| '2' => $lang->display_rules_link );
|
Zeile 985 | Zeile 986 |
---|
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')), $lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')), $lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))
|
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')), $lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')), $lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))
|
); $form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>");
| ); $form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>");
|
$default_date_cut = array( 0 => $lang->board_default, 1 => $lang->datelimit_1day,
| $default_date_cut = array( 0 => $lang->board_default, 1 => $lang->datelimit_1day,
|
Zeile 1003 | Zeile 1004 |
---|
); $default_sort_by = array(
|
); $default_sort_by = array(
|
"" => $lang->board_default,
| "" => $lang->board_default,
|
"subject" => $lang->sort_by_subject, "lastpost" => $lang->sort_by_lastpost, "starter" => $lang->sort_by_starter,
| "subject" => $lang->sort_by_subject, "lastpost" => $lang->sort_by_lastpost, "starter" => $lang->sort_by_starter,
|
Zeile 1017 | Zeile 1018 |
---|
"" => $lang->board_default, "asc" => $lang->sort_order_asc, "desc" => $lang->sort_order_desc,
|
"" => $lang->board_default, "asc" => $lang->sort_order_asc, "desc" => $lang->sort_order_desc,
|
);
| );
|
$view_options = array( $lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')), $lang->default_sort_by."<br />\n".$form->generate_select_box('defaultsortby', $default_sort_by, $forum_data['defaultsortby'], array('checked' => $forum_data['defaultsortby'], 'id' => 'defaultsortby')), $lang->default_sort_order."<br />\n".$form->generate_select_box('defaultsortorder', $default_sort_order, $forum_data['defaultsortorder'], array('checked' => $forum_data['defaultsortorder'], 'id' => 'defaultsortorder')),
|
$view_options = array( $lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')), $lang->default_sort_by."<br />\n".$form->generate_select_box('defaultsortby', $default_sort_by, $forum_data['defaultsortby'], array('checked' => $forum_data['defaultsortby'], 'id' => 'defaultsortby')), $lang->default_sort_order."<br />\n".$form->generate_select_box('defaultsortorder', $default_sort_order, $forum_data['defaultsortorder'], array('checked' => $forum_data['defaultsortorder'], 'id' => 'defaultsortorder')),
|
); $form_container->output_row($lang->default_view_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $view_options)."</div>");
| ); $form_container->output_row($lang->default_view_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $view_options)."</div>");
|
$misc_options = array( $form->generate_check_box('allowhtml', 1, $lang->allow_html, array('checked' => $forum_data['allowhtml'], 'id' => 'allowhtml')), $form->generate_check_box('allowmycode', 1, $lang->allow_mycode, array('checked' => $forum_data['allowmycode'], 'id' => 'allowmycode')),
| $misc_options = array( $form->generate_check_box('allowhtml', 1, $lang->allow_html, array('checked' => $forum_data['allowhtml'], 'id' => 'allowhtml')), $form->generate_check_box('allowmycode', 1, $lang->allow_mycode, array('checked' => $forum_data['allowmycode'], 'id' => 'allowmycode')),
|
Zeile 1043 | Zeile 1044 |
---|
$form_container->end(); echo "</div>";
|
$form_container->end(); echo "</div>";
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
| $query = $db->simple_select("usergroups", "*", "", array("order" => "name"));
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
| while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
Zeile 1055 | Zeile 1056 |
---|
'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, 'canpostthreads' => $lang->perm_drag_canpostthreads,
| $field_list2 = array( 'canview' => $lang->perm_drag_canview, 'canpostthreads' => $lang->perm_drag_canpostthreads,
|
Zeile 1065 | Zeile 1066 |
---|
); $ids = array();
|
); $ids = array();
|
|
|
$form_container = new FormContainer($lang->forum_permissions); $form_container->output_row_header($lang->permissions_group, array("class" => "align_center", 'style' => 'width: 40%')); $form_container->output_row_header($lang->overview_allowed_actions, array("class" => "align_center"));
| $form_container = new FormContainer($lang->forum_permissions); $form_container->output_row_header($lang->permissions_group, array("class" => "align_center", 'style' => 'width: 40%')); $form_container->output_row_header($lang->overview_allowed_actions, array("class" => "align_center"));
|
Zeile 1074 | Zeile 1075 |
---|
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 1094 | Zeile 1095 |
---|
foreach($usergroups as $usergroup) { $perms = array();
|
foreach($usergroups as $usergroup) { $perms = array();
|
if($mybb->input['default_permissions'][$usergroup['gid']])
| 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']]) {
|
Zeile 1104 | Zeile 1105 |
---|
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']]) {
| } else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) {
|
Zeile 1122 | Zeile 1123 |
---|
foreach($field_list as $forum_permission => $forum_perm_title) { if(isset($mybb->input['permissions']))
|
foreach($field_list as $forum_permission => $forum_perm_title) { if(isset($mybb->input['permissions']))
|
{
| {
|
if($mybb->input['default_permissions'][$usergroup['gid']]) { $default_checked = true;
|
if($mybb->input['default_permissions'][$usergroup['gid']]) { $default_checked = true;
|
} else
| } else
|
{ $default_checked = false; }
| { $default_checked = false; }
|
Zeile 1142 | Zeile 1143 |
---|
} } else
|
} } else
|
{
| {
|
if($perms[$forum_permission] == 1) { $perms_checked[$forum_permission] = 1;
| if($perms[$forum_permission] == 1) { $perms_checked[$forum_permission] = 1;
|
Zeile 1151 | Zeile 1152 |
---|
{ $perms_checked[$forum_permission] = 0; }
|
{ $perms_checked[$forum_permission] = 0; }
|
} }
| } }
|
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']); if($default_checked)
| $usergroup['title'] = htmlspecialchars_uni($usergroup['title']); if($default_checked)
|
Zeile 1164 | Zeile 1165 |
---|
$inherited_text = $lang->custom_permission; }
|
$inherited_text = $lang->custom_permission; }
|
$form_container->output_cell("<strong>{$usergroup['title']}</strong><br />".$form->generate_check_box("default_permissions[{$usergroup['gid']}]", 1, "", array("id" => "default_permissions_{$usergroup['gid']}", "checked" => $default_checked, "onclick" => $default_click))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");
| $form_container->output_cell("<strong>{$usergroup['title']}</strong><br />".$form->generate_check_box("default_permissions[{$usergroup['gid']}]", 1, "", array("id" => "default_permissions_{$usergroup['gid']}", "checked" => $default_checked))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");
|
$field_select = "<div class=\"quick_perm_fields\">\n";
|
$field_select = "<div class=\"quick_perm_fields\">\n";
|
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n"; foreach($perms_checked as $perm => $value)
| $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n"; foreach($perms_checked as $perm => $value)
|
{ if($value == 1) {
| { if($value == 1) {
|
Zeile 1176 | Zeile 1177 |
---|
} } $field_select .= "</ul></div>\n";
|
} } $field_select .= "</ul></div>\n";
|
$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
| $field_select .= "<div class=\"disabled\"><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value) { if($value == 0) { $field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
|
foreach($perms_checked as $perm => $value) { if($value == 0) { $field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
|
} }
| } }
|
$field_select .= "</ul></div></div>\n"; $field_select .= $form->generate_hidden_field("fields_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_'.$usergroup['gid'])); $field_select = str_replace("'", "\\'", $field_select); $field_select = str_replace("\n", "", $field_select);
|
$field_select .= "</ul></div></div>\n"; $field_select .= $form->generate_hidden_field("fields_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_'.$usergroup['gid'])); $field_select = str_replace("'", "\\'", $field_select); $field_select = str_replace("\n", "", $field_select);
|
|
|
$field_select = "<script type=\"text/javascript\"> //<![CDATA[ document.write('".str_replace("/", "\/", $field_select)."');
| $field_select = "<script type=\"text/javascript\"> //<![CDATA[ document.write('".str_replace("/", "\/", $field_select)."');
|
Zeile 1207 | Zeile 1208 |
---|
$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));
|
|
|
$form_container->construct_row(); $ids[] = $usergroup['gid'];
| $form_container->construct_row(); $ids[] = $usergroup['gid'];
|
Zeile 1221 | Zeile 1222 |
---|
// Write in our JS based field selector echo "<script type=\"text/javascript\">\n<!--\n"; foreach($ids as $id)
|
// Write in our JS based field selector echo "<script type=\"text/javascript\">\n<!--\n"; foreach($ids as $id)
|
{
| {
|
echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id.") });\n"; } echo "// -->\n</script>\n";
|
echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id.") });\n"; } echo "// -->\n</script>\n";
|
|
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 1234 | Zeile 1235 |
---|
$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');
| { flash_message($lang->error_invalid_fid, 'error');
|
admin_redirect("index.php?module=forum-management"); }
| admin_redirect("index.php?module=forum-management"); }
|
Zeile 1259 | Zeile 1260 |
---|
$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
|
{
| {
|
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'"); while($child = $db->fetch_array($query)) {
| $query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'"); while($child = $db->fetch_array($query)) {
|
Zeile 1272 | Zeile 1273 |
---|
$errors[] = $lang->error_forum_parent_child; break; }
|
$errors[] = $lang->error_forum_parent_child; break; }
|
} }
| } }
|
$type = $mybb->input['type'];
| $type = $mybb->input['type'];
|
Zeile 1290 | Zeile 1291 |
---|
$errors[] = $lang->error_not_empty; } }
|
$errors[] = $lang->error_not_empty; } }
|
| if(!empty($mybb->input['linkto']) && empty($forum_data['linkto'])) { $query = $db->simple_select('threads', 'COUNT(tid) as num_threads', "fid = '{$fid}'", array("limit" => 1)); if($db->fetch_field($query, "num_threads") > 0) { $errors[] = $lang->error_forum_link_not_empty; } }
|
if(!$errors) { if($pid < 0) { $pid = 0;
|
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 1333 | Zeile 1344 |
---|
if($pid != $forum_data['pid']) { // Update the parentlist of this forum.
|
if($pid != $forum_data['pid']) { // Update the parentlist of this forum.
|
$db->update_query("forums", array("parentlist" => make_parent_list($fid)), "fid='{$fid}'", 1);
| $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) {
| // Rebuild the parentlist of all of the subforums of this forum switch($db->type) {
|
Zeile 1348 | Zeile 1359 |
---|
while($child = $db->fetch_array($query)) {
|
while($child = $db->fetch_array($query)) {
|
$db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1);
| $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'");
|
} }
| } }
|
Zeile 1438 | Zeile 1449 |
---|
$forum_data['title'] = $forum_data['name']; }
|
$forum_data['title'] = $forum_data['name']; }
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
| $query = $db->simple_select("usergroups", "*", "", array("order" => "name"));
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
| while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
Zeile 1520 | Zeile 1531 |
---|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
| '3' => $lang->display_rules_inline_new,
|
'2' => $lang->display_rules_link
|
'2' => $lang->display_rules_link
|
);
| );
|
$forum_rules = array( $lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
| $forum_rules = array( $lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
|
Zeile 1545 | Zeile 1557 |
---|
); $default_sort_by = array(
|
); $default_sort_by = array(
|
"" => $lang->board_default,
| "" => $lang->board_default,
|
"subject" => $lang->sort_by_subject, "lastpost" => $lang->sort_by_lastpost, "starter" => $lang->sort_by_starter,
| "subject" => $lang->sort_by_subject, "lastpost" => $lang->sort_by_lastpost, "starter" => $lang->sort_by_starter,
|
Zeile 1553 | Zeile 1565 |
---|
"rating" => $lang->sort_by_rating, "replies" => $lang->sort_by_replies, "views" => $lang->sort_by_views,
|
"rating" => $lang->sort_by_rating, "replies" => $lang->sort_by_replies, "views" => $lang->sort_by_views,
|
);
| );
|
$default_sort_order = array( "" => $lang->board_default, "asc" => $lang->sort_order_asc, "desc" => $lang->sort_order_desc,
|
$default_sort_order = array( "" => $lang->board_default, "asc" => $lang->sort_order_asc, "desc" => $lang->sort_order_desc,
|
);
| );
|
$view_options = array( $lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')), $lang->default_sort_by."<br />\n".$form->generate_select_box('defaultsortby', $default_sort_by, $forum_data['defaultsortby'], array('checked' => $forum_data['defaultsortby'], 'id' => 'defaultsortby')), $lang->default_sort_order."<br />\n".$form->generate_select_box('defaultsortorder', $default_sort_order, $forum_data['defaultsortorder'], array('checked' => $forum_data['defaultsortorder'], 'id' => 'defaultsortorder')),
|
$view_options = array( $lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')), $lang->default_sort_by."<br />\n".$form->generate_select_box('defaultsortby', $default_sort_by, $forum_data['defaultsortby'], array('checked' => $forum_data['defaultsortby'], 'id' => 'defaultsortby')), $lang->default_sort_order."<br />\n".$form->generate_select_box('defaultsortorder', $default_sort_order, $forum_data['defaultsortorder'], array('checked' => $forum_data['defaultsortorder'], 'id' => 'defaultsortorder')),
|
);
| );
|
$form_container->output_row($lang->default_view_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $view_options)."</div>");
| $form_container->output_row($lang->default_view_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $view_options)."</div>");
|
Zeile 1579 | Zeile 1591 |
---|
$form->generate_check_box('allowtratings', 1, $lang->allow_thread_ratings, array('checked' => $forum_data['allowtratings'], 'id' => 'allowtratings')), $form->generate_check_box('showinjump', 1, $lang->show_forum_jump, array('checked' => $forum_data['showinjump'], 'id' => 'showinjump')), $form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts'))
|
$form->generate_check_box('allowtratings', 1, $lang->allow_thread_ratings, array('checked' => $forum_data['allowtratings'], 'id' => 'allowtratings')), $form->generate_check_box('showinjump', 1, $lang->show_forum_jump, array('checked' => $forum_data['showinjump'], 'id' => 'showinjump')), $form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts'))
|
);
| );
|
$form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</div>"); $form_container->end();
| $form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</div>"); $form_container->end();
|
Zeile 1598 | Zeile 1610 |
---|
'canpostreplys' => $lang->perm_drag_canpostreplys, 'canpostpolls' => $lang->perm_drag_canpostpolls, );
|
'canpostreplys' => $lang->perm_drag_canpostreplys, 'canpostpolls' => $lang->perm_drag_canpostpolls, );
|
|
|
$ids = array(); $form_container = new FormContainer($lang->sprintf($lang->forum_permissions_in, $forum_data['name']));
| $ids = array(); $form_container = new FormContainer($lang->sprintf($lang->forum_permissions_in, $forum_data['name']));
|
Zeile 1712 | Zeile 1724 |
---|
if($default_checked) { $inherited_text = $lang->inherited_permission;
|
if($default_checked) { $inherited_text = $lang->inherited_permission;
|
}
| }
|
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>");
|
Zeile 1725 | Zeile 1737 |
---|
foreach($perms_checked as $perm => $value) { if($value == 1)
|
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>";
|
} } $field_select .= "</ul></div>\n";
| } } $field_select .= "</ul></div>\n";
|
Zeile 1750 | Zeile 1762 |
---|
document.write('".str_replace("/", "\/", $field_select)."'); //]]> </script>\n";
|
document.write('".str_replace("/", "\/", $field_select)."'); //]]> </script>\n";
|
|
|
$field_selected = array(); foreach($field_list as $forum_permission => $permission_title) {
| $field_selected = array(); foreach($field_list as $forum_permission => $permission_title) {
|
Zeile 1759 | Zeile 1771 |
---|
{ $field_selected[] = $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 1768 | Zeile 1780 |
---|
{ $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&pid={$perms['pid']}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1'}); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=clear_permission&pid={$perms['pid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));
|
{ $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&pid={$perms['pid']}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1'}); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=clear_permission&pid={$perms['pid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));
|
}
| }
|
else { $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
| else { $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
|
Zeile 1778 | Zeile 1790 |
---|
$ids[] = $usergroup['gid']; } $form_container->end();
|
$ids[] = $usergroup['gid']; } $form_container->end();
|
|
|
$buttons[] = $form->generate_submit_button($lang->save_forum); $form->output_submit_wrapper($buttons); $form->end();
| $buttons[] = $form->generate_submit_button($lang->save_forum); $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 1788 | Zeile 1800 |
---|
foreach($ids as $id) { echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id."); });\n";
|
foreach($ids as $id) { echo "Event.observe(window, 'load', function(){ QuickPermEditor.init(".$id."); });\n";
|
}
| }
|
echo "// -->\n</script>\n"; $page->output_footer();
| echo "// -->\n</script>\n"; $page->output_footer();
|
Zeile 1842 | Zeile 1854 |
---|
$mod = $db->fetch_array($query); $db->delete_query("moderators", "mid='{$mid}'");
|
$mod = $db->fetch_array($query); $db->delete_query("moderators", "mid='{$mid}'");
|
$query = $db->simple_select("moderators", "*", "id='{$mod['id']}' AND isgroup='0'"); if($db->num_rows($query) == 0) { $updatequery = array( "usergroup" => "2" ); $db->update_query("users", $updatequery, "uid='{$mod['id']}' AND usergroup != '4' AND usergroup != '3'"); }
| |
$cache->update_moderators();
|
$cache->update_moderators();
|
$plugins->run_hooks("admin_forum_management_deletemod_commit"); $forum = get_forum($fid);
| $plugins->run_hooks("admin_forum_management_deletemod_commit"); $forum = get_forum($fid);
|
// Log admin action if ($isgroup)
|
// Log admin action if ($isgroup)
|
{ log_admin_action($mod['id'], $mod['title'], $forum['fid'], $forum['name']);
| { log_admin_action($mid, $mod['title'], $forum['fid'], $forum['name']);
|
} else {
|
} else {
|
log_admin_action($mod['id'], $mod['username'], $forum['fid'], $forum['name']);
| log_admin_action($mid, $mod['username'], $forum['fid'], $forum['name']);
|
} flash_message($lang->success_moderator_deleted, 'success');
| } flash_message($lang->success_moderator_deleted, 'success');
|
Zeile 1872 | Zeile 1876 |
---|
else { $page->output_confirm_action("index.php?module=forum-management&action=deletemod&fid={$mod['fid']}&uid={$mod['uid']}", $lang->confirm_moderator_deletion);
|
else { $page->output_confirm_action("index.php?module=forum-management&action=deletemod&fid={$mod['fid']}&uid={$mod['uid']}", $lang->confirm_moderator_deletion);
|
} }
| } }
|
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_forum_management_delete");
| if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_forum_management_delete");
|
Zeile 1884 | Zeile 1888 |
---|
// Does the forum not exist? if(!$forum['fid'])
|
// Does the forum not exist? if(!$forum['fid'])
|
{
| {
|
flash_message($lang->error_invalid_forum, 'error'); admin_redirect("index.php?module=forum-management"); }
| flash_message($lang->error_invalid_forum, 'error'); admin_redirect("index.php?module=forum-management"); }
|
Zeile 1911 | Zeile 1915 |
---|
case "pgsql": case "sqlite": $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'");
|
case "pgsql": case "sqlite": $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'");
|
break; default:
| break; default:
|
$query = $db->simple_select("forums", "*", "CONCAT(',', parentlist, ',') LIKE '%,$fid,%'"); } while($forum = $db->fetch_array($query))
| $query = $db->simple_select("forums", "*", "CONCAT(',', parentlist, ',') LIKE '%,$fid,%'"); } while($forum = $db->fetch_array($query))
|
Zeile 1924 | Zeile 1928 |
---|
$stats['unapprovedposts'] += $forum['unapprovedposts']; $stats['threads'] += $forum['threads']; $stats['unapprovedthreads'] += $forum['unapprovedthreads'];
|
$stats['unapprovedposts'] += $forum['unapprovedposts']; $stats['threads'] += $forum['threads']; $stats['unapprovedthreads'] += $forum['unapprovedthreads'];
|
}
/** * This slab of code pulls out the moderators for this forum, * checks if they moderate any other forums, and if they don't * it moves them back to the registered usergroup */
$query = $db->simple_select("moderators", "*", "fid='$fid' AND isgroup='0'"); while($mod = $db->fetch_array($query)) { $moderators[$mod['id']] = $mod['id']; } if(is_array($moderators)) { $mod_list = implode(",", $moderators); $query = $db->simple_select("moderators", "*", "fid != '$fid' AND id IN ($mod_list) AND isgroup='0'"); while($mod = $db->fetch_array($query)) { unset($moderators[$mod['id']]); } } if(is_array($moderators)) { $mod_list = implode(",", $moderators); if($mod_list) { $updatequery = array( "usergroup" => "2" ); $db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'"); }
| |
} switch($db->type)
| } switch($db->type)
|
Zeile 2004 | Zeile 1974 |
---|
if(!$mybb->input['action']) { $plugins->run_hooks("admin_forum_management_start");
|
if(!$mybb->input['action']) { $plugins->run_hooks("admin_forum_management_start");
|
$fid = intval($mybb->input['fid']);
| |
|
|
| if(!isset($mybb->input['fid'])) { $mybb->input['fid'] = 0; }
$fid = intval($mybb->input['fid']);
|
if($fid) { $forum = get_forum($fid);
| if($fid) { $forum = get_forum($fid);
|
Zeile 2052 | Zeile 2027 |
---|
else { $permissions[$name][$gid] = 0;
|
else { $permissions[$name][$gid] = 0;
|
} } } $cache->update_forums();
| } } } $cache->update_forums();
|
$canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads']; $canpostpolls = $permissions['canpostpolls'];
| $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads']; $canpostpolls = $permissions['canpostpolls'];
|
Zeile 2128 | Zeile 2103 |
---|
"canviewips" => 1, "canopenclosethreads" => 1, "canmanagethreads" => 1,
|
"canviewips" => 1, "canopenclosethreads" => 1, "canmanagethreads" => 1,
|
"canmovetononmodforum" => 1
| "canmovetononmodforum" => 1, "canusecustomtools" => 1
|
);
$mid = $db->insert_query("moderators", $new_mod);
| );
$mid = $db->insert_query("moderators", $new_mod);
|
Zeile 2142 | Zeile 2118 |
---|
$plugins->run_hooks("admin_forum_management_start_moderators_commit"); // Log admin action
|
$plugins->run_hooks("admin_forum_management_start_moderators_commit"); // Log admin action
|
log_admin_action('addmod', $new_mod['fid'], $newmod['name'], $fid, $forum['name']);
| 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}");
| flash_message($lang->success_moderator_added, 'success'); admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");
|
Zeile 2211 | Zeile 2187 |
---|
'subforums' => $lang->subforums, 'permissions' => $lang->forum_permissions, 'moderators' => $lang->moderators,
|
'subforums' => $lang->subforums, 'permissions' => $lang->forum_permissions, 'moderators' => $lang->moderators,
|
);
| );
|
$page->output_tab_control($tabs); echo "<div id=\"tab_subforums\">\n";
|
$page->output_tab_control($tabs); echo "<div id=\"tab_subforums\">\n";
|
if(!is_array($forum_cache))
| if(!isset($forum_cache) || !is_array($forum_cache))
|
{ cache_forums(); } $form_container = new FormContainer($lang->sprintf($lang->in_forums, $forum_cache[$fid]['name']));
|
{ cache_forums(); } $form_container = new FormContainer($lang->sprintf($lang->in_forums, $forum_cache[$fid]['name']));
|
}
| }
|
else { $form_container = new FormContainer($lang->manage_forums);
| else { $form_container = new FormContainer($lang->manage_forums);
|
Zeile 2235 | Zeile 2211 |
---|
$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 2249 | Zeile 2225 |
---|
$form->output_submit_wrapper($buttons); if(!$fid)
|
$form->output_submit_wrapper($buttons); if(!$fid)
|
{
| {
|
$form->end(); }
| $form->end(); }
|
Zeile 2257 | Zeile 2233 |
---|
{ echo "</div>\n"; $form->end();
|
{ echo "</div>\n"; $form->end();
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
| $query = $db->simple_select("usergroups", "*", "", array("order" => "name"));
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
}
| }
|
$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)) {
|
Zeile 2276 | Zeile 2252 |
---|
'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 2286 | Zeile 2262 |
---|
); $ids = array();
|
); $ids = array();
|
$form = new Form("index.php?module=forum-management", "post", "management");
| $form = new Form("index.php?module=forum-management", "post", "management");
|
echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("update", "permissions");
|
echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("update", "permissions");
|
|
|
echo "<div id=\"tab_permissions\">\n"; $form_container = new FormContainer($lang->sprintf($lang->forum_permissions_in, $forum_cache[$fid]['name']));
| echo "<div id=\"tab_permissions\">\n"; $form_container = new FormContainer($lang->sprintf($lang->forum_permissions_in, $forum_cache[$fid]['name']));
|
Zeile 2306 | Zeile 2282 |
---|
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; } elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']];
|
$perms = $existing_permissions[$usergroup['gid']]; $default_checked = false; } elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']];
|
$default_checked = true; }
| $default_checked = true; }
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true;
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']]) { $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 {
|
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
| if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
|
{ $perms = $existing_permissions[$usergroup['gid']];
|
{ $perms = $existing_permissions[$usergroup['gid']];
|
$default_checked = false; } elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']]; $default_checked = true;
| $default_checked = false; } elseif(is_array($cached_forum_perms) && isset($cached_forum_perms[$forum['fid']]) && $cached_forum_perms[$forum['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']]; $default_checked = true;
|
} else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];
|
} else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];
|
$default_checked = true;
| $default_checked = true;
|
} if(!$perms)
| } if(!$perms)
|
Zeile 2357 | Zeile 2333 |
---|
if(isset($mybb->input['permissions'])) { if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
if(isset($mybb->input['permissions'])) { 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 2391 | Zeile 2367 |
---|
$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>"); $field_select = "<div class=\"quick_perm_fields\">\n";
|
$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\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
| $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value) { if($value == 1)
| foreach($perms_checked as $perm => $value) { if($value == 1)
|
Zeile 2400 | Zeile 2376 |
---|
} } $field_select .= "</ul></div>\n";
|
} } $field_select .= "</ul></div>\n";
|
$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
| $field_select .= "<div class=\"disabled\"><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value) { if($value == 0)
| foreach($perms_checked as $perm => $value) { if($value == 0)
|
Zeile 2438 | Zeile 2414 |
---|
{ $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&pid={$perms['pid']}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1'}); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=clear_permission&pid={$perms['pid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));
|
{ $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&pid={$perms['pid']}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1'}); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=clear_permission&pid={$perms['pid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));
|
} else {
| } else {
|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2)); } $form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));
| $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2)); } $form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));
|
Zeile 2478 | Zeile 2454 |
---|
ORDER BY m.isgroup DESC, u.username, g.title "); while($moderator = $db->fetch_array($query))
|
ORDER BY m.isgroup DESC, u.username, g.title "); while($moderator = $db->fetch_array($query))
|
{
| {
|
if($moderator['isgroup']) { $moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/group.gif\" alt=\"{$lang->group}\" title=\"{$lang->group}\" />"; $form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-groups&action=edit&gid={$moderator['id']}\">".htmlspecialchars_uni($moderator['title'])." ({$lang->usergroup} {$moderator['id']})</a>");
|
if($moderator['isgroup']) { $moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/group.gif\" alt=\"{$lang->group}\" title=\"{$lang->group}\" />"; $form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-groups&action=edit&gid={$moderator['id']}\">".htmlspecialchars_uni($moderator['title'])." ({$lang->usergroup} {$moderator['id']})</a>");
|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=editmod&mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center"));
| $form_container->output_cell("<a href=\"index.php?module=forum-management&action=editmod&mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center"));
|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=deletemod&id={$moderator['id']}&isgroup=1&fid={$fid}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center")); } else
| $form_container->output_cell("<a href=\"index.php?module=forum-management&action=deletemod&id={$moderator['id']}&isgroup=1&fid={$fid}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center")); } else
|
Zeile 2497 | Zeile 2473 |
---|
} if($form_container->num_rows() == 0)
|
} if($form_container->num_rows() == 0)
|
{
| {
|
$form_container->output_cell($lang->no_moderators, array('colspan' => 3)); $form_container->construct_row(); }
| $form_container->output_cell($lang->no_moderators, array('colspan' => 3)); $form_container->construct_row(); }
|
Zeile 2511 | Zeile 2487 |
---|
// Usergroup Moderator if(!is_array($usergroups))
|
// Usergroup Moderator if(!is_array($usergroups))
|
{
| {
|
$usergroups = $groupscache; }
|
$usergroups = $groupscache; }
|
foreach($usergroups as $group)
| 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['username']))
|
{
|
{
|
$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".$group['title'];
| $mybb->input['username'] = '';
|
}
$form_container = new FormContainer($lang->add_usergroup_as_moderator);
| }
$form_container = new FormContainer($lang->add_usergroup_as_moderator);
|