예제 #1
0
/**
 * Returns a list of all albums decendent from an album
 *
 * @param object $album optional album. If absent the current album is used
 * @return array
 */
function getAllAlbums($album = NULL)
{
    global $_zp_current_album, $_zp_gallery;
    if (is_null($album)) {
        $album = $_zp_current_album;
    }
    if (!is_object($album)) {
        return;
    }
    $list = array();
    $subalbums = $album->getAlbums(0);
    if (is_array($subalbums)) {
        foreach ($subalbums as $subalbum) {
            $list[] = $subalbum;
            $sub = newAlbum($subalbum);
            $list = array_merge($list, getAllAlbums($sub));
        }
    }
    return $list;
}
예제 #2
0
<?php

require 'libs/Smarty.class.php';
require 'functions/getAlbumList.php';
require 'functions/generateAlbumXML.php';
$smarty = new Smarty();
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 120;
// Global vars used in process
$files_music_found = 0;
$files_covers_found = 0;
$dir_found = 0;
$folder_depth = 0;
$generatedXML = "";
$trackID = 1;
$albumID = 1;
$rootPath = "../data/";
$xmlPath = "xml/";
$path = $rootPath;
// CLEAN FOLDER LOOKING FOR SPECIAL CHAR (like &)
cleanAlbumFolder($path);
// GENERATE XML FROM MUSIC LIBRARY
generateAlbumList($path);
// Listing albums to display results
$arrayAlbums = getAllAlbums();
$smarty->assign("arrayAlbums", $arrayAlbums);
$smarty->display('generateAlbumList.tpl');
/**
 * @deprecated
 */
function getAllSubalbums($param = NULL)
{
    deprecated_function_notify(gettext('Use getAllAlbums().'));
    return getAllAlbums($param);
}
예제 #4
0
session_start();
$ip = get_client_ip();
$nick = $_SESSION['nick'];
$email = $_SESSION['email'];
if (isset($_GET['target'])) {
    $targetNick = $_GET['target'];
    $result = "";
    switch ($target) {
        case "ADMIN":
            break;
        case "ALL":
            if (isset($nick)) {
                $result = $result . printAlbums(getAlbums($nick), false);
                $result = $result . printAlbums(getAllAlbums("limited", $nick), false);
            }
            $result = $result . printAlbums(getAllAlbums("public", $nick), false);
            addAction($nick, $email, $ip, "all_albums");
            break;
        case $nick:
            $result = $result . printAlbums(getAlbums($nick), true);
            addAction($nick, $email, $ip, "self_albums");
            break;
        default:
            if (isset($nick)) {
                $result = $result . printAlbums(getAlbums($targetNick), false);
                $result = $result . printAlbums(getAlbumsByAccess("limited", null), false);
            }
            $result = $result . printAlbums(getAlbumsByAccess("public", null), false);
            addAction($nick, $email, $ip, "others_albums");
            break;
    }
예제 #5
0
<?php

include '../admin/config.php';
include '../admin/mysql.open.php';
include '../admin/functions.php';
$albums = getAllAlbums('DESC');
$response = [];
foreach ($albums as $album) {
    $albumId = $album['AlbumID'];
    $response[$albumId] = $album;
    $response[$albumId]['images'] = getAlbumImages($albumId, 'DESC');
}
include '../admin/mysql.close.php';
echo json_encode($response);
/**
 * Gets the number of all subalbums of all subalbum levels of either the current album or $albumobj
 *
 * @param object $albumobj Optional album object to check
 * @param string $pre Optional text you want to print before the number
 * @return bool
 */
function getNumAllSubalbums($albumobj, $pre = '')
{
    global $_zp_gallery, $_zp_current_album;
    if (is_null($albumobj)) {
        $albumobj = $_zp_current_album;
    }
    $count = '';
    $albums = getAllAlbums($_zp_current_album);
    if (count($albums) != 0) {
        $count = '';
        foreach ($albums as $album) {
            $count++;
        }
        return $pre . $count;
    } else {
        return false;
    }
}
예제 #7
0
 	case 'getGenres': //retourne tous les genres disponibles en brut->ok
 		$mySqueezeCLI = new SqueezeCLI(getGenres());
 		$response = $mySqueezeCLI->receiveCLI();
 		echo $response."\n";
 		break;
 */
 case 'listGenres':
     //formate le résultat de getGenres en html ->ok
     $mySqueezeCLI = new SqueezeCLI(getGenres());
     //var_dump($mySqueezeCLI);
     $response = $mySqueezeCLI->receiveCLI();
     listGenres($response);
     break;
 case 'getAllAlbums':
     //retourne tous les albums disponibles (avec nom, artiste, pochette) ->ok
     $mySqueezeCLI = new SqueezeCLI(getAllAlbums());
     $response = $mySqueezeCLI->receiveCLI();
     echo $response . "\n";
     break;
 case 'getAlbumsByGenre':
     //les fichiers au format mp3 n'indique pas forcément le genre de l'album, que l'on peut retrouver dans ses titres exemple: setAlbumsGenre_Hip-hop/Rap 5
     //recherche tous les titres avec genre = parameter, puis recherche leurs albums
     //print_r($tabAlbumsGenre);
     //setAlbumsGenre retourne un tableau contenant key -> album_id | value -> genre
     //echo "contenu de la SESSION AlbumGenre \n";
     //print_r($_SESSION['AlbumGenre']);
     $tabResponse = getAlbumsByIdGenre($parameter);
     //echo "les albums correspondant au genre \n";
     //print_r($tabResponse);
     foreach ($tabResponse as $key => $response) {
         listAlbumsGenre($response);