Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: management.php 4049 2008-07-26 22:11:03Z Tikitiki $
| * $Id: management.php 4349 2009-04-14 19:46:21Z Tikitiki $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 618 | Zeile 618 |
---|
if(!$errors) {
|
if(!$errors) {
|
| if($pid < 0) { $pid = 0; }
|
$insert_array = array( "name" => $db->escape_string($mybb->input['title']), "description" => $db->escape_string($mybb->input['description']),
| $insert_array = array( "name" => $db->escape_string($mybb->input['title']), "description" => $db->escape_string($mybb->input['description']),
|
Zeile 641 | Zeile 645 |
---|
"modthreads" => intval($mybb->input['modthreads']), "mod_edit_posts" => intval($mybb->input['mod_edit_posts']), "modattachments" => intval($mybb->input['modattachments']),
|
"modthreads" => intval($mybb->input['modthreads']), "mod_edit_posts" => intval($mybb->input['mod_edit_posts']), "modattachments" => intval($mybb->input['modattachments']),
|
"style" => intval($mybb->input['fstyle']),
| "style" => intval($mybb->input['style']),
|
"overridestyle" => intval($mybb->input['overridestyle']), "rulestype" => intval($mybb->input['rulestype']), "rulestitle" => $db->escape_string($mybb->input['rulestitle']),
| "overridestyle" => intval($mybb->input['overridestyle']), "rulestype" => intval($mybb->input['rulestype']), "rulestitle" => $db->escape_string($mybb->input['rulestitle']),
|
Zeile 696 | Zeile 700 |
---|
$page->output_nav_tabs($sub_tabs, 'add_forum'); $form = new Form("index.php?module=forum/management&action=add", "post");
|
$page->output_nav_tabs($sub_tabs, 'add_forum'); $form = new Form("index.php?module=forum/management&action=add", "post");
|
|
|
if($errors) { $page->output_inline_error($errors);
| if($errors) { $page->output_inline_error($errors);
|
Zeile 776 | Zeile 780 |
---|
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_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->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>");
|
$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'))
|
$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_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>");
|
$styles = array( '0' => $lang->use_default );
| $styles = array( '0' => $lang->use_default );
|
Zeile 886 | Zeile 890 |
---|
$usergroups[$usergroup['gid']] = $usergroup; }
|
$usergroups[$usergroup['gid']] = $usergroup; }
|
| $cached_forum_perms = $cache->read("forumpermissions");
|
$field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments'); $form_container = new FormContainer($lang->forum_permissions);
| $field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments'); $form_container = new FormContainer($lang->forum_permissions);
|
Zeile 931 | Zeile 936 |
---|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
|
$default_checked = true; } if(!$perms) { $perms = $usergroup; $default_checked = true; } } $perm_check = "";
| $default_checked = true; } if(!$perms) { $perms = $usergroup; $default_checked = true; } } $all_check = ""; $perm_check = "";
|
$all_checked = true; foreach($field_list as $forum_permission) {
| $all_checked = true; foreach($field_list as $forum_permission) {
|
Zeile 957 | Zeile 963 |
---|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission]) { $value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission];
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission]) { $value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission];
|
}
| }
|
if(isset($mybb->input['permissions'])) { if($mybb->input['permissions'][$usergroup['gid']]['all']) { $all_checked = false;
|
if(isset($mybb->input['permissions'])) { if($mybb->input['permissions'][$usergroup['gid']]['all']) { $all_checked = false;
|
}
| }
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
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 988 | Zeile 994 |
---|
else { $perms_checked[$forum_permission] = 0;
|
else { $perms_checked[$forum_permission] = 0;
|
} }
| } }
|
$all_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = \$('permissions_{$usergroup['gid']}_all').checked;\n"; $perm_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = $value;\n"; }
| $all_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = \$('permissions_{$usergroup['gid']}_all').checked;\n"; $perm_check .= "\$('permissions_{$usergroup['gid']}_{$forum_permission}').checked = $value;\n"; }
|
Zeile 1018 | Zeile 1024 |
---|
$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'); admin_redirect("index.php?module=forum/management"); }
| { flash_message($lang->error_invalid_fid, 'error'); admin_redirect("index.php?module=forum/management"); }
|
$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'"); $forum_data = $db->fetch_array($query); if(!$forum_data)
|
$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'"); $forum_data = $db->fetch_array($query); if(!$forum_data)
|
{
| {
|
flash_message($lang->error_invalid_fid, 'error'); admin_redirect("index.php?module=forum/management"); }
|
flash_message($lang->error_invalid_fid, 'error'); admin_redirect("index.php?module=forum/management"); }
|
|
|
$fid = intval($mybb->input['fid']); if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
$fid = intval($mybb->input['fid']); if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
{
| {
|
$errors[] = $lang->error_missing_title; }
| $errors[] = $lang->error_missing_title; }
|
Zeile 1068 | Zeile 1074 |
---|
if(!$errors) {
|
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 1090 | Zeile 1100 |
---|
"modthreads" => intval($mybb->input['modthreads']), "mod_edit_posts" => intval($mybb->input['mod_edit_posts']), "modattachments" => intval($mybb->input['modattachments']),
|
"modthreads" => intval($mybb->input['modthreads']), "mod_edit_posts" => intval($mybb->input['mod_edit_posts']), "modattachments" => intval($mybb->input['modattachments']),
|
"style" => intval($mybb->input['fstyle']),
| "style" => intval($mybb->input['style']),
|
"overridestyle" => intval($mybb->input['overridestyle']), "rulestype" => intval($mybb->input['rulestype']), "rulestitle" => $db->escape_string($mybb->input['rulestitle']),
| "overridestyle" => intval($mybb->input['overridestyle']), "rulestype" => intval($mybb->input['rulestype']), "rulestitle" => $db->escape_string($mybb->input['rulestitle']),
|
Zeile 1389 | Zeile 1399 |
---|
$default_checked = true; } }
|
$default_checked = true; } }
|
| $all_check = "";
|
$perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
| $perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
|
Zeile 1397 | Zeile 1408 |
---|
{ $value = "true"; }
|
{ $value = "true"; }
|
else { $value = "false"; } if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
| else { $value = "false"; } if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
{ $value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission]; }
| { $value = $mybb->input['permissions'][$usergroup['gid']][$forum_permission]; }
|
Zeile 1412 | Zeile 1423 |
---|
if($mybb->input['permissions'][$usergroup['gid']]['all']) { $all_checked = false;
|
if($mybb->input['permissions'][$usergroup['gid']]['all']) { $all_checked = false;
|
}
| }
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission]) { $perms_checked[$forum_permission] = 1;
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission]) { $perms_checked[$forum_permission] = 1;
|
}
| }
|
else { $perms_checked[$forum_permission] = 0;
| else { $perms_checked[$forum_permission] = 0;
|
Zeile 1426 | Zeile 1437 |
---|
else { if($perms[$forum_permission] != 1)
|
else { if($perms[$forum_permission] != 1)
|
{
| {
|
$all_checked = false; } if($perms[$forum_permission] == 1)
| $all_checked = false; } if($perms[$forum_permission] == 1)
|
Zeile 1503 | Zeile 1514 |
---|
$db->delete_query("moderators", "mid='{$mid}'"); $query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");
|
$db->delete_query("moderators", "mid='{$mid}'"); $query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");
|
if($db->fetch_array($query))
| if($db->num_rows($query) == 0)
|
{ $updatequery = array( "usergroup" => "2"
| { $updatequery = array( "usergroup" => "2"
|
Zeile 1618 | Zeile 1629 |
---|
$db->delete_query("threads", "fid='{$fid}' {$delquery}"); $db->delete_query("posts", "fid='{$fid}' {$delquery}"); $db->delete_query("moderators", "fid='{$fid}' {$delquery}");
|
$db->delete_query("threads", "fid='{$fid}' {$delquery}"); $db->delete_query("posts", "fid='{$fid}' {$delquery}"); $db->delete_query("moderators", "fid='{$fid}' {$delquery}");
|
| $db->delete_query("forumsubscriptions", "fid='{$fid}' {$delquery}");
|
$cache->update_forums(); $cache->update_moderators();
| $cache->update_forums(); $cache->update_moderators();
|
Zeile 1650 | Zeile 1662 |
---|
if($mybb->input['update'] == "permissions") { $inherit = $mybb->input['default_permissions'];
|
if($mybb->input['update'] == "permissions") { $inherit = $mybb->input['default_permissions'];
|
| if(empty($mybb->input['permissions'])) { $mybb->input['permissions'] = array(); }
|
foreach($mybb->input['permissions'] as $gid => $permission) {
| foreach($mybb->input['permissions'] as $gid => $permission) {
|
Zeile 1911 | Zeile 1928 |
---|
$default_checked = true; } }
|
$default_checked = true; } }
|
| $all_check = "";
|
$perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
| $perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
|
Zeile 2035 | Zeile 2054 |
---|
foreach($forum_cache as $forum) {
|
foreach($forum_cache as $forum) {
|
$forums_by_parent[$forum['pid']][$val['disporder']][$forum['fid']] = $forum;
| $forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
|
} }
| } }
|
Zeile 2094 | Zeile 2113 |
---|
{ if($forum['description']) {
|
{ if($forum['description']) {
|
| $forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']);
|
$forum['description'] = "<br /><small>".$forum['description']."</small>"; }
| $forum['description'] = "<br /><small>".$forum['description']."</small>"; }
|
Zeile 2141 | Zeile 2161 |
---|
++$donecount; if($donecount == $mybb->settings['subforumsindex']) {
|
++$donecount; if($donecount == $mybb->settings['subforumsindex']) {
|
if(count($children) > $donecount)
| if(subforums_count($forums_by_parent[$pid]) > $donecount)
|
{
|
{
|
$sub_forums .= $comma.$lang->sprintf($lang->more_subforums, (count($children) - $donecount));
| $sub_forums .= $comma.$lang->sprintf($lang->more_subforums, (subforums_count($forums_by_parent[$pid]) - $donecount));
|
return; } }
| return; } }
|