Not logged in. · Lost password · Register
Forum: General Help and Support Plugins Plugin Wishlist RSS
Media Gallery folder upload limit and show folder in parent folder?
Maximum files in a media gallery folder/ namespace.
Avatar
Epi #1
Member for 2 weeks · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Media Gallery folder upload limit and show folder in parent folder?
I have come to love this script. All runs smoothly but I have some issues with the media manager.

Question 1
Is there a plugin or a fix to limit the amount of files you can upload in a folder?
Currently my main issue is that some folders would take ages to load not to mention bandwidth if you upload hundreds of images in one folder.
My plan is to implement lazyload for images also but that only brings me so far. If I ever implement that and figure out how to create
plugins I will share that one.
The ideal thing would be to add pagination but don't know if that's possible.
At least with a folder limit users know they have to create a new folder.

Question 2
Is there an easy way or plugin to show child folders in parent folders? Currently some folders are empty but they do have child folders. would be great if just a folder name would show up in parent folders.

I hope I placed it in the right place and thank you for your feedback or help.
This post was edited on 2018-11-29, 22:52 by Epi.
Avatar
Epi #2
Member for 2 weeks · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Made pagination work
I figured how to create pagination in the media gallery. But have some conflicts with the ajax
I'm posting my progress here on github: https://github.com/splitbrain/dokuwiki/issues/2607

In ..\inc\media.php and line 689 i modified the code to this:

if(!count($data)){
            echo '<div class="nothing">'.$lang['nothingfound'].'</div>'.NL;
        }else {
            if ($fullscreenview) {
                echo '<ul class="' . _media_get_list_type() . '">';
            }
            // How many items to list per page
            $nItemsPerPage = 10;
            $item_count = count($data);
            // How many pages will there be
            $max_pages = ceil($item_count / $nItemsPerPage);
            // What page are we currently on?
            $page = min($max_pages, filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT, array(
                'options' => array(
                'default'   => 1,
                'min_range' => 1,
                ),
            )));
            foreach( array_slice( $data, $nItemsPerPage*($page-2), $nItemsPerPage) as $item){
                if (!$fullscreenview) {
                    media_printfile($item,$auth,$jump);
                } else {
                    media_printfile_thumbs($item,$auth,$jump);
                }
            }
            if($_GET['page'] > 2)
            echo '<div class="li"><a href="/docuwiki/sidebar?do=media&ns='.$ns.'&page='.($_GET['page']-1).'" class="idx_dir selected"> previous </a></div>';
            if($_GET['page'] < $max_pages)
            echo '<div class="li"><a href="/docuwiki/sidebar?ns='.$ns.'&page='.($_GET['page']+1).'&tab_files=files&do=media" class="idx_dir selected"> next </a></div>';
           
           
        }
    }
}

It works when you click on open link in new tab but not withing the ajax working on that.
This post was edited on 2018-11-30, 04:54 by Epi.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-12-12, 20:01:00 (UTC +01:00)