Hello,
is there any method to fetch river only of users with a particular metadata value for a particular metadata field?
Thank you
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.
- Cim@manacim
Cim - 0 likes
- Gianclè Monna@gMonna1
Gianclè Monna - 0 likes
- Cim@manacim
Cim - 0 likes
- Gianclè Monna@gMonna1
Gianclè Monna - 0 likes
- Cim@manacim
Cim - 0 likes
- rjcalifornia@rjcalifornia
rjcalifornia - 0 likes
- Gianclè Monna@gMonna1
Gianclè Monna - 0 likes
- Gianclè Monna@gMonna1
Gianclè Monna - 0 likes
- Bruno Grossmann@bruno
Bruno Grossmann - 0 likes
- Gianclè Monna@gMonna1
Gianclè Monna - 0 likes
You must log in to post replies.What did you want to list from the users?
I want to filter the river only for users that have "New York" set as metadata "location" field, for example. Have I explained more clearly?
Oh ok, you pretty much want to limit each user's river based on location. Something like a local feed right?
No I'm sorry, that was an example. I want to add a tab in activity page (one more than all, mine, following) in which I list only river activity of users with "Premium" value for "profile_type" field. I'm sorry if I didn't explain very well!
Ohhhhh, so a filter tab where only premium members can see other premium members' activities?
There's a good discussion here:
https://elgg.org/discussion/view/2200450/how-to-combine-own-following-river-activity-tabs-into-one
You need to custom code this function into your elgg network. I don't know if there's a plugin for that.
I was thinking about using joins and wheres options to get subject_guids only with correct metastrings associated. Do you think this is a good idea? Any tip on this argument?
Hello,
I used this but it doesn't work. Any help? (If I remove joins and wheres it works)
$db = elgg_get_config('dbprefix');
$name_id = elgg_get_metastring_id('profilo_tipo');
$value1 = elgg_get_metastring_id('Pro');
$value2 = elgg_get_metastring_id('Business');
$options = array(
'offset' => 0,
'limit' => 20,
'type' => 'object',
'subtypes' => array('hjwall', 'izap_videos', 'blog'),
'no_results' => '',
);
$options['joins'][] = "JOIN {$db}metadata md1 ON (rv.subject_guid = md1.entity_guid)";
$options['joins'][] = "JOIN {$db}metadata md2 ON (rv.subject_guid = md2.entity_guid)";
$options['wheres'][] = "md1.name_id = {$name_id}";
$options['wheres'][] = "md2.name_id = {$name_id}";
$options['wheres'][] = "md1.value_id = {$value1}";
$options['wheres'][] = "md2.value_id = {$value2}";
$river = elgg_get_river($options);
I do not think you need two joins, one should be enough.
How about
You can also search for the way this query is formulated in error_log and try it in phpMyAdmin to see what is wrong.
Thank you, it works fine!