示例#1
0
文件: forum.php 项目: 994724435/Ride
                foreach ($grouplist as $gid => $v) {
                    $access = array('allowread' => array_value($allowread, $gid, 0), 'allowthread' => array_value($allowthread, $gid, 0), 'allowpost' => array_value($allowpost, $gid, 0), 'allowagree' => array_value($allowagree, $gid, 0), 'allowattach' => array_value($allowattach, $gid, 0), 'allowdown' => array_value($allowdown, $gid, 0));
                    forum_access_replace($fid, $gid, $access);
                }
            } else {
                forum_access_delete_by_fid($fid);
            }
            $arr['accesson'] = $accesson;
            $arr['brief'] = $brief;
            $arr['moduids'] = $moduids;
            $arr['seo_title'] = $seo_title;
            $arr['seo_keywords'] = $seo_keywords;
        }
        if (empty($forum)) {
            $arr['fid'] = $fid;
            $r = forum_create($arr);
            $r !== FALSE ? message(0, '创建成功') : message(11, '创建失败');
        }
        $r = forum_update($fid, $arr);
        $r !== FALSE ? message(0, '更新成功') : message(12, '更新失败');
    }
} elseif ($action == 'delete') {
    if ($method != 'POST') {
        message(-1, 'Method Error.');
    }
    $fid = param(2, 0);
    $forum = forum_read($fid);
    empty($forum) and message(1, '板块不存在');
    $r = forum_delete($fid);
    $r !== FALSE ? message(0, '删除成功') : message(1, '删除失败');
} elseif ($action == 'uploadicon') {
示例#2
0
         $valid = false;
     }
     if (isset($_POST['t_access']) && is_numeric($_POST['t_access'])) {
         $t_access = $_POST['t_access'];
     } else {
         $error_msg_array[] = gettext("You must supply a forum access level");
         $valid = false;
     }
     if (isset($_POST['t_default']) && $_POST['t_default'] == 'Y') {
         $t_default = 1;
     } else {
         $t_default = 0;
     }
     if ($valid) {
         $error_str = '';
         if ($new_fid = forum_create($t_webtag, $t_name, $t_owner_uid, $t_database, $t_access, $error_str)) {
             if ($t_default == 1) {
                 forum_update_default($new_fid);
             }
             header_redirect("admin_forums.php?webtag={$webtag}&page={$page}&added=true");
         } else {
             $error_msg_array[] = $error_str;
             $valid = false;
         }
     }
 } else {
     if (isset($_POST['updateforumsubmit'])) {
         $valid = true;
         if (isset($_POST['fid']) && is_numeric($_POST['fid'])) {
             $fid = $_POST['fid'];
         } else {
示例#3
0
         $valid = false;
     }
     if (isset($_POST['t_access']) && is_numeric($_POST['t_access'])) {
         $t_access = $_POST['t_access'];
     } else {
         $error_msg_array[] = gettext("You must supply a forum access level");
         $valid = false;
     }
     if (isset($_POST['t_default']) && $_POST['t_default'] == 'Y') {
         $t_default = 1;
     } else {
         $t_default = 0;
     }
     if ($valid) {
         $error_str = null;
         if (($new_fid = forum_create($t_webtag, $t_name, $t_owner_uid, $t_database, $t_access, true, $error_str)) !== false) {
             if ($t_default == 1) {
                 forum_update_default($new_fid);
             }
             header_redirect("admin_forums.php?webtag={$webtag}&page={$page}&added=true");
         } else {
             $error_msg_array[] = $error_str;
             $valid = false;
         }
     }
 } else {
     if (isset($_POST['updateforumsubmit'])) {
         $valid = true;
         if (isset($_POST['fid']) && is_numeric($_POST['fid'])) {
             $fid = $_POST['fid'];
         } else {
示例#4
0
    $valid = false;
    return;
}
if (!install_set_timezones()) {
    $valid = false;
    return;
}
if (!($admin_uid = user_create($admin_username, $admin_password, $admin_username, $admin_email))) {
    $valid = false;
    return;
}
if (!perm_update_global_perms($admin_uid, USER_PERM_ADMIN_TOOLS | USER_PERM_FORUM_TOOLS)) {
    $valid = false;
    return;
}
if (!($forum_fid = forum_create($forum_webtag, 'A Beehive Forum', $admin_uid, $config['db_database'], FORUM_UNRESTRICTED))) {
    $valid = false;
    return;
}
if (!forum_update_default($forum_fid)) {
    $valid = false;
    return;
}
if (!perm_update_user_forum_permissions($forum_fid, $admin_uid, USER_PERM_ADMIN_TOOLS)) {
    $valid = false;
    return;
}
if (!isset($skip_dictionary) || $skip_dictionary === false) {
    $dictionary_path = str_replace('\\', '/', rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR));
    if (!install_import_dictionary($dictionary_path)) {
        $valid = false;