From 48e7e0a91100925b29d3ca96321440b72802a19d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 2 Apr 2014 17:32:49 +0200 Subject: [PATCH] Revert "Changed album list to array instead of an associative array" This reverts commit 67788790b2d8070963f11845f8e9d77581290ff3. --- php/modules/album.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/php/modules/album.php b/php/modules/album.php index 1e5e8e0..2f8f0cb 100755 --- a/php/modules/album.php +++ b/php/modules/album.php @@ -38,35 +38,32 @@ function getAlbums($public) { while ($row = $result->fetch_object()) { - $album = array(); - // Info - $album['id'] = $row->id; - $album['title'] = $row->title; - $album['public'] = $row->public; - $album['sysdate'] = date('F Y', strtotime($row->sysdate)); + $return['content'][$row->id]['id'] = $row->id; + $return['content'][$row->id]['title'] = $row->title; + $return['content'][$row->id]['public'] = $row->public; + $return['content'][$row->id]['sysdate'] = date('F Y', strtotime($row->sysdate)); // Password - $album['password'] = ($row->password != ''); + $return['content'][$row->id]['password'] = false; + if ($row->password!='') $return['content'][$row->id]['password'] = true; // Thumbs - if (($public && $row->password=='') || (!$public)) { + if (($public&&$row->password=='')||(!$public)) { $albumID = $row->id; $result2 = $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = '$albumID' ORDER BY star DESC, " . substr($settings['sorting'], 9) . " LIMIT 0, 3"); $k = 0; while ($row2 = $result2->fetch_object()) { - $album['thumb'.$k] = $row2->thumbUrl; + $return['content'][$row->id]["thumb$k"] = $row2->thumbUrl; $k++; } } - - $return['content'][] = $album; } - $return['num'] = $result->num_rows; + $return["num"] = $result->num_rows; return $return;