Skip to:
Content
Pages
Categories
Search
Top
Bottom

My replies and my topics: Detected by the user’s IP?


  • project_subdomain
    Participant

    @project_subdomain

    How does bbpress differ users and so their replies and topics under “my replies/topics”?

    I’m just checking my site and recognized that for regular users at “My replies” the replies of all users (instead of the one currently logged in) are displayed. As I created all users as admin for purpose of testing only, they have different usernames but all the same IP.

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

  • project_subdomain
    Participant

    @project_subdomain

    Solved it, maybe it’s helping others as well.
    It’s been caused by a custom code in my functions that did sort the replies and with which I had no problems so far. As bbpress now has this reply order feature integrated, it has not only become redundant but conflicting. First appearing when I star to use bbpress’ integrated reply order feature, resulting in showing all replies of a users as “my replies” instead of the user’s only.

    So without looking into the code I’m assuming it’s detected by the user’s ID as usual.


    Robkk
    Moderator

    @robkk

    I think this is somewhat related to your other topic here.

    Recently edited replies to the top

    I guess you have to make sure the reply sorting is only working on the single topics and not the user profile pages.

    You can try something like this to see if it works. You may not even need the second conditional bbp_is_single_user() but I was making sure.

    function custom_bbp_has_replies( $args ) { 
        if ( bbp_is_single_topic{} && !bbp_is_single_user() ) { 
            $args['orderby'] .= 'post_modified';
            $args['order'] .= 'DESC';
        } 
        return $args; 
    } 
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );' );

    Since I am not 100% sure that I have the right conditionals since I haven’t tested this you can double check here.

    bbPress Conditional Tags


    project_subdomain
    Participant

    @project_subdomain

    @Robkk
    thanks again for your effort!
    Just had several tries after looking into the conditional tags also, it’s always saying that the user doesn’t have any replies to topics created yet.
    Also made sure now the code of the related topic-link is causing displaying all user’s replies.


    Robkk
    Moderator

    @robkk

    Try the above edited function again to see if it works.


    project_subdomain
    Participant

    @project_subdomain

    great, it’s working! thank you so much – really saved my day (night already)! just had to change some brackets. so this is working:

    function custom_bbp_has_replies( $args ) { 
        if ( bbp_is_single_topic() && !bbp_is_single_user() ) { 
            $args['orderby'] .= 'post_modified';
            $args['order'] .= 'DESC';
        } 
        return $args; 
    } 
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );

    project_subdomain
    Participant

    @project_subdomain

    UPDATE: sorry, thought code is causing the browser’s title as ” ‘s” on all non-bbpress-related pages. need to find the reason which does not seem to be in relation to this topic.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar