<?php
include($bookdir."groups.php");
if (in_array($_GET['new_group'],$group_names)) {
array_push($notice,"A group with that name already exists!"); }
else if ($_GET['new_group'] == "") {
array_push($notice,"You didn't specify a valid group name!"); }
else {
$content = "<"."?php"."\r"."$"."group_names = array(";
if (count($group_names) > 0) {
foreach ($group_names as $g) { $content.= '"'.$g.'",'; }}
$content .= '"'.$_GET['new_group'].'");'."\r";
$content .= "$"."group_files = array(";
if (count($group_files) > 0) {
foreach ($group_files as $f) {
$content .= 'array(';
if (count($f) > 0) {
foreach ($f as $h) { $content .= '"'.$h.'",'; }}
$content .= '),'; }}
$content .= 'array());'."\r"."?".">";
$content = str_replace(",)",")",$content);
file_put_contents($bookdir."groups.php",$content); }
?>