diff --git a/app/app.php b/app/app.php index 7588f35..5593104 100644 --- a/app/app.php +++ b/app/app.php @@ -1,6 +1,8 @@ is_loggedin()) { + $group_name = $_SESSION['username']." new image group"; + $sql = "INSERT INTO groups (group_name, author, image_list) VALUES('$group_name', '".$_SESSION['id']."', '')"; + + mysqli_query($conn, $sql); + + $group_id = mysqli_insert_id($conn); + + ?> + + + +
By: ".$author_info['username']."
"; $group_members = $group_info->get_group_members($conn, $_GET['id']); - $members_array = array(); - foreach ($group_members as $member) { - $member_info = $user_info->get_user_info($conn, $member); - array_push($members_array, $member_info['username']); + if (!empty($group_members)) { + $members_array = array(); + foreach ($group_members as $member) { + $member_info = $user_info->get_user_info($conn, $member); + if (!empty($member_info['username'])) $members_array[] = $member_info['username']; + } + echo "Members: ".implode(", ", $members_array)."
"; } - echo "Members: ".implode(", ", $members_array)."
"; $upload_time = new DateTime($group['created_on']); echo "Created at: ".$upload_time->format('d/m/Y H:i:s T')."
"; @@ -167,11 +173,15 @@ var groupSubmit = $("#groupSubmit").val(); var images = getList(); - $("#sniffle").load("app/image/group.php", { - group_images: images, - group_id: , - group_submit: groupSubmit - }); + if (images <= 0) { + sniffleAdd('Oppsie', 'Groups need at least 1 image in them. Alternativly, you can delete this group.', 'var(--red)', 'assets/icons/cross.svg'); + } else { + $("#sniffle").load("app/image/group.php", { + group_images: images, + group_id: , + group_submit: groupSubmit + }); + } }); is_loggedin()) { + echo "In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.