Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 24 replies - 1 through 24 (of 24 total)

  • deshmukh
    Participant

    @deshmukh

    Hello!

    Any ideas/ any help please?


    deshmukh
    Participant

    @deshmukh

    Any help here, please?


    deshmukh
    Participant

    @deshmukh


    deshmukh
    Participant

    @deshmukh

    @danbp Thanks! And apologies, my questions may appear to be too basic. This is partly because I am a newbie and, I guess, partly because our documentation needs further improvement.

    I am slowly getting a hang of what happens when something goes in functions.php/bp-custom.php.

    But still I am not able to achieve something that appears to be simple. May be, I will need to ask a better question. Which I will do, in a separate thread.


    deshmukh
    Participant

    @deshmukh

    @danbp No. That did not work. Everything is ‘default’.

    I think we will need to pass action = activity_update AND scope = groups in the function.

    How do I do that?

    And lastly, how do I define scope to include ONLY status updates (as post in ‘My Profile’)?


    deshmukh
    Participant

    @deshmukh

    @danbp thanks! For the first time, I could read the Codex, understand it and do something meaningful!

    In my functions.php, I added the following code:

    function myown_bp_activity( $retval ) { 
        $retval['scope'] = 'friends';                                                                                          
        return $retval;
      }
    
      add_filter('bp_after_has_activities_parse_args', 'myown_bp_activity' );
    

    This makes no difference at all. I guess, default for scope is friends. If I change ‘friends’ to ‘groups’, ALL activities show only group updates.

    The area where I am groping in the dark still is:

    • How do I modify ONLY the SWA? What should be the conditional? if (bp_is_SWA)?
    • Secondly, I can get ONLY groups. But I can not still get ONLY status updates. How do I get that? What should be the scope?

    deshmukh
    Participant

    @deshmukh

    @henrywright, I looked at the files at the github link provided by you. But no luck. Did not get it at all. Please see the last two comments made by me above. Any help you can offer would be greatly appreciated.


    deshmukh
    Participant

    @deshmukh

    @danbp this is intentionally another reply. Again, this is likely to be lengthy. So, please bear with me.

    Consider member1 is a member of private group PGA, and public group GB.

    site.com/activity includes updates in GB, and updates by other members.
    members/member1/activity/groups/ includes updates in PGA and GB.

    I wanted to merge the two — without duplicating content from GB. Any way to achieve that? Its perfectly OK if we can get that feed at site.com/activity or some other URL.

    On a side note, the advantages are:
    An one place, member1 gets to see ALL updates (whether private or public) AND we avoid duplication (GB is displayed both at site.com/activity and members/member1/activity/groups).


    deshmukh
    Participant

    @deshmukh

    @danbp Thanks! That helped me move to ‘display_comments’ => ‘stream’ without touching the buddypress core files! 🙂

    But that is not what I meant. This is going to be a lengthy reply. So, please bear with me.

    Chronology of events:
    1 Jan – Status update of Member A
    2 Jan – Status update of Member B
    3 Jan – Comment on Status update of Member A.

    Default behaviour — SWA appears as:
    – Status update of Member B of 2 Jan
    – Status update of Member A of 1 Jan
    – Comment of Jan 3 on Status update of Member A of Jan 1

    Modified SWA With your suggested function:
    – Comment of Jan 3 on Status update of Member A
    – Status update of Member B of Jan 2
    – Status update of Member A of Jan 1

    How I wanted it:
    – Status update of Member A of Jan 1
    – Comment of Jan 3 on Status update of Member A
    – Status update of Member B of Jan 2

    Any way to get this?

    By the way, on a side note, in my view, that is the most logical way of a reverse chronological sequence. Whenever an activity happens about a post like a comment, that entire conversation becomes a new conversation.

    Still, so so near yet so far. If you don’t mind a bit of mathematics, its lim n -> 1


    deshmukh
    Participant

    @deshmukh

    Any help here? I feel so near yet so far!


    deshmukh
    Participant

    @deshmukh

    Here is an update. I tried doing the same thing but changed directory to mytheme/buddypress/activity/index-directory.php with disastrous consequenes. With the code you had mentioned, it leads to a blank page and with bp-activity-template.php suitably renamed and modified, it gives an error.

    So, I guess, I will need to have the file in /mytheme/buddypress/activity and the name will need to be index-directory.php. But what goes in that file is still not known 🙂


    deshmukh
    Participant

    @deshmukh

    @henrywright, this is going to be one long conversation, I guess. And thanks for your patience.

    OK. Went through the Codex page again. And, as I understood it, created mytheme/buddypress/activity/single/index.php with the code you had given earlier: ‘display_comments’ => ‘stream’. No effect.

    Then I copied the whole bp-activity-template.php to the same location, renamed it as index.php and changed ‘display_comments’ => ‘stream’. Still no effect.

    Obviously, I am doing something wrong. How do I get this right?

    Also, note my earlier point. This change, when successful, only pulls the comments up — not the entire conversation on which the comment was made. But that was the effect I wanted. How do I get that achieved?

    Lastly, I guess, I will need to make similar changes to other areas (display of group activity /members/username/activity/groups, favorites /members/username/activity/favorites — to be specific) or it is the same activity loop that generates those pages, too and changes at one place will reflect through all loops?


    deshmukh
    Participant

    @deshmukh

    @henrywright Thanks! Here is what I did:

    edited /wp-content/plugin/buddypress/bp-activity/activity-template.php

    Found the activity loop and changed $defaults = array(
    ‘display_comments’ => ‘stream’

    That puts all comments on the top but only the comments are pulled to the top. What I really wanted was the entire conversation is pulled to the top.

    Also, I think what I have done is crude and somehow, not ‘proper’. For instance, when I update buddypress plugin, all my changes will be gone.

    How do I make sure that the changes remain?

    Also, I have gone through https://codex.buddypress.org/developer/function-examples/bp_activity_add/

    But still am nebulous about:
    You can add items to the activity stream using bp_activity_add(). You’d write a custom function and hook it to the relevant action which fires when a group message has been posted (see a)

    Can you elaborate?

    Lastly, the codex page talks about adding new activity to database. I hope, it makes sure that one gets to see messages posted to only those groups one is authorized to see.

    PS – When I crack it, is there any way I can contribute to the codex so other newbies like me have access to the stuff? How?

    Thanks!


    deshmukh
    Participant

    @deshmukh

    @henrywright I do not want to ‘add’ new activity. I just want that when one visits example.com/activity, it displays all profile updates (these are displayed even now), all updates to public groups (these, too, are displayed currently) AND all updates in private/ hidden groups where the concerned person is a member (this is NOT displayed currently.) How do I do that?

    Also, I understood the second part re threads with new comments coming to top. But could you please elaborate a bit? Do I need to add some code to bp-custom.php or mytheme/function.php? In this specific case, what code should I add?

    I am sorry if my question appear to be basic. I am a newbie — I like to guess, like many others coming to forums 🙂


    deshmukh
    Participant

    @deshmukh

    Any ideas here?


    deshmukh
    Participant

    @deshmukh

    Look the Codex up. There is a section on using custom stubs/ translations using .po and .mo files. That should do it.


    deshmukh
    Participant

    @deshmukh

    @r-a-y that was most helpful. Thanks.

    As an aside, is not there a way to mark a topic as resolved or upvote an answer?


    deshmukh
    Participant

    @deshmukh

    @Ahirhemant you need to start a new thread for your query


    deshmukh
    Participant

    @deshmukh

    @style960 there are two problems with that plugin. One, it does not integrate with the filter drop-down box and two, it does not search contents of private groups.

    Not searching in private groups is a more severe drawback.

    Any suggestions on rectifying the problem? Any other solution?


    deshmukh
    Participant

    @deshmukh

    @danbp

    This works great. Thanks.

    I could also change
    'link' => bp_get_activity_directory_permalink(),
    to
    'link' => 'http://google.com',

    and it worked as expected.

    I also tried my hand at bp_core_new_nav_item ('<li>https://codex.buddypress.org/developer/function-examples/core/bp_core_new_nav_item/</li>')

    But I am unable to add an arbitrary link to nav item. If I add a link declaration as in the case of sub nav. it gives out an error.

    Parse error: syntax error, unexpected ''link'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in /.../wp-content/themes/nu-white-child/functions.php on line 35

    Probably because the function does not expect a ‘link’ parameter.

    How do I add an arbitrary link to the nav item?


    deshmukh
    Participant

    @deshmukh

    Any help here? At least links to Codex areas that will be useful?


    deshmukh
    Participant

    @deshmukh

    @Henry Wright, sure I did. But it talked about adding only a specific link to something within Bbddypress.

    In point 6, I am trying to add an arbitrary link.

    Also, is it possible to do other points? I tried looking up the codex, but could not find appripriate content. May be, because I am a newbie 🙂


    deshmukh
    Participant

    @deshmukh

    @style960 thanks for suggesting selecting ‘Buddypress’ in screen options.

    But that does not solve my problem. How does one provide a link to /groups/groupname/admin, for instance?


    deshmukh
    Participant

    @deshmukh

    I am a newbie. So, this question.

    I have identified that file and that line. So, editing the template file should not be a problem.

    But, how do I copy the template over to my theme? I looked at the BP Codex but could not get any hint.

    Could you please give a link to the specific codex area I should look at?

    Here is an update. Got the BP Codex link after looking around a bit.

    For reference, this is the link: https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    All I did was create a buddypress/activity folder in the theme I was using, copied the post-form.php over to that folder and edited it to meet my needs.

    Thanks!

Viewing 24 replies - 1 through 24 (of 24 total)
Skip to toolbar