combined river (friends + own posts)

Hello,

My goal is to make a river which combines my own river posts and the river posts of my friends. I've been trying this for the better part of january now, but I'm not getting any closer. Can anybody help me in this regard?

Thanks :)

  • algo así como borrar todas las pestañas y que combine mine y friends

  • This is done in the "All" Tab. May be you can remove the other tabs and rename that tab to "Activity" tab.

     

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • the all tab displays posts of non-friends though, and I don't want those ... How can I filter those out?

    I just want the friends posts and my own posts in 1 tab ...

     

  • hmm... You could use the code used on the friends tab and then merge it with the "mine" Tab.

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • Bueno tengo una duda, espero que me puedan ayudar, y queria agradecer a la comunidad por todas las respuestas que me han dado, ya he avanzado bastante. ahora me encuentro con este detalle

    en el Rivercoment, cuando alguien agrega un comentario por ejemplo cuando un usuario agrego una foto nueva, si yo agrego un comentario, este se repite en todos lo relacion a el usuario agrego una foto nueva, es decir si el usuario agrego 5 fotos, una por una, y se ve en el river, yo comento solo una de las actualizaciones de foto, pero mi comentario se ve en las 5 actualizaciones de fotos. como podria resolver ese detalle?

     

    Gracias

  • You'll have to make two calls to get_river_items - one for yourself and the other for friends. Array merge them and pass it to the view river/item/list with the other parameters.

    Unless you handle the offsets after the merge, the results will be pretty wonky for the pagination, but there is no other way short of writing raw SQL since the relationship param is not an array in get_river_items.

    Shorter version: it is pretty hard.

     

  • @rjcalifornia: Been there, done that, tried to make new functions, tried to merge them by editing the code, but it's no good ...

    @ Lucia: this does not apply for this topic, perhaps you can start a new discussion, and people would easily find your question and answer to it.

    @Shyam Somanadh: It's pretty hard allright. I'll try to figure out what you wrote and see if I can get it done. I've been messing around a lot already, but haven't started yet comprehending the database.

    Perhaps I could alter the function of the get_river_items and make the relationship parameter an array? would that work?

    Thanks for your input everybody :)

  • fraksken,

    That is certainly one option you have. Don't alter the function, just copy, rename and use it in your code/mod. Will make your life much easier with upgrades and stability of the site otherwise. But I am guessing that you already knew that :)

  • any code suggestion here like how to merge both codes to display friends and mine tab contents in a single tab????

  • combining these two pieces into one :-


            switch($orient) {
                . . .
                case 'mine':
                                $subject_guid = $_SESSION['user']->guid;
                                $relationship_type = '';
                                break;
                case 'friends':    $subject_guid = $_SESSION['user']->guid;
                                $relationship_type = 'friend';
                                break;
            . . .
            $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '');