get_group_info($conn, $_GET['id']);
if (!isset($group) || empty($group)) {
header("Location: group.php");
$_SESSION['err'] = "You followed a broken link";
}
}
if (isset($_SESSION['err'])) {
?>
";
$author_info = $user_info->get_user_info($conn, $group['author']);
echo "
";
$group_members = $group_info->get_group_members($conn, $_GET['id']);
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 "
Featured: ".implode(", ", $members_array)."
";
}
if (!empty($group['image_list'])) echo "
Images: ".count(explode(" ", $group['image_list']))."
";
$upload_time = new DateTime($group['created_on']);
echo "
Created at: ".$upload_time->format('d/m/Y H:i:s T')."
";
?>
Last Modified: ".$diff->time($group['last_modified'])."";
if ($_GET['mode'] == "edit") {
if ($_SESSION['id'] == $group['author'] || $user_info->is_admin($conn, $_SESSION['id'])) {
echo "
";
?>
Update title";
?>
";
while ($image = mysqli_fetch_array($image_request)) {
if (in_array($image['id'], $image_list)) {
echo "
";
} else {
echo "
";
}
}
echo "
";
echo "
Back";
}
} else {
if ($_SESSION['id'] == $group['author'] || $user_info->is_admin($conn, $_SESSION['id'])) {
echo "
Edit";
}
?>
";
$cover_image = $image_info->get_image_info($conn, $image_list[array_rand($image_list, 1)]);
if (!empty($cover_image['imagename'])) {
?>
src='images/'/>
";
}
?>
Nothing here!
There are no images in the group, add some!
";
echo "";
} else {
echo "
";
}
if (isset($_GET['id']) && !empty($_GET['id'])) {
if (isset($_GET['mode']) && $_GET['mode'] == "edit") {
$image_request = mysqli_query($conn, "SELECT * FROM images ORDER BY id DESC");
while ($image = mysqli_fetch_array($image_request)) {
// Getting thumbnail
if (file_exists("images/thumbnails/".$image['imagename'])) {
$image_path = "images/thumbnails/".$image['imagename'];
} else {
$image_path = "images/".$image['imagename'];
}
if (in_array($image['id'], $image_list)) {
echo "
";
} else {
echo "
";
}
}
?>
NSFW
";
} else {
echo "
";
}
}
} catch(Exception $e) {
$e;
}
}
}
} elseif (!isset($_GET['id']) && empty($_GET['id'])) {
if ($_SESSION["loggedin"]) {
echo "
";
?>
get_image_info($conn, $image_list[array_rand($image_list, 1)]);
// Getting thumbnail
if (!empty($image['imagename'])) {
if (file_exists("images/thumbnails/".$image['imagename'])) {
$image_path = "images/thumbnails/".$image['imagename'];
} else {
$image_path = "images/".$image['imagename'];
}
} else {
$image_path = "assets/no_image.png";
}
// Check for NSFW tag
if (str_contains($image['tags'], "nsfw")) {
echo "
";
} else {
echo "
";
}
}
}
?>