• Resolved wpressnl

    (@wpressnl)


    We are working on a website with hundreds of galleries and about 50 albums.
    I have managed to add albums and galleries within the database / PHPMyAdmin.
    We are now at the point where the galleries are supposed to be added to the albums.
    Doing this manually is a very time consuming task.
    I have not found where album and galleries are being managed in the database.
    ngg_galleries and ngg_albums don’t seem to have columns that can be used for this?
    Is there someone who can help us out with this?
    Thanks a lot in advance for any help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Benjamin

    (@benjaminowens)

    Hi @wpressnl !

    Please do not directly manipulate the NextGEN tables; that will cause problems and break certain aspects of NextGEN. There is an internal API you can use in the classes C_Image_Mapper, C_Gallery_Mapper, C_Album_Mapper, and C_Gallery_Storage

    I’ll write some examples / documentation on how to use those classes on Monday and post them here.

    Benjamin

    (@benjaminowens)

    Thanks for your patience @wpressnl

    I’ve written a quick set of examples here that covers how to create galleries, albums (with children), upload images, and how to update existing albums / galleries / images.

    The internal API is a little complicated but comprehensive; let me know if you have any other questions.

    Thread Starter wpressnl

    (@wpressnl)

    No Problem! ??

    Thanks for the examples, I am going to give that a try.

    Request:
    Could you please provide an example of how to add existing (multiple) galleries to an existing album, that is what we are at rigt now.

    Have a great day!

    • This reply was modified 2 years, 8 months ago by wpressnl.
    • This reply was modified 2 years, 8 months ago by wpressnl.
    Benjamin

    (@benjaminowens)

    Galleries can be added to existing albums in the following way:

    
    $album_id = 5; // your album ID here
    $mapper = C_Album_Mapper::get_instance();
    $album = $mapper->find($album_id);
    $album->sortorder[] = '6';
    $album->sortorder[] = '7';
    $mapper->save($album);
    

    That will add galleries 6 and 7 to the album. As before for sub-albums just prefix their ID with a lowercase ‘a’.

    Thread Starter wpressnl

    (@wpressnl)

    Thanks a lot, now how am I going to be able to use this? ??

    Thread Starter wpressnl

    (@wpressnl)

    FYI: we hired a developer and got it to work by creating a form and hijacking this with the API (or something like that ?? )

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gallery / album link in database’ is closed to new replies.