Skip to:
Content
Pages
Categories
Search
Top
Bottom

Limiting comments to activities

  • Hi.
    I’d like to tweak my activity or entry loop so that only commenting to the activity is available. In other words, no comments directly to comments, just to the activity.
    As it is now the users may comment both activities and their comments, cause the comment link is available at both the activity and each of the comments. I see two possibilities on how to change this:
    1: Make the comment link only visible at the activity, not the comments, or…
    2: Make the comment link go to activity commenting, not directly to the comment under which the link was clicked.

    Any pointers as to the best way to go about this? All help greatly appreciated. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m also wondering if any of these conditionals can be used:
    `
    bp_is_user_activity()
    bp_is_activity_component()
    bp_is_activity_front_page()
    ยด
    Wondering if any of these or maybe other conditionals can be used to determine if it’s the activities or one of their comments being commented. If so, then it should be possible to hide the comment entry link under each comment, leaving it visible under the activity only. Suggestions?


    r-a-y
    Keymaster

    @r-a-y

    Those conditionals do not apply to activity comments.

    The easiest way is to use CSS to hide the comment link.

    The alternative is to copy the entry template into your child theme and edit:
    /bp-default/activity/entry.php

    As for nested comments, currently you’ll have to apply a filter to “bp_activity_recurse_comments” (located in bp-activity/bp-activity-templatetags.php):
    https://buddypress.trac.wordpress.org/browser/tags/1.2.9/bp-activity/bp-activity-templatetags.php#L678

    Don’t know anything about filters?
    http://themeshaper.com/2009/05/03/filters-wordpress-child-themes/ (tutorial applies to themes, but also works for plugns; there are a bunch of tutorials on the web as well!)

    This will get slightly easier to modify in BuddyPress v1.3 as activity comments now have a dedicated template file.

    So if I understand you correctly:
    1: If I use CSS to hide the comment link, it’ll be hidden under both the activity and under each comment?
    2: Using a filter to filter out recursive comments would hide those comments? Or would it hide the comment link as well, leaving only the comment link under the activity itself?

    I don’t have much coding experience so all help is greatly appreciated.

    Sorry for doubleposting, the edit link gives me a “page not found”.

    I’ve used CSS to hide the comment link under comments. The link still shows up below new comments to the activity, but only until the page is reloaded or refreshed. After that it is hidden. I’d like it to not be visible under new comments that have just been posted either. Any pointers? Are new comments visible just after being written read by a different function?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Limiting comments to activities’ is closed to new replies.
Skip to toolbar