Zeile 68 | Zeile 68 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
$from = (int)$mybb->input['from']; $to = (int)$mybb->input['to'];
| $from = $mybb->get_input('from', MyBB::INPUT_INT); $to = $mybb->get_input('to', MyBB::INPUT_INT);
|
// Find the source forum $query = $db->simple_select("forums", '*', "fid='{$from}'");
| // Find the source forum $query = $db->simple_select("forums", '*', "fid='{$from}'");
|
Zeile 99 | Zeile 99 |
---|
$new_forum['name'] = $db->escape_string($mybb->input['title']); $new_forum['description'] = $db->escape_string($mybb->input['description']); $new_forum['type'] = $db->escape_string($mybb->input['type']);
|
$new_forum['name'] = $db->escape_string($mybb->input['title']); $new_forum['description'] = $db->escape_string($mybb->input['description']); $new_forum['type'] = $db->escape_string($mybb->input['type']);
|
$new_forum['pid'] = $mybb->get_input('pid', 1);
| $new_forum['pid'] = $mybb->get_input('pid', MyBB::INPUT_INT);
|
$new_forum['rulestitle'] = $db->escape_string($new_forum['rulestitle']); $new_forum['rules'] = $db->escape_string($new_forum['rules']); $new_forum['parentlist'] = '';
| $new_forum['rulestitle'] = $db->escape_string($new_forum['rulestitle']); $new_forum['rules'] = $db->escape_string($new_forum['rules']); $new_forum['parentlist'] = '';
|
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}");
|
Zeile 197 | Zeile 198 |
---|
if(!$mybb->input['pid']) { $copy_data['pid'] = "-1";
|
if(!$mybb->input['pid']) { $copy_data['pid'] = "-1";
|
} else
| } else
|
{
|
{
|
$copy_data['pid'] = $mybb->get_input('pid', 1);
| $copy_data['pid'] = $mybb->get_input('pid', MyBB::INPUT_INT);
|
} $copy_data['disporder'] = "1"; $copy_data['from'] = $mybb->input['fid'];
| } $copy_data['disporder'] = "1"; $copy_data['from'] = $mybb->input['fid'];
|
Zeile 211 | Zeile 212 |
---|
$types = array( 'f' => $lang->forum, 'c' => $lang->category
|
$types = array( 'f' => $lang->forum, 'c' => $lang->category
|
);
| );
|
$create_a_options_f = array( 'id' => 'forum'
|
$create_a_options_f = array( 'id' => 'forum'
|
);
| );
|
$create_a_options_c = array( 'id' => 'category' );
|
$create_a_options_c = array( 'id' => 'category' );
|
|
|
if($copy_data['type'] == "f") { $create_a_options_f['checked'] = true;
|
if($copy_data['type'] == "f") { $create_a_options_f['checked'] = true;
|
}
| }
|
else { $create_a_options_c['checked'] = true;
|
else { $create_a_options_c['checked'] = true;
|
}
$usergroups = array();
| }
$usergroups = array();
|
$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 263 | Zeile 264 |
---|
if($mybb->input['action'] == "editmod") {
|
if($mybb->input['action'] == "editmod") {
|
$query = $db->simple_select("moderators", "*", "mid='".$mybb->get_input('mid', 1)."'");
| $query = $db->simple_select("moderators", "*", "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
|
$mod_data = $db->fetch_array($query);
if(!$mod_data['id'])
| $mod_data = $db->fetch_array($query);
if(!$mod_data['id'])
|
Zeile 285 | Zeile 286 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
$mid = $mybb->get_input('mid', 1);
| $mid = $mybb->get_input('mid', MyBB::INPUT_INT);
|
if(!$mid) { flash_message($lang->error_incorrect_moderator, 'error');
| if(!$mid) { flash_message($lang->error_incorrect_moderator, 'error');
|
Zeile 294 | Zeile 295 |
---|
if(!$errors) {
|
if(!$errors) {
|
$fid = $mybb->get_input('fid', 1);
| $fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
$forum = get_forum($fid); if($mod_data['isgroup'])
|
$forum = get_forum($fid); if($mod_data['isgroup'])
|
{
| {
|
$mod = $groupscache[$mod_data['id']]; } else
| $mod = $groupscache[$mod_data['id']]; } else
|
Zeile 306 | Zeile 307 |
---|
} $update_array = array( 'fid' => (int)$fid,
|
} $update_array = array( 'fid' => (int)$fid,
|
'caneditposts' => (int)$mybb->input['caneditposts'], 'cansoftdeleteposts' => (int)$mybb->input['cansoftdeleteposts'], 'canrestoreposts' => (int)$mybb->input['canrestoreposts'], 'candeleteposts' => (int)$mybb->input['candeleteposts'], 'cansoftdeletethreads' => (int)$mybb->input['cansoftdeletethreads'], 'canrestorethreads' => (int)$mybb->input['canrestorethreads'], 'candeletethreads' => (int)$mybb->input['candeletethreads'], 'canviewips' => (int)$mybb->input['canviewips'], 'canviewunapprove' => (int)$mybb->input['canviewunapprove'], 'canviewdeleted' => (int)$mybb->input['canviewdeleted'], 'canopenclosethreads' => (int)$mybb->input['canopenclosethreads'], 'canstickunstickthreads' => (int)$mybb->input['canstickunstickthreads'], 'canapproveunapprovethreads' => (int)$mybb->input['canapproveunapprovethreads'], 'canapproveunapproveposts' => (int)$mybb->input['canapproveunapproveposts'], 'canapproveunapproveattachs' => (int)$mybb->input['canapproveunapproveattachs'], 'canmanagethreads' => (int)$mybb->input['canmanagethreads'], 'canmanagepolls' => (int)$mybb->input['canmanagepolls'], 'canpostclosedthreads' => (int)$mybb->input['canpostclosedthreads'], 'canmovetononmodforum' => (int)$mybb->input['canmovetononmodforum'], 'canusecustomtools' => (int)$mybb->input['canusecustomtools'], 'canmanageannouncements' => (int)$mybb->input['canmanageannouncements'], 'canmanagereportedposts' => (int)$mybb->input['canmanagereportedposts'], 'canviewmodlog' => (int)$mybb->input['canviewmodlog']
| 'caneditposts' => $mybb->get_input('caneditposts', MyBB::INPUT_INT), 'cansoftdeleteposts' => $mybb->get_input('cansoftdeleteposts', MyBB::INPUT_INT), 'canrestoreposts' => $mybb->get_input('canrestoreposts', MyBB::INPUT_INT), 'candeleteposts' => $mybb->get_input('candeleteposts', MyBB::INPUT_INT), 'cansoftdeletethreads' => $mybb->get_input('cansoftdeletethreads', MyBB::INPUT_INT), 'canrestorethreads' => $mybb->get_input('canrestorethreads', MyBB::INPUT_INT), 'candeletethreads' => $mybb->get_input('candeletethreads', MyBB::INPUT_INT), 'canviewips' => $mybb->get_input('canviewips', MyBB::INPUT_INT), 'canviewunapprove' => $mybb->get_input('canviewunapprove', MyBB::INPUT_INT), 'canviewdeleted' => $mybb->get_input('canviewdeleted', MyBB::INPUT_INT), 'canopenclosethreads' => $mybb->get_input('canopenclosethreads', MyBB::INPUT_INT), 'canstickunstickthreads' => $mybb->get_input('canstickunstickthreads', MyBB::INPUT_INT), 'canapproveunapprovethreads' => $mybb->get_input('canapproveunapprovethreads', MyBB::INPUT_INT), 'canapproveunapproveposts' => $mybb->get_input('canapproveunapproveposts', MyBB::INPUT_INT), 'canapproveunapproveattachs' => $mybb->get_input('canapproveunapproveattachs', MyBB::INPUT_INT), 'canmanagethreads' => $mybb->get_input('canmanagethreads', MyBB::INPUT_INT), 'canmanagepolls' => $mybb->get_input('canmanagepolls', MyBB::INPUT_INT), 'canpostclosedthreads' => $mybb->get_input('canpostclosedthreads', MyBB::INPUT_INT), 'canmovetononmodforum' => $mybb->get_input('canmovetononmodforum', MyBB::INPUT_INT), 'canusecustomtools' => $mybb->get_input('canusecustomtools', MyBB::INPUT_INT), 'canmanageannouncements' => $mybb->get_input('canmanageannouncements', MyBB::INPUT_INT), 'canmanagereportedposts' => $mybb->get_input('canmanagereportedposts', MyBB::INPUT_INT), 'canviewmodlog' => $mybb->get_input('canviewmodlog', MyBB::INPUT_INT)
|
);
|
);
|
$db->update_query("moderators", $update_array, "mid='".$mybb->get_input('mid', 1)."'");
$cache->update_moderators();
|
|
$plugins->run_hooks("admin_forum_management_editmod_commit");
|
$plugins->run_hooks("admin_forum_management_editmod_commit");
|
| $db->update_query("moderators", $update_array, "mid='".$mybb->get_input('mid', MyBB::INPUT_INT)."'");
$cache->update_moderators();
|
// Log admin action log_admin_action($fid, $forum['name'], $mid, $mod[$fieldname]);
flash_message($lang->success_moderator_updated, 'success');
|
// Log admin action log_admin_action($fid, $forum['name'], $mid, $mod[$fieldname]);
flash_message($lang->success_moderator_updated, 'success');
|
admin_redirect("index.php?module=forum-management&fid=".$mybb->get_input('fid', 1)."#tab_moderators");
| admin_redirect("index.php?module=forum-management&fid=".$mybb->get_input('fid', MyBB::INPUT_INT)."#tab_moderators");
|
}
|
}
|
}
| }
|
if($mod_data['isgroup']) {
| if($mod_data['isgroup']) {
|
Zeile 353 | Zeile 355 |
---|
{ $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['edit_mod'] = array(
| $sub_tabs = array();
$sub_tabs['edit_mod'] = array(
|
Zeile 422 | Zeile 424 |
---|
if($mybb->input['action'] == "clear_permission") {
|
if($mybb->input['action'] == "clear_permission") {
|
$pid = $mybb->get_input('pid', 1); $fid = $mybb->get_input('fid', 1); $gid = (int)$mybb->input['gid'];
| $pid = $mybb->get_input('pid', MyBB::INPUT_INT); $fid = $mybb->get_input('fid', MyBB::INPUT_INT); $gid = $mybb->get_input('gid', MyBB::INPUT_INT);
|
// User clicked no if($mybb->input['no'])
| // User clicked no if($mybb->input['no'])
|
Zeile 432 | Zeile 434 |
---|
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");
| $plugins->run_hooks("admin_forum_management_clear_permission");
|
if($mybb->request_method == "post") {
| if($mybb->request_method == "post") {
|
Zeile 452 | Zeile 454 |
---|
{ $db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'"); }
|
{ $db->delete_query("forumpermissions", "gid='{$gid}' AND fid='{$fid}'"); }
|
| $plugins->run_hooks('admin_forum_management_clear_permission_commit');
|
$cache->update_forumpermissions();
| $cache->update_forumpermissions();
|
Zeile 470 | Zeile 474 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
$pid = $mybb->get_input('pid', 1); $fid = $mybb->get_input('fid', 1); $gid = (int)$mybb->input['gid'];
| $pid = $mybb->get_input('pid', MyBB::INPUT_INT); $fid = $mybb->get_input('fid', MyBB::INPUT_INT); $gid = $mybb->get_input('gid', MyBB::INPUT_INT);
|
$forum = get_forum($fid);
if((!$fid || !$gid) && $pid)
| $forum = get_forum($fid);
if((!$fid || !$gid) && $pid)
|
Zeile 519 | Zeile 523 |
---|
if($fid && !$pid) { $update_array['fid'] = $fid;
|
if($fid && !$pid) { $update_array['fid'] = $fid;
|
$update_array['gid'] = (int)$mybb->input['gid'];
| $update_array['gid'] = $mybb->get_input('gid', MyBB::INPUT_INT);
|
$db->insert_query("forumpermissions", $update_array); }
|
$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}'");
|
{ $db->update_query("forumpermissions", $update_array, "pid='{$pid}'");
|
}
| }
|
$cache->update_forumpermissions();
|
$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 538 | Zeile 543 |
---|
{ echo json_encode("<script type=\"text/javascript\">$('#row_{$gid}').html('".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'); QuickPermEditor.init({$gid});</script>"); die;
|
{ echo json_encode("<script type=\"text/javascript\">$('#row_{$gid}').html('".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'); QuickPermEditor.init({$gid});</script>"); die;
|
}
| }
|
else { flash_message($lang->success_forum_permissions_saved, 'success');
| else { flash_message($lang->success_forum_permissions_saved, 'success');
|
Zeile 555 | Zeile 560 |
---|
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions, 'link' => "index.php?module=forum-management&action=permissions&fid=".$mybb->input['fid']."&gid=".$mybb->input['gid'],
|
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions, 'link' => "index.php?module=forum-management&action=permissions&fid=".$mybb->input['fid']."&gid=".$mybb->input['gid'],
|
'description' => $lang->forum_permissions_desc );
$page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions"); } else
| 'description' => $lang->forum_permissions_desc );
$page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions"); } else
|
{
|
{
|
$query = $db->simple_select("forumpermissions", "fid", "pid='".$mybb->get_input('pid', 1)."'");
| $query = $db->simple_select("forumpermissions", "fid", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");
|
$mybb->input['fid'] = $db->fetch_field($query, "fid");
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions,
|
$mybb->input['fid'] = $db->fetch_field($query, "fid");
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions,
|
'link' => "index.php?module=forum-management&action=permissions&pid=".$mybb->get_input('pid', 1),
| 'link' => "index.php?module=forum-management&action=permissions&pid=".$mybb->get_input('pid', MyBB::INPUT_INT),
|
'description' => $lang->forum_permissions_desc );
| 'description' => $lang->forum_permissions_desc );
|
Zeile 619 | Zeile 624 |
---|
} 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");
| $form = new Form("index.php?module=forum-management&action=permissions&ajax=1&pid=".$mybb->get_input('pid', MyBB::INPUT_INT)."&gid=".$mybb->get_input('gid', MyBB::INPUT_INT)."&fid=".$mybb->get_input('gid', MyBB::INPUT_INT), "post", "modal_form");
|
} echo $form->generate_hidden_field("usecustom", "1");
| } echo $form->generate_hidden_field("usecustom", "1");
|
Zeile 636 | Zeile 641 |
---|
} else {
|
} else {
|
$pid = $mybb->get_input('pid', 1); $gid = (int)$mybb->input['gid']; $fid = $mybb->get_input('fid', 1);
| $pid = $mybb->get_input('pid', MyBB::INPUT_INT); $gid = $mybb->get_input('gid', MyBB::INPUT_INT); $fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
if($pid) { $query = $db->simple_select("forumpermissions", "*", "pid='{$pid}'");
|
if($pid) { $query = $db->simple_select("forumpermissions", "*", "pid='{$pid}'");
|
} else
| } else
|
{ $query = $db->simple_select("forumpermissions", "*", "fid='{$fid}' AND gid='{$gid}'", array('limit' => 1)); }
| { $query = $db->simple_select("forumpermissions", "*", "fid='{$fid}' AND gid='{$gid}'", array('limit' => 1)); }
|
Zeile 761 | Zeile 766 |
---|
}
foreach(array_unique(array_values($groups)) as $group)
|
}
foreach(array_unique(array_values($groups)) as $group)
|
{
| {
|
$lang_group = "group_".$group; echo "<div id=\"tab_".$group."\">\n"; $form_container = new FormContainer("\"".htmlspecialchars_uni($usergroup['title'])."\" {$lang->custom_permissions_for} \"".htmlspecialchars_uni($forum['name'])."\"");
| $lang_group = "group_".$group; echo "<div id=\"tab_".$group."\">\n"; $form_container = new FormContainer("\"".htmlspecialchars_uni($usergroup['title'])."\" {$lang->custom_permissions_for} \"".htmlspecialchars_uni($forum['name'])."\"");
|
Zeile 778 | Zeile 783 |
---|
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 811 | Zeile 816 |
---|
$errors[] = $lang->error_missing_title; }
|
$errors[] = $lang->error_missing_title; }
|
$pid = $mybb->get_input('pid', 1);
| $pid = $mybb->get_input('pid', MyBB::INPUT_INT);
|
$type = $mybb->input['type'];
if($pid <= 0 && $type == "f")
| $type = $mybb->input['type'];
if($pid <= 0 && $type == "f")
|
Zeile 832 | Zeile 837 |
---|
"type" => $db->escape_string($type), "pid" => $pid, "parentlist" => '',
|
"type" => $db->escape_string($type), "pid" => $pid, "parentlist" => '',
|
"disporder" => (int)$mybb->input['disporder'], "active" => (int)$mybb->input['active'], "open" => (int)$mybb->input['open'], "allowhtml" => (int)$mybb->input['allowhtml'], "allowmycode" => (int)$mybb->input['allowmycode'], "allowsmilies" => (int)$mybb->input['allowsmilies'], "allowimgcode" => (int)$mybb->input['allowimgcode'], "allowvideocode" => (int)$mybb->input['allowvideocode'], "allowpicons" => (int)$mybb->input['allowpicons'], "allowtratings" => (int)$mybb->input['allowtratings'], "usepostcounts" => (int)$mybb->input['usepostcounts'], "usethreadcounts" => (int)$mybb->input['usethreadcounts'], "requireprefix" => (int)$mybb->input['requireprefix'],
| "disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT), "active" => $mybb->get_input('active', MyBB::INPUT_INT), "open" => $mybb->get_input('open', MyBB::INPUT_INT), "allowhtml" => $mybb->get_input('allowhtml', MyBB::INPUT_INT), "allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT), "allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), "allowimgcode" => $mybb->get_input('allowimgcode', MyBB::INPUT_INT), "allowvideocode" => $mybb->get_input('allowvideocode', MyBB::INPUT_INT), "allowpicons" => $mybb->get_input('allowpicons', MyBB::INPUT_INT), "allowtratings" => $mybb->get_input('allowtratings', MyBB::INPUT_INT), "usepostcounts" => $mybb->get_input('usepostcounts', MyBB::INPUT_INT), "usethreadcounts" => $mybb->get_input('usethreadcounts', MyBB::INPUT_INT), "requireprefix" => $mybb->get_input('requireprefix', MyBB::INPUT_INT),
|
"password" => $db->escape_string($mybb->input['password']),
|
"password" => $db->escape_string($mybb->input['password']),
|
"showinjump" => (int)$mybb->input['showinjump'], "style" => (int)$mybb->input['style'], "overridestyle" => (int)$mybb->input['overridestyle'], "rulestype" => (int)$mybb->input['rulestype'],
| "showinjump" => $mybb->get_input('showinjump', MyBB::INPUT_INT), "style" => $mybb->get_input('style', MyBB::INPUT_INT), "overridestyle" => $mybb->get_input('overridestyle', MyBB::INPUT_INT), "rulestype" => $mybb->get_input('rulestype', MyBB::INPUT_INT),
|
"rulestitle" => $db->escape_string($mybb->input['rulestitle']), "rules" => $db->escape_string($mybb->input['rules']),
|
"rulestitle" => $db->escape_string($mybb->input['rulestitle']), "rules" => $db->escape_string($mybb->input['rules']),
|
"defaultdatecut" => (int)$mybb->input['defaultdatecut'],
| "defaultdatecut" => $mybb->get_input('defaultdatecut', MyBB::INPUT_INT),
|
"defaultsortby" => $db->escape_string($mybb->input['defaultsortby']), "defaultsortorder" => $db->escape_string($mybb->input['defaultsortorder']), ); $fid = $db->insert_query("forums", $insert_array);
$parentlist = make_parent_list($fid);
|
"defaultsortby" => $db->escape_string($mybb->input['defaultsortby']), "defaultsortorder" => $db->escape_string($mybb->input['defaultsortorder']), ); $fid = $db->insert_query("forums", $insert_array);
$parentlist = make_parent_list($fid);
|
$db->update_query("forums", array("parentlist" => $parentlist), "fid='$fid'");
| $db->update_query("forums", array("parentlist" => $parentlist), "fid='$fid'");
|
$inherit = $mybb->input['default_permissions'];
foreach($mybb->input as $id => $permission)
| $inherit = $mybb->input['default_permissions'];
foreach($mybb->input as $id => $permission)
|
Zeile 868 | Zeile 873 |
---|
if(strpos($id, 'fields_') === false) { continue;
|
if(strpos($id, 'fields_') === false) { continue;
|
}
| }
|
list(, $gid) = explode('fields_', $id);
// If it isn't an array then it came from the javascript form if(!is_array($permission))
|
list(, $gid) = explode('fields_', $id);
// If it isn't an array then it came from the javascript form if(!is_array($permission))
|
{
| {
|
$permission = explode(',', $permission); $permission = array_flip($permission); foreach($permission as $name => $value)
|
$permission = explode(',', $permission); $permission = array_flip($permission); foreach($permission as $name => $value)
|
{
| {
|
$permission[$name] = 1; } }
| $permission[$name] = 1; } }
|
Zeile 895 | Zeile 900 |
---|
} } }
|
} } }
|
$cache->update_forums();
| |
$canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
| $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
|
Zeile 906 | Zeile 909 |
---|
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 940 | Zeile 945 |
---|
} else {
|
} else {
|
$forum_data['pid'] = $mybb->get_input('pid', 1);
| $forum_data['pid'] = $mybb->get_input('pid', MyBB::INPUT_INT);
|
} $forum_data['disporder'] = "1"; $forum_data['linkto'] = "";
| } $forum_data['disporder'] = "1"; $forum_data['linkto'] = "";
|
Zeile 975 | Zeile 980 |
---|
$create_a_options_f = array( 'id' => 'forum'
|
$create_a_options_f = array( 'id' => 'forum'
|
);
| );
|
$create_a_options_c = array( 'id' => 'category' );
| $create_a_options_c = array( 'id' => 'category' );
|
Zeile 995 | Zeile 1000 |
---|
$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', 'min' => 0)), '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 1054 | Zeile 1059 |
---|
100 => $lang->datelimit_100days, 365 => $lang->datelimit_lastyear, 9999 => $lang->datelimit_beginning,
|
100 => $lang->datelimit_100days, 365 => $lang->datelimit_lastyear, 9999 => $lang->datelimit_beginning,
|
);
| );
|
$default_sort_by = array( "" => $lang->board_default, "subject" => $lang->sort_by_subject,
| $default_sort_by = array( "" => $lang->board_default, "subject" => $lang->sort_by_subject,
|
Zeile 1077 | Zeile 1082 |
---|
$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')),
|
$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>");
$misc_options = array(
| $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(
|
Zeile 1093 | Zeile 1098 |
---|
$form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts')), $form->generate_check_box('usethreadcounts', 1, $lang->use_threadcounts, array('checked' => $forum_data['usethreadcounts'], 'id' => 'usethreadcounts')), $form->generate_check_box('requireprefix', 1, $lang->require_thread_prefix, array('checked' => $forum_data['requireprefix'], 'id' => 'requireprefix'))
|
$form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts')), $form->generate_check_box('usethreadcounts', 1, $lang->use_threadcounts, array('checked' => $forum_data['usethreadcounts'], 'id' => 'usethreadcounts')), $form->generate_check_box('requireprefix', 1, $lang->require_thread_prefix, array('checked' => $forum_data['requireprefix'], 'id' => 'requireprefix'))
|
);
| );
|
$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(); echo "</div>";
| $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(); echo "</div>";
|
Zeile 1172 | Zeile 1177 |
---|
if(!$perms) { $perms = $usergroup;
|
if(!$perms) { $perms = $usergroup;
|
$default_checked = true; }
foreach($field_list as $forum_permission => $forum_perm_title) { if(isset($mybb->input['permissions'])) {
| $default_checked = true; }
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; }
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
{ $default_checked = false; }
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
{ $perms_checked[$forum_permission] = 1; } else {
| { $perms_checked[$forum_permission] = 1; } else {
|
$perms_checked[$forum_permission] = 0; } }
| $perms_checked[$forum_permission] = 0; } }
|
Zeile 1208 | Zeile 1213 |
---|
$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 1218 | Zeile 1223 |
---|
else { $inherited_text = $lang->custom_permission;
|
else { $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, "onclick" => $default_click))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");
|
Zeile 1301 | Zeile 1306 |
---|
admin_redirect("index.php?module=forum-management"); }
|
admin_redirect("index.php?module=forum-management"); }
|
$fid = $mybb->get_input('fid', 1);
| $fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
$plugins->run_hooks("admin_forum_management_edit");
| $plugins->run_hooks("admin_forum_management_edit");
|
Zeile 1312 | Zeile 1317 |
---|
$errors[] = $lang->error_missing_title; }
|
$errors[] = $lang->error_missing_title; }
|
$pid = $mybb->get_input('pid', 1);
| $pid = $mybb->get_input('pid', MyBB::INPUT_INT);
|
if($pid == $mybb->input['fid']) {
| if($pid == $mybb->input['fid']) {
|
Zeile 1320 | Zeile 1325 |
---|
} else {
|
} else {
|
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'"); while($child = $db->fetch_array($query))
| $query = $db->simple_select('forums', 'parentlist', "fid='{$pid}'"); $parents = explode(',', $db->fetch_field($query, 'parentlist')); if(in_array($mybb->input['fid'], $parents))
|
{
|
{
|
if($child['fid'] == $pid) { $errors[] = $lang->error_forum_parent_child; break; }
| $errors[] = $lang->error_forum_parent_child;
|
} }
| } }
|
Zeile 1368 | Zeile 1370 |
---|
"linkto" => $db->escape_string($mybb->input['linkto']), "type" => $db->escape_string($type), "pid" => $pid,
|
"linkto" => $db->escape_string($mybb->input['linkto']), "type" => $db->escape_string($type), "pid" => $pid,
|
"disporder" => (int)$mybb->input['disporder'], "active" => (int)$mybb->input['active'], "open" => (int)$mybb->input['open'], "allowhtml" => (int)$mybb->input['allowhtml'], "allowmycode" => (int)$mybb->input['allowmycode'], "allowsmilies" => (int)$mybb->input['allowsmilies'], "allowimgcode" => (int)$mybb->input['allowimgcode'], "allowvideocode" => (int)$mybb->input['allowvideocode'], "allowpicons" => (int)$mybb->input['allowpicons'], "allowtratings" => (int)$mybb->input['allowtratings'], "usepostcounts" => (int)$mybb->input['usepostcounts'], "usethreadcounts" => (int)$mybb->input['usethreadcounts'], "requireprefix" => (int)$mybb->input['requireprefix'],
| "disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT), "active" => $mybb->get_input('active', MyBB::INPUT_INT), "open" => $mybb->get_input('open', MyBB::INPUT_INT), "allowhtml" => $mybb->get_input('allowhtml', MyBB::INPUT_INT), "allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT), "allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), "allowimgcode" => $mybb->get_input('allowimgcode', MyBB::INPUT_INT), "allowvideocode" => $mybb->get_input('allowvideocode', MyBB::INPUT_INT), "allowpicons" => $mybb->get_input('allowpicons', MyBB::INPUT_INT), "allowtratings" => $mybb->get_input('allowtratings', MyBB::INPUT_INT), "usepostcounts" => $mybb->get_input('usepostcounts', MyBB::INPUT_INT), "usethreadcounts" => $mybb->get_input('usethreadcounts', MyBB::INPUT_INT), "requireprefix" => $mybb->get_input('requireprefix', MyBB::INPUT_INT),
|
"password" => $db->escape_string($mybb->input['password']),
|
"password" => $db->escape_string($mybb->input['password']),
|
"showinjump" => (int)$mybb->input['showinjump'], "style" => (int)$mybb->input['style'], "overridestyle" => (int)$mybb->input['overridestyle'], "rulestype" => (int)$mybb->input['rulestype'],
| "showinjump" => $mybb->get_input('showinjump', MyBB::INPUT_INT), "style" => $mybb->get_input('style', MyBB::INPUT_INT), "overridestyle" => $mybb->get_input('overridestyle', MyBB::INPUT_INT), "rulestype" => $mybb->get_input('rulestype', MyBB::INPUT_INT),
|
"rulestitle" => $db->escape_string($mybb->input['rulestitle']), "rules" => $db->escape_string($mybb->input['rules']),
|
"rulestitle" => $db->escape_string($mybb->input['rulestitle']), "rules" => $db->escape_string($mybb->input['rules']),
|
"defaultdatecut" => (int)$mybb->input['defaultdatecut'],
| "defaultdatecut" => $mybb->get_input('defaultdatecut', MyBB::INPUT_INT),
|
"defaultsortby" => $db->escape_string($mybb->input['defaultsortby']), "defaultsortorder" => $db->escape_string($mybb->input['defaultsortorder']), );
| "defaultsortby" => $db->escape_string($mybb->input['defaultsortby']), "defaultsortorder" => $db->escape_string($mybb->input['defaultsortorder']), );
|
Zeile 1400 | Zeile 1402 |
---|
// 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)
|
{
| {
|
case "sqlite": case "pgsql": $query = $db->simple_select("forums", "fid", "','||parentlist||',' LIKE '%,$fid,%'");
| case "sqlite": case "pgsql": $query = $db->simple_select("forums", "fid", "','||parentlist||',' LIKE '%,$fid,%'");
|
Zeile 1410 | Zeile 1412 |
---|
}
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']}'"); } }
| $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'"); } }
|
Zeile 1421 | Zeile 1423 |
---|
{ // Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_ if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))
|
{ // Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_ if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))
|
{ continue; }
list(, $gid) = explode('fields_', $id);
| { continue; }
list(, $gid) = explode('fields_', $id);
|
if($mybb->input['fields_default_'.$gid] == $permission && $mybb->input['fields_inherit_'.$gid] == 1) {
| if($mybb->input['fields_default_'.$gid] == $permission && $mybb->input['fields_inherit_'.$gid] == 1) {
|
Zeile 1440 | Zeile 1442 |
---|
$permission = explode(',', $permission); $permission = array_flip($permission); foreach($permission as $name => $value)
|
$permission = explode(',', $permission); $permission = array_flip($permission); foreach($permission as $name => $value)
|
{
| {
|
$permission[$name] = 1;
|
$permission[$name] = 1;
|
} }
| } }
|
foreach(array('canview','canpostthreads','canpostreplys','canpostpolls') as $name) { if(in_array($name, $permission) || $permission[$name])
|
foreach(array('canview','canpostthreads','canpostreplys','canpostpolls') as $name) { if(in_array($name, $permission) || $permission[$name])
|
{
| {
|
$permissions[$name][$gid] = 1; } else
| $permissions[$name][$gid] = 1; } else
|
Zeile 1457 | Zeile 1459 |
---|
} } }
|
} } }
|
|
|
$cache->update_forums();
$canview = $permissions['canview'];
| $cache->update_forums();
$canview = $permissions['canview'];
|
Zeile 1476 | 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->output_nav_tabs($sub_tabs, 'edit_forum_settings');
|
$page->add_breadcrumb_item($lang->edit_forum); $page->output_header($lang->edit_forum);
$page->output_nav_tabs($sub_tabs, 'edit_forum_settings');
|
|
|
$form = new Form("index.php?module=forum-management&action=edit", "post"); echo $form->generate_hidden_field("fid", $fid);
if($errors)
|
$form = new Form("index.php?module=forum-management&action=edit", "post"); echo $form->generate_hidden_field("fid", $fid);
if($errors)
|
{
| {
|
$page->output_inline_error($errors); $forum_data = $mybb->input; } else
|
$page->output_inline_error($errors); $forum_data = $mybb->input; } else
|
{
| {
|
$forum_data['title'] = $forum_data['name']; }
| $forum_data['title'] = $forum_data['name']; }
|
Zeile 1509 | Zeile 1511 |
---|
{ $existing_permissions[$existing['gid']] = $existing; }
|
{ $existing_permissions[$existing['gid']] = $existing; }
|
|
|
$types = array( 'f' => $lang->forum, 'c' => $lang->category );
$create_a_options_f = array(
|
$types = array( 'f' => $lang->forum, 'c' => $lang->category );
$create_a_options_f = array(
|
'id' => 'forum' );
| 'id' => 'forum' );
|
$create_a_options_c = array( 'id' => 'category' );
| $create_a_options_c = array( 'id' => 'category' );
|
Zeile 1537 | Zeile 1539 |
---|
$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', 'min' => 0)), 'disporder');
|
$form_container->end();
$form_container = new FormContainer($lang->additional_forum_options);
| $form_container->end();
$form_container = new FormContainer($lang->additional_forum_options);
|
Zeile 1851 | Zeile 1853 |
---|
if($mybb->input['action'] == "deletemod") {
|
if($mybb->input['action'] == "deletemod") {
|
$modid = (int)$mybb->input['id']; $isgroup = (int)$mybb->input['isgroup']; $fid = $mybb->get_input('fid', 1);
| $modid = $mybb->get_input('id', MyBB::INPUT_INT); $isgroup = $mybb->get_input('isgroup', MyBB::INPUT_INT); $fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
$query = $db->simple_select("moderators", "*", "id='{$modid}' AND isgroup = '{$isgroup}' AND fid='{$fid}'"); $mod = $db->fetch_array($query);
| $query = $db->simple_select("moderators", "*", "id='{$modid}' AND isgroup = '{$isgroup}' AND fid='{$fid}'"); $mod = $db->fetch_array($query);
|
Zeile 1897 | Zeile 1899 |
---|
$mod = $db->fetch_array($query);
$db->delete_query("moderators", "mid='{$mid}'");
|
$mod = $db->fetch_array($query);
$db->delete_query("moderators", "mid='{$mid}'");
|
| $plugins->run_hooks("admin_forum_management_deletemod_commit");
|
$cache->update_moderators();
|
$cache->update_moderators();
|
$plugins->run_hooks("admin_forum_management_deletemod_commit");
| |
$forum = get_forum($fid);
| $forum = get_forum($fid);
|
Zeile 1907 | Zeile 1910 |
---|
if($isgroup) { log_admin_action($mid, $mod['title'], $forum['fid'], $forum['name']);
|
if($isgroup) { log_admin_action($mid, $mod['title'], $forum['fid'], $forum['name']);
|
}
| }
|
else { log_admin_action($mid, $mod['username'], $forum['fid'], $forum['name']);
| else { log_admin_action($mid, $mod['username'], $forum['fid'], $forum['name']);
|
Zeile 1919 | Zeile 1922 |
---|
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") { $query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'");
| if($mybb->input['action'] == "delete") { $query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'");
|
Zeile 1929 | Zeile 1932 |
---|
// 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"); }
|
// User clicked no if($mybb->input['no']) { admin_redirect("index.php?module=forum-management"); }
$plugins->run_hooks("admin_forum_management_delete");
if($mybb->request_method == "post") { $fid = $mybb->get_input('fid', 1);
| // User clicked no if($mybb->input['no']) { admin_redirect("index.php?module=forum-management"); }
$plugins->run_hooks("admin_forum_management_delete");
if($mybb->request_method == "post") { $fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
$forum_info = get_forum($fid);
$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'");
| $forum_info = get_forum($fid);
$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'");
|
Zeile 1987 | Zeile 1990 |
---|
$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();
| $db->delete_query("forumpermissions", "fid='{$fid}' {$delquery}");
|
$update_stats = array( 'numthreads' => "-".$stats['threads'],
| $update_stats = array( 'numthreads' => "-".$stats['threads'],
|
Zeile 2001 | Zeile 2001 |
---|
update_stats($update_stats);
$plugins->run_hooks("admin_forum_management_delete_commit");
|
update_stats($update_stats);
$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 2021 | Zeile 2025 |
---|
$mybb->input['fid'] = 0; }
|
$mybb->input['fid'] = 0; }
|
$fid = $mybb->get_input('fid', 1);
| $fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
if($fid) { $forum = get_forum($fid);
| if($fid) { $forum = get_forum($fid);
|
Zeile 2038 | Zeile 2042 |
---|
{ // Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_ if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))
|
{ // Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_ if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))
|
{
| {
|
continue; }
| continue; }
|
Zeile 2073 | Zeile 2077 |
---|
} } }
|
} } }
|
$cache->update_forums();
| |
$canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
| $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
|
Zeile 2083 | Zeile 2085 |
---|
$canpostreplies = $permissions['canpostreplys'];
save_quick_perms($fid);
|
$canpostreplies = $permissions['canpostreplys'];
save_quick_perms($fid);
|
|
|
$plugins->run_hooks("admin_forum_management_start_permissions_commit");
|
$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']);
|
Zeile 2103 | Zeile 2107 |
---|
if(!empty($mybb->input['usergroup'])) { $isgroup = 1;
|
if(!empty($mybb->input['usergroup'])) { $isgroup = 1;
|
$gid = (int)$mybb->input['usergroup'];
| $gid = $mybb->get_input('usergroup', MyBB::INPUT_INT);
|
if(!$groupscache[$gid]) {
| if(!$groupscache[$gid]) {
|
Zeile 2175 | Zeile 2179 |
---|
$db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'"); }
|
$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');
| else { flash_message($lang->error_moderator_already_added, 'error');
|
Zeile 2191 | Zeile 2196 |
---|
} } else
|
} } else
|
{
| {
|
flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
| flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
|
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']);
| // Log admin action log_admin_action('orders', $forum['fid'], $forum['name']);
|
Zeile 2551 | Zeile 2556 |
---|
foreach($usergroups as $group) {
|
foreach($usergroups as $group) {
|
$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".$group['title'];
| $modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".htmlspecialchars_uni($group['title']);
|
}
if(!isset($mybb->input['usergroup']))
| }
if(!isset($mybb->input['usergroup']))
|
Zeile 2583 | Zeile 2588 |
---|
// Autocompletion for usernames echo ' <link rel="stylesheet" href="../jscripts/select2/select2.css">
|
// Autocompletion for usernames echo ' <link rel="stylesheet" href="../jscripts/select2/select2.css">
|
<script type="text/javascript" src="../jscripts/select2/select2.min.js"></script>
| <script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script>
|
<script type="text/javascript"> <!-- $("#username").select2({
|
<script type="text/javascript"> <!-- $("#username").select2({
|
placeholder: "Search for a user", minimumInputLength: 3, maximumSelectionSize: 3,
| placeholder: "'.$lang->search_for_a_user.'", minimumInputLength: 2,
|
multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
| multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
|
Zeile 2615 | Zeile 2619 |
---|
}).done(function(data) { callback(data); }); } },
|
}).done(function(data) { callback(data); }); } },
|
| });
$(\'[for=username]\').click(function(){ $("#username").select2(\'open\'); return false;
|
}); // --> </script>';
|
}); // --> </script>';
|
|
|
$buttons = array($form->generate_submit_button($lang->add_user_moderator)); $form->output_submit_wrapper($buttons); $form->end();
|
$buttons = array($form->generate_submit_button($lang->add_user_moderator)); $form->output_submit_wrapper($buttons); $form->end();
|
echo "</div>\n";
| echo "</div>\n";
|
$plugins->run_hooks("admin_forum_management_start_graph"); }
| $plugins->run_hooks("admin_forum_management_start_graph"); }
|
Zeile 2632 | Zeile 2641 |
---|
}
/**
|
}
/**
|
*
| * @param DefaultFormContainer $form_container * @param int $pid * @param int $depth
|
*/ function build_admincp_forums_list(&$form_container, $pid=0, $depth=1) {
| */ function build_admincp_forums_list(&$form_container, $pid=0, $depth=1) {
|
Zeile 2659 | Zeile 2670 |
---|
foreach($children as $forum) { $forum['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['name']); // Fix & but allow unicode
|
foreach($children as $forum) { $forum['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['name']); // Fix & but allow unicode
|
|
|
if($forum['active'] == 0)
|
if($forum['active'] == 0)
|
{
| {
|
$forum['name'] = "<em>".$forum['name']."</em>"; }
|
$forum['name'] = "<em>".$forum['name']."</em>"; }
|
|
|
if($forum['type'] == "c" && ($depth == 1 || $depth == 2)) { $sub_forums = ''; if(isset($forums_by_parent[$forum['fid']]) && $depth == 2)
|
if($forum['type'] == "c" && ($depth == 1 || $depth == 2)) { $sub_forums = ''; if(isset($forums_by_parent[$forum['fid']]) && $depth == 2)
|
{
| {
|
build_admincp_forums_list($form_container, $forum['fid'], $depth+1); } if($sub_forums)
| build_admincp_forums_list($form_container, $forum['fid'], $depth+1); } if($sub_forums)
|
Zeile 2680 | Zeile 2691 |
---|
$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&fid={$forum['fid']}\"><strong>{$forum['name']}</strong></a>{$sub_forums}</div>");
$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));
|
$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum-management&fid={$forum['fid']}\"><strong>{$forum['name']}</strong></a>{$sub_forums}</div>");
$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));
|
$popup = new PopupMenu("forum_{$forum['fid']}", $lang->options);
| $popup = new PopupMenu("forum_{$forum['fid']}", $lang->options);
|
$popup->add_item($lang->edit_forum, "index.php?module=forum-management&action=edit&fid={$forum['fid']}"); $popup->add_item($lang->subforums, "index.php?module=forum-management&fid={$forum['fid']}"); $popup->add_item($lang->moderators, "index.php?module=forum-management&fid={$forum['fid']}#tab_moderators");
| $popup->add_item($lang->edit_forum, "index.php?module=forum-management&action=edit&fid={$forum['fid']}"); $popup->add_item($lang->subforums, "index.php?module=forum-management&fid={$forum['fid']}"); $popup->add_item($lang->moderators, "index.php?module=forum-management&fid={$forum['fid']}#tab_moderators");
|
Zeile 2703 | Zeile 2714 |
---|
elseif($forum['type'] == "f" && ($depth == 1 || $depth == 2)) { if($forum['description'])
|
elseif($forum['type'] == "f" && ($depth == 1 || $depth == 2)) { if($forum['description'])
|
{
| {
|
$forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']); $forum['description'] = "<br /><small>".$forum['description']."</small>"; }
| $forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']); $forum['description'] = "<br /><small>".$forum['description']."</small>"; }
|
Zeile 2746 | Zeile 2757 |
---|
{ $sub_forums .= "{$comma} <a href=\"index.php?module=forum-management&fid={$forum['fid']}\">{$forum['name']}</a>"; $comma = $lang->comma;
|
{ $sub_forums .= "{$comma} <a href=\"index.php?module=forum-management&fid={$forum['fid']}\">{$forum['name']}</a>"; $comma = $lang->comma;
|
}
| }
|
// Have we reached our max visible subforums? put a nice message and break out of the loop ++$donecount; if($donecount == $mybb->settings['subforumsindex'])
| // Have we reached our max visible subforums? put a nice message and break out of the loop ++$donecount; if($donecount == $mybb->settings['subforumsindex'])
|
Zeile 2763 | Zeile 2774 |
---|
} }
|
} }
|
| /** * @param int $gid * @param int $fid * * @return string */
|
function retrieve_single_permissions_row($gid, $fid) { global $mybb, $lang, $cache, $db;
$query = $db->simple_select("usergroups", "*", "gid='{$gid}'"); $usergroup = $db->fetch_array($query);
|
function retrieve_single_permissions_row($gid, $fid) { global $mybb, $lang, $cache, $db;
$query = $db->simple_select("usergroups", "*", "gid='{$gid}'"); $usergroup = $db->fetch_array($query);
|
|
|
$query = $db->simple_select("forums", "*", "fid='{$fid}'"); $forum_data = $db->fetch_array($query);
|
$query = $db->simple_select("forums", "*", "fid='{$fid}'"); $forum_data = $db->fetch_array($query);
|
|
|
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'"); while($existing = $db->fetch_array($query)) { $existing_permissions[$existing['gid']] = $existing; }
|
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'"); while($existing = $db->fetch_array($query)) { $existing_permissions[$existing['gid']] = $existing; }
|
|
|
$cached_forum_perms = $cache->read("forumpermissions"); $field_list = array( 'canview' => $lang->permissions_canview,
| $cached_forum_perms = $cache->read("forumpermissions"); $field_list = array( 'canview' => $lang->permissions_canview,
|
Zeile 2788 | Zeile 2805 |
---|
);
$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);
|