Пример #1
0
/**
 * die Albenstruktur fuer eine Auswahlbox darstellen und das aktuelle Album vorauswählen
 * @param int    $parentId
 * @param string $vorschub
 * @param        $photoAlbum
 * @param        $phoId
 */
function subfolder($parentId, $vorschub, $photoAlbum, $phoId)
{
    global $gDb, $gCurrentOrganization, $photoAlbumsArray;
    $vorschub = $vorschub . '   ';
    $sqlConditionParentId = '';
    $parentPhotoAlbum = new TablePhotos($gDb);
    // Erfassen des auszugebenden Albums
    if ($parentId > 0) {
        $sqlConditionParentId .= ' AND pho_pho_id_parent = \'' . $parentId . '\' ';
    } else {
        $sqlConditionParentId .= ' AND pho_pho_id_parent IS NULL ';
    }
    $sql = 'SELECT *
              FROM ' . TBL_PHOTOS . '
             WHERE pho_id <> ' . $photoAlbum->getValue('pho_id') . $sqlConditionParentId . '
               AND pho_org_id = ' . $gCurrentOrganization->getValue('org_id');
    $childStatement = $gDb->query($sql);
    while ($adm_photo_child = $childStatement->fetch()) {
        $parentPhotoAlbum->clear();
        $parentPhotoAlbum->setArray($adm_photo_child);
        // add entry to array of all photo albums
        $photoAlbumsArray[$parentPhotoAlbum->getValue('pho_id')] = $vorschub . '&#151; ' . $parentPhotoAlbum->getValue('pho_name') . '&nbsp(' . $parentPhotoAlbum->getValue('pho_begin', 'Y') . ')';
        subfolder($parentPhotoAlbum->getValue('pho_id'), $vorschub, $photoAlbum, $phoId);
    }
    //while
}
Пример #2
0
}
$sql = $sql . ' ORDER BY pho_begin DESC';
$albumStatement = $gDb->query($sql);
$albumList = $albumStatement->fetchAll();
// Gesamtzahl der auszugebenden Alben
$albumsCount = $albumStatement->rowCount();
// falls zum aktuellen Album Fotos und Unteralben existieren,
// dann einen Trennstrich zeichnen
if ($photoAlbum->getValue('pho_quantity') > 0 && $albumsCount > 0) {
    $page->addHtml('<hr />');
}
$childPhotoAlbum = new TablePhotos($gDb);
$page->addHtml('<div class="row">');
for ($x = $getStart; $x <= $getStart + $gPreferences['photo_albums_per_page'] - 1 && $x < $albumsCount; ++$x) {
    // Daten in ein Photo-Objekt uebertragen
    $childPhotoAlbum->clear();
    $childPhotoAlbum->setArray($albumList[$x]);
    // folder of the album
    $ordner = SERVER_PATH . '/adm_my_files/photos/' . $childPhotoAlbum->getValue('pho_begin', 'Y-m-d') . '_' . $childPhotoAlbum->getValue('pho_id');
    // show album if album is not locked or it has child albums or the user has the photo module edit right
    if (file_exists($ordner) && $childPhotoAlbum->getValue('pho_locked') == 0 || $childPhotoAlbum->hasChildAlbums() || $gCurrentUser->editPhotoRight()) {
        // Zufallsbild fuer die Vorschau ermitteln
        $shuffle_image = $childPhotoAlbum->shuffleImage();
        // Album angaben
        if (file_exists($ordner) || $childPhotoAlbum->hasChildAlbums()) {
            $albumTitle = '<a href="' . $g_root_path . '/adm_program/modules/photos/photos.php?pho_id=' . $childPhotoAlbum->getValue('pho_id') . '">' . $childPhotoAlbum->getValue('pho_name') . '</a><br />';
        } else {
            $albumTitle = $childPhotoAlbum->getValue('pho_name');
        }
        $albumDate = $childPhotoAlbum->getValue('pho_begin', $gPreferences['system_date']);
        if ($childPhotoAlbum->getValue('pho_end') != $childPhotoAlbum->getValue('pho_begin')) {
Пример #3
0
$sql = 'SELECT pho.*, ' . $additionalFields . '
          FROM ' . TBL_PHOTOS . ' pho
               ' . $additionalTables . '
         WHERE (   pho_org_id = ' . $gCurrentOrganization->getValue('org_id') . '
               AND pho_locked = 0)
         ORDER BY pho_timestamp_create DESC
         LIMIT 10';
$statement = $gDb->query($sql);
$photo_album = new TablePhotos($gDb);
// ab hier wird der RSS-Feed zusammengestellt
// create RSS feed object with channel information
$rss = new RSSfeed($gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline, $gCurrentOrganization->getValue('org_homepage'), $gL10n->get('PHO_RECENT_ALBUMS_OF_ORGA', $gCurrentOrganization->getValue('org_longname')), $gCurrentOrganization->getValue('org_longname'));
// Dem RSSfeed-Objekt jetzt die RSSitems zusammenstellen und hinzufuegen
while ($row = $statement->fetch()) {
    // Daten in ein Photo-Objekt uebertragen
    $photo_album->clear();
    $photo_album->setArray($row);
    // set data for attributes of this entry
    // read folder structure to put them together and write to title
    $parents = '';
    $pho_parent_id = $photo_album->getValue('pho_pho_id_parent');
    while ($pho_parent_id > 0) {
        // Erfassen des Eltern Albums
        $sql = ' SELECT *
                  FROM ' . TBL_PHOTOS . '
                 WHERE pho_id = ' . $pho_parent_id;
        $parentsStatement = $gDb->query($sql);
        $adm_photo_parent = $parentsStatement->fetch();
        // Link zusammensetzen
        $parents = $adm_photo_parent['pho_name'] . ' > ' . $parents;
        // Elternveranst