Album Hierarchy List

ashkir

Core license
V3 Beta tester
Big Chevereto
You can input Album Heirarchy on the Album pages by using this tidbit of code. This code was originally written by @Rodolfo for the anywhere_uploader I modified it to spit out an unordered list.

Be careful with placing it. If you're not comfortable with editing album theme files as an override, I recommend holding off for now.
PHP:
<?php
if (is_content_manager() or is_owner()) {
                ?>

    <?php
    $user_albums = [];
    if (get_album()['user']['id']) {
        $user_albums = function_exists('is_owner') && is_owner() && function_exists('get_user_items_editor') && isset(get_user_items_editor()['user_albums']) ? get_user_items_editor()['user_albums'] : CHV\User::getAlbums(CHV\Login::getUser());
    }
                        if (get_album()['user']['id']() && get_album()['user']['id']()['album_count'] > 0) {
                            ?>
                    <div class="center-box text-align-left">
                        <strong></strong><label for="upload-album-id">Album Heirarchy</label></strong>
                        <ul>
                            <?php
                                $user_album_options_html = [];
                            foreach ($user_albums as $album) {
                                $user_album_options_html[] = strtr('<li><a href="/%id"%selected>%name</li>', [
                                            '%selected' => (function_exists('get_album') && get_album()['id_encoded'] == $album['id_encoded']) ? ' selected' : null,
                                            '%id'    => $album['id_encoded'],
                                            '%name' => $album['indent_string'] . $album['name_with_privacy_readable_html']
                                        ]);
                            }
                            $user_album_options_html = implode("\n", $user_album_options_html);
                            echo $user_album_options_html; ?>
                        <?php
                            echo $user_album_options_html; ?>
                            </ul>
                    </div>
                    <?php
                    }
                    ?>

</td><td width="99%" style="vertical-align:top;">
    <?php
}
                ?>
Preview:
1610999600150.png
If anyone knows how to modify this to be instead of the login user to switch this to album owner, I would appreciate it <3
 

wilddog

Network license
would it be possible to request, at anyone's leisure, some specific information about where to place this correctly? I desperately need an album list feature and this appears to be the only one available.

Thanks, sorry for the inconvenience~
 
Top