• Resolved tamritz

    (@tamritz)


    I have a site set up to allow user sto register via a BP Invite Code. When I go to the page “register,” there are comments from all badge submissions and user profile avatars.

    Is there a setting to block this content from showing up to folks who are not logged into the site?

    Best,
    Sarah

    https://www.ads-software.com/plugins/badgeos/

Viewing 15 replies - 1 through 15 (of 26 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    What plugins for BadgeOS do you have installed, and do you have a url I could see it at? It may be a case of specific theme and site being set to display it the way it is. I can’t guarantee that it’s any one setting that we can predict and control.

    Thread Starter tamritz

    (@tamritz)

    Yep. It shows up on both the BuddyPress created/tied “register” and “activate” pages. The comments that appear on the page are feedback on achievements. It’s a bummer because it leaks content that is meant to be private to the community. The benefit of these two pages is to allow users to register with an activation code, which is pretty convenient.

    https://students.tamritz.org/register/
    https://students.tamritz.org/activate

    Plugins:
    BadgeOS 1.4.2
    BadgeOS Community Add-on 1.2.0
    BadgeOS Reports 1.0.1
    bbpress 2.5.4
    BuddyPress 2.0.2
    Buddypress invite codes for badgeos 1.1.0
    BadgeOS reports 1.0.1

    Thanks.
    Sarah

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just as a test, could you check and see if comments are enabled for these two pages, and if they are, disable them and see if they disappear.

    Thread Starter tamritz

    (@tamritz)

    Comments are off. Makes no difference.

    Thanks.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Is the theme a custom one? or something you downloaded somewhere? Given that I have never seen this happen before, my hunches are leaning towards something theme releated more than our plugins. However, I’m always willing to be wrong with this type of thing.

    Thread Starter tamritz

    (@tamritz)

    This theme is one I purchased. It’s pretty straight forward. I have been able to control everything on it pretty easily, even not being a WP expert coder. It seems like it has to do with the community add-on and how it interfaces with Buddypress. That’s my hunch. I could be totally wrong (as I am many other times!).

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Any chance I could get a new login? Shouldn’t need FTP still, I can check on things without. The one you sent me for the last issue appears to have been removed.

    Thread Starter tamritz

    (@tamritz)

    Yes. Sending now. Thanks.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    So, I know the “why” but I don’t know the “why why”. I’ve spent a good near 2 hours going through everything I can think of, however, I can’t continue on without more access to the whole install via FTP, and I know you’re not wanting to go that route right now.

    The “why”. I checked a WP global that is used on the register page in question, and looked through all of its values. For some reason, it’s providing a $post variable that has what should be the “page” specified for the “Register” page. It has a post slug of “register” like expected. However, it’s providing a post ID of 0 (zero), and a post type of bp_register. And that’s where I’m baffled. I am not sure where that post type is coming from, and I don’t know why the post ID is 0.

    Because of the post ID being what it is, it is simply querying for all of the comments in the site, instead of the ones associated with the queried page, which should be the “Register” page, which would have zero comments and thus nothing shown.

    The “why why”. I’m not sure how to solve this part. Ideally if I were to tackle that completely, I’d make a duplicate of the whole site that I could put on my localhost server and dissect as much as I wanted until I figured it out. However, I’m doubtful that’s an option at the present moment.

    Available solution that gets around this, but doesn’t technically solve it is this. We can edit the page.php template file, and have it only output the comments_template() function call if it’s NOT the “register” page. I want to get permission to add this before I touch anything, as it is your site. Just know it’d be a 1 minute thing to fix up for you.

    Thread Starter tamritz

    (@tamritz)

    Wow. I can’t believe you spent that much time on this. It is actually a good window to grab files I think. One course is winding down and the other is starting next week.

    I will DM you.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Will try to resume working on this a bit more today.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    So, upon further inspection, the “why why” above is from BuddyPress itself. It’s how it handles the registration/activate pages, and it sets its own bits and pieces for queries.

    So, I went with the idea I had to just prevent showing comments on the registration page. I had to modify the page.php template file, but it was very quick.

    It’s the only way I know of to get around this, at this point with this information.

    Thread Starter tamritz

    (@tamritz)

    Thanks! Can you send me what you changed on the page.php file, so I can keep a record of the changes?

    Is this specific to my sites or is this a problem that happens with other BuddyPress/BadgeOS configurations? (Curious, so I can keep this tucked away in my mind for the future.)

    Thank you, as always!
    Sarah

    Thread Starter tamritz

    (@tamritz)

    And PS. The comments are still appearing on the ACTIVATE page (disappeared from the COMMENTS page).

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    So, they’re gone properly on the register page, not gone properly on the activate page, and gone improperly on the comments page?

    Below is the newly edited version in your page.php file, that should clear up your activation page as well.

    <?php if ( ! bp_is_register_page() && ! bp_is_activation_page() ) : ?>
    	<?php comments_template(); ?>
    <?php endif; ?>

    Basically it’s saying “if not the register page and not the activation page, display the comments”

    As is, it’s specific to your site. I’m still not convinced it’s a “universal” thing as I can’t seem to recreate on my localhost, but this if statement above should get you by well enough.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Comments Appearing on Register Page’ is closed to new replies.