mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-23 02:06:16 +00:00
Progress on fixing shitty groups code?
This commit is contained in:
parent
be80166795
commit
89bab971f3
8 changed files with 252 additions and 122 deletions
22
app/app.php
22
app/app.php
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace App;
|
||||
|
||||
use Exception;
|
||||
|
||||
class Make {
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
|
@ -205,16 +207,20 @@ class Group {
|
|||
$group_array = mysqli_fetch_assoc($query);
|
||||
}
|
||||
|
||||
$image_list = explode(" ", $group_array['image_list']);
|
||||
|
||||
foreach ($image_list as $image) {
|
||||
$image_request = mysqli_query($conn, "SELECT author FROM images WHERE id = ".$image);
|
||||
|
||||
while ($author = mysqli_fetch_column($image_request)) {
|
||||
if (!in_array($author, $user_array)) {
|
||||
array_push($user_array, $author);
|
||||
try {
|
||||
$image_list = explode(" ", $group_array['image_list']);
|
||||
$user_array = array();
|
||||
foreach ($image_list as $image) {
|
||||
$image_request = mysqli_query($conn, "SELECT author FROM images WHERE id = ".$image);
|
||||
|
||||
while ($author = mysqli_fetch_column($image_request)) {
|
||||
if (!in_array($author, $user_array)) {
|
||||
$user_array[] = $author;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception) {
|
||||
|
||||
}
|
||||
|
||||
return($user_array);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue