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