sql_query($sql))) { bb_die('Unable to get quota settings #1'); } $pm_quota = $upload_quota = 0; if ($row = DB()->sql_fetchrow($result)) { do { if ($row['quota_type'] == QUOTA_UPLOAD_LIMIT) { $upload_quota = $row['quota_limit_id']; } elseif ($row['quota_type'] == QUOTA_PM_LIMIT) { $pm_quota = $row['quota_limit_id']; } } while ($row = DB()->sql_fetchrow($result)); } else { // Set Default Quota Limit $upload_quota = $attach_config['default_upload_quota']; $pm_quota = $attach_config['default_pm_quota']; } DB()->sql_freeresult($result); $template->assign_vars([ 'S_SELECT_UPLOAD_QUOTA' => quota_limit_select('user_upload_quota', $upload_quota), 'S_SELECT_PM_QUOTA' => quota_limit_select('user_pm_quota', $pm_quota) ]); } if ($admin_mode == 'user' && $submit && @$_POST['delete_user']) { process_quota_settings($admin_mode, $user_id, QUOTA_UPLOAD_LIMIT, 0); process_quota_settings($admin_mode, $user_id, QUOTA_PM_LIMIT, 0); } elseif ($admin_mode == 'user' && $submit && $mode == 'save') { // Get the contents $upload_quota = get_var('user_upload_quota', 0); $pm_quota = get_var('user_pm_quota', 0); process_quota_settings($admin_mode, $user_id, QUOTA_UPLOAD_LIMIT, $upload_quota); process_quota_settings($admin_mode, $user_id, QUOTA_PM_LIMIT, $pm_quota); } if ($admin_mode == 'group' && $mode == 'newgroup') { return; } if ($admin_mode == 'group' && !$submit && isset($_POST['edit'])) { // Get group id again $group_id = get_var(POST_GROUPS_URL, 0); // Show the contents $sql = 'SELECT quota_limit_id, quota_type FROM ' . BB_QUOTA . ' WHERE group_id = ' . (int)$group_id; if (!($result = DB()->sql_query($sql))) { bb_die('Unable to get quota settings #2'); } $pm_quota = $upload_quota = 0; if ($row = DB()->sql_fetchrow($result)) { do { if ($row['quota_type'] == QUOTA_UPLOAD_LIMIT) { $upload_quota = $row['quota_limit_id']; } elseif ($row['quota_type'] == QUOTA_PM_LIMIT) { $pm_quota = $row['quota_limit_id']; } } while ($row = DB()->sql_fetchrow($result)); } else { // Set Default Quota Limit $upload_quota = $attach_config['default_upload_quota']; $pm_quota = $attach_config['default_pm_quota']; } DB()->sql_freeresult($result); $template->assign_vars([ 'S_SELECT_UPLOAD_QUOTA' => quota_limit_select('group_upload_quota', $upload_quota), 'S_SELECT_PM_QUOTA' => quota_limit_select('group_pm_quota', $pm_quota) ]); } if ($admin_mode == 'group' && $submit && isset($_POST['group_delete'])) { $group_id = get_var(POST_GROUPS_URL, 0); process_quota_settings($admin_mode, $group_id, QUOTA_UPLOAD_LIMIT, 0); process_quota_settings($admin_mode, $group_id, QUOTA_PM_LIMIT, 0); } elseif ($admin_mode == 'group' && $submit) { $group_id = get_var(POST_GROUPS_URL, 0); // Get the contents $upload_quota = get_var('group_upload_quota', 0); $pm_quota = get_var('group_pm_quota', 0); process_quota_settings($admin_mode, $group_id, QUOTA_UPLOAD_LIMIT, $upload_quota); process_quota_settings($admin_mode, $group_id, QUOTA_PM_LIMIT, $pm_quota); } }