Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX Classic Support

Public Group active 3 months, 4 weeks ago

This group provides support for Commons In A Box Classic, our original software for community-building. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

Site Directory only shows public blogs (broken out of previous multi-issue post)

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 1 month ago by Ray.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 21, 2017 at 3:06 pm #6297
    Troy Welch
    Participant

    Hi all, I initially asked about this issue in the following post: https://commonsinabox.org/groups/help-support/forum/topic/user-roles-and-javascript/ along with another issue. I’ve broken it out for easier ‘findability’ and to untangle my two issues.

    The issue is with the Buddypress MPO (more privacy options) plugin installed only public blogs are shown in the Site Directory unless you are a superadmin.

    Thank you to Ray for providing the following advice in the other thread:

    BuddyPress only displays public sites in the Sites Directory for non-super admins:
    https://buddypress.trac.wordpress.org/browser/tags/2.8.2/src/bp-blogs/classes/class-bp-blogs-blog.php?marks=188-189#L163

    I had to work around this for another site I work on to modify the wb.public = 1 clause.

    I want to provide a little more detail on a complete fix and ask a couple of questions about the safety of this fix.

    First, with the MPO plugin active there are five privacy level which are store in the wp_blogs table in the public column with a numerical index as follows:

    1 Allow search engines to index this site
    0 Discourage search engines from indexing this site

    Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.
    -1 Visible only to registered users of this network
    -2 Visible only to registered users of this site
    -3 Visible only to administrators of this site

    I wanted to display the top three options above for my users, and as per Ray’s advice modified the wb.public = 1 clause to  wb.public >= -1

    Question 1: are there privacy options out there with an index higher than 1 that will be captured by my >= operator?

    Following the link above (which was a different version than I’m using) and then finding the corresponding spot in the function, I made this change. It worked perfectly, except…

    The list tab “All Sites” was still displaying the old tab total. Clearly a similar change needed to be made elsewhere. The class-bp-blogs-blog.php uses the wb.public value in six different places. I’m not sure that I needed to modify all six, but it did solve the problem of the navigation bar total display.

    Question 2: Is there any danger of messing something else up by changing all six, should I be more selective.

    Question 3: I have been trying to confine my modifications to a child theme and this involves a hack of buddypress plugin files and the changes will need to be made with each BP update. Is there any “child themable” way to deal with this?

    Cheers,

    t

    March 23, 2017 at 2:22 pm #6299
    Ray
    Keymaster

    1. Not sure, but if you are not going to be using any other WordPress privacy plugins that is using the wp_blogs 'public' column, then you should be safe.

    2. If you are modifying the class-bp-blogs-blog.php file directly, then yes you could run into trouble later.

    3. Look into using wp-content/plugins/bp-custom.php instead of your theme’s functions.php file:
    https://codex.buddypress.org/themes/bp-custom-php/

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX Classic Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 287
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register