In usersettings.php I have this field:
$item = elgg_view_field(['#type' => 'text','id' => 'my-user-setting','#label' => elgg_echo('plugin:usersettings:label'),'name' => 'params[my_user_setting]','value' => $my_user_setting,]);
$options = ['type' => 'user','query' => '> 1','fields' => ['private_settings' => ['my_user_setting'],],'limit' => false];echo elgg_list_entities($options);
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- Per Jensen@gillie
Per Jensen - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- Per Jensen@gillie
Per Jensen - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
You must log in to post replies.use elgg_list_entites($options, 'elgg_get_entities_from_plugin_user_settings');
https://github.com/Elgg/Elgg/blob/2.3/engine/lib/plugins.php#L324-L354
This uses a different getter function and you can get users based on their plugin user settings
or in Elgg 3 the specific params from elgg_get_entities_from_plugin_user_settings are part of elgg_get_entities and therefor it should work with just the normal elgg_list_entities()
Thank you very much. Can't really make it work though.
In private_settings table, name is not 'my_user_setting' but 'plugin:user_setting:my_plugin:my_user_setting' - which one to use?
Is '> 1' valid query or maybe 'IS NOT NULL'.
I'm using 3.0.
you have to supply 'plugin_id' => 'your plugin name' then the correct prefix gets made.
and a plugin_user_setting_name_value_pairs with name => 'your setting' value => 1 operand => >
https://github.com/Elgg/Elgg/blob/2.3/engine/lib/plugins.php#L337-L341
Ahh operand, thanks:
should work ;)