query('SELECT * FROM '.$db->prefix.'groups ORDER BY g_id') or error('Unable to fetch user groups', __FILE__, __LINE__, $db->error()); $groups = array(); while ($cur_group = $db->fetch_assoc($result)) $groups[$cur_group['g_id']] = $cur_group; // Add/edit a group (stage 1) if (isset($_POST['add_group']) || isset($_GET['edit_group'])) { if (isset($_POST['add_group'])) { $base_group = intval($_POST['base_group']); $group = $groups[$base_group]; $mode = 'add'; } else // We are editing a group { $group_id = intval($_GET['edit_group']); if ($group_id < 1 || !isset($groups[$group_id])) message($lang_common['Bad request'], false, '404 Not Found'); $group = $groups[$group_id]; $mode = 'edit'; } $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['User groups']); $required_fields = array('req_title' => $lang_admin_groups['Group title label']); $focus_element = array('groups2', 'req_title'); define('PUN_ACTIVE_PAGE', 'admin'); require PUN_ROOT.'header.php'; generate_admin_menu('groups'); ?>