• Resolved uamv

    (@uamv)


    Feature Request: I would like to allow multiple users access to the same dynamic directory. Currently, I think a dynamic directory can be constructed using user ID, username, or last name. If there’s little conflict, might you consider adding the ability to define a dynamic directory according to a user meta key/value pair? Thanks!

    https://www.ads-software.com/plugins/file-away/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author thomstark

    (@thomstark)

    There’s also user role. I’ll see if I can swing it. So you would need it to be something like:

    fa-usermeta[specifiedkey]

    and I would grab the key from inside the brackets and replace fa-usermeta[specifiedkey] with the value of the meta key, if it exists.

    Thread Starter uamv

    (@uamv)

    Yup. That’s what I’m needing. I have folders that need to be accessed by husband/wife unit and though they may have the same last name which could work as an identifier, we also have other couples that have the same last name, so it’s not unique. Thanks for looking into it!

    Thread Starter uamv

    (@uamv)

    And the implementation you outlined would work great, I think.

    Plugin Author thomstark

    (@thomstark)

    It’s actually fa-firstlast anyway, not just last name. It would need to be parentheses, correcting myself. Can’t put square brackets inside a shortcode.

    Thread Starter uamv

    (@uamv)

    Ah, that right. I do remember that now. And good call on the brackets … no breaking things here.

    Plugin Author thomstark

    (@thomstark)

    This works:

    $dir = 'fa-usermeta(meta1)fa-usermeta(meta2)fa-usermeta(meta3)';
    if(stripos($dir, 'fa-usermeta(') !== false)
    {
    	$umetas = array();
    	$countmetas = preg_match_all('/\((.*)\)/U', $dir, $umetas);
    }
    if(is_array($umetas[1]))
    {
    	foreach($umetas[1] as $umeta)
    	{
    		$metavalue = get_user_meta($fa_userid, $umeta, true);
    		if($metavalue == '') $metavalue = 'fa-nullmeta';
    		$dir = str_replace('fa-usermeta('.$umeta.')', $metavalue, $dir);
    	}
    }
    echo $dir;
    Plugin Author thomstark

    (@thomstark)

    I tried it with:

    fa-usermeta(edit_comments_per_page)/fa-usermeta(admin_color)/fa-usermeta(nickname)

    and got:

    120/fresh/thomstark

    Thread Starter uamv

    (@uamv)

    Nice! I added the code to the fileaway_utility class and have it working properly on my end, as well … at least with a single meta key defined. Thanks and look forward to the next version. You are a coding beast, sir!

    Plugin Author thomstark

    (@thomstark)

    Well, there’s a bit more to it, as far as security checks go and stuff. I have it working in File Away, File Up, and Fileaway Values. There are also security checks run by the manager mode table javascript, and data-attributes added to the table tag, and checks in the breadcrumbs nav system. ?? I’ve just finished updating seven different documents, and I’m hoping I’ve remembered everything. HA.

    Thread Starter uamv

    (@uamv)

    Oh, for sure. I figured there were probably other necessary edits. I’ll let you tend that. You seem to have a good handle on this thing.

    Thread Starter uamv

    (@uamv)

    And … I suppose this is very likely the issue with the next thread I just posted here. :/

    Plugin Author thomstark

    (@thomstark)

    Fileaframe wouldn’t have anything to do with dynamic paths, no. I’ll look into this.

    Sorry wrong post, please ignore.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Dynamic Path via User Meta’ is closed to new replies.