- $with_promo = isset($params['with_promo']) ? $params['with_promo'] : false;
- $with_sex = isset($params['with_sex']) ? $params['with_sex'] : true;
- $with_link = isset($params['with_link']) ? $params['with_link'] : true;
- $user = $params['user'];
+ $params = new PlDict($params);
+ $with_promo = $params->b('promo', false) || $params->b('cat', false);
+ $with_sex = $params->b('sex', true);
+ $with_link = $params->b('link', true);
+ $with_dir = $params->b('directory', true);
+ $with_groupperms = $params->b('groupperms', true);
+ $user = $params->v('user');
+ if (is_int($user) || ctype_digit($user)) {
+ $user = User::getWithUID($user);
+ }