|
@@ -2,12 +2,16 @@
|
|
|
class Album extends DBObjectAutoCreate {
|
|
|
public $Images=array();
|
|
|
|
|
|
- public static function GetAlbums() {
|
|
|
+ public static function GetAlbums($includeHidden=false, $includeEmpty=false) {
|
|
|
self::CreateTable("albums");
|
|
|
$albums=array();
|
|
|
- $albumIds=self::$PDO->query("SELECT album_id FROM albums WHERE album_deleted=0");
|
|
|
- while ($albumId=$albumIds->fetchColumn())
|
|
|
- $albums[]=new Album($albumId);
|
|
|
+ $hidden=$includeHidden?" AND album_hidden=":"";
|
|
|
+ $albumIds=self::$PDO->query("SELECT album_id FROM albums WHERE album_deleted=0".$hidden);
|
|
|
+ while ($albumId=$albumIds->fetchColumn()){
|
|
|
+ $album=new Album($albumId);
|
|
|
+ if ($includeEmpty || count($album->Images)>0)
|
|
|
+ $albums[]=$album;
|
|
|
+ }
|
|
|
return $albums;
|
|
|
}
|
|
|
|