• Resolved thezman

    (@thezman)


    So, Dealing with 250k files with sm,md,lg (1M+ files total)
    spread out over about 25,000 folders (users)
    all based on usernames.

    Of which there are ~7500 users/folders that need to be deleted
    and the remaining users need to be preserved

    While reviewing the documentation here
    https://ninjateam.gitbook.io/filebird/developer-zone/functions

    I see this great function
    $folder = FolderModel::findById( $folder_id, 'id, name, parent' );

    I need a way to do the following:
    – “Find ID by Folder Name”
    since all the folder names are based on the usernames

    I therefore need to query the database.
    I am guessing
    Some SQL like
    "GET ID FROM wp_fbv WHERE name='some name'"
    would work

    But I would have thought there would be time saving functions that do this already?

    Also need a way to do this
    – “Get all subfolders based on parent ID”
    for example, lets say user “joe_smith” has a folder “joe_smith”
    and there are eh, maybe 200 subfolders within like so
    /users/
    /users/joe_smith/
    /users/joe_smith/gallery_001
    /users/joe_smith/gallery_001/sunsets
    /users/joe_smith/gallery_001/dogs
    /users/joe_smith/gallery_001/cats
    /users/joe_smith/gallery_002/
    /users/joe_smith/gallery_002/this
    /users/joe_smith/gallery_003/that

    Is there a function like this?
    $subfolder_arr = FolderModel::findChildren( $folder_name = 'joe_smith', $level = 1);

    <strong>That returns an array like this:</strong>
    $subfolder_arr = array(
        1 => 'gallery_001',
        2 => 'gallery_002',
        3 => 'gallery_003',
    )

    Is there a function like this?
    $subfolder_arr = FolderModel::findChildren( $folder_name = 'joe_smith', $level = 2);

    That returns an array like this:

    $subfolder_arr = array(
        1 => array(4=>'sunsets', 5=>'dogs', 6=>'cats'),
        2 => array(7=>'this', 8=>'that'),
    )
    • This topic was modified 2 years, 9 months ago by thezman.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @thezman,

    Thanks for the observation.
    Those are not something currently supported in our plugin. We will consider it and get back soon.

    Cheers,
    -Rose-

    • This reply was modified 2 years, 9 months ago by Rose.
    Thread Starter thezman

    (@thezman)

    I see.
    Thank you for the reply.
    I know what to do here.
    Please consider this a feature request.
    Its a feature I would have been willing to pay for.
    *cheers

    Plugin Support Bruce

    (@ninjateamwp)

    Hi @thezman ,

    Thanks and this feature is well taken and would be forwarded to our developers unit.

    Kind regards,
    -Bruce-

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using the API and functions to search by name and return array+nesting’ is closed to new replies.