Forum Replies Created

Viewing 31 replies (of 31 total)
  • Thread Starter grtwordpress

    (@grtwordpress)

    Replying to myself. I created a solution that gives me what I want. In the nggCreateAlbum function in nggfunctions.php, look for the line:

    if ( !$subalbum = $nggdb->find_album(substr( $key, 1)) )
    continue;

    and insert the following:

    // george stuff
    //
    $gt_gal = $wpdb->get_results(‘SELECT * FROM ‘.$wpdb->nggallery.
    ‘ WHERE gid IN (\”.implode(‘\’,\”, $subalbum->gallery_ids).’\’)’, OBJECT_K);

    $gt_id = $gt_gal[$subalbum->gallery_ids[0]]->pageid;
    $gt_parent = get_post_ancestors($gt_id);
    $galleries[$key]->pagelink = get_permalink( $gt_parent[0]);
    $galleries[$key]->galdesc = html_entity_decode ( nggGallery::i18n($subalbum->albumdesc) ) .

    This sub-album contains ” . count($subalbum->gallery_ids) . ” albums.
    “;

    // $galleries[$key]->counter = count($subalbum->gallery_ids);

    // Make sure to comment out the lines below
    //
    // $galleries[$key]->pagelink = …
    // $galleries[$key]->galdesc = …

    // end of george stuff

    that’s it. You can see this at work at https://photoblog.torralba.us/photo-gallery

Viewing 31 replies (of 31 total)