• Resolved kcuming

    (@kcuming)


    We are running a multisite installation with Buddypress. Each separate site has individual badges which the teachers can award but there are some badges it makes sense to award on a network basis. The majority of these badges will be admin awarded. Awarding the local badges is not a problem. We simply navigate to the user profile and award from there. The problem is the network wide badges. If the local site admin is given permission to award badges on the Buddypress (network wide) site they will be able to award badges for students registered on other local sites? Any ideas how to resolve this?

    Related: will achievements earned on other site in a multisite network be displayable on the Buddypress profile – achievements?

    Hope this makes some sense. Love the plugin. Cheers

    https://wordpress.org/plugins/badgeos/

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

    (@tw2113)

    The BenchPresser

    Good day kcuming.

    I can see a 2-part situation here.

    The first part is awarding badges that are meant to be network wide. Achievements, at their core, are a custom post type that users technically create posts in. We shaped the post editor for these to save details for the achievement types, and register post types out of them. A custom post type used to create custom post types.

    The problem with this is that the post types are, by nature, site-specific, since each site gets their own wp_posts/wp_postmeta tables. I can’t think of any way offhand to craft the plugin(s) to award these network wide.

    On the other part, we do have it possible to display achievements from different sites in one central location. We do some looping and switch_to_blog() use to gather up all of the data necessary from each subsite, and compile an accurate list of achievements from all the sites.

    In short, awarding network achievements is a difficulty, showing achievements from all sites in the network is already covered.

    Thread Starter kcuming

    (@kcuming)

    Thanks Michael

    Is it possible to set permissions for who awards different types of badges when one sets the types up. For example I might want the cook badge to be awarded by users with the Chef permissions only. This would help get around my problem.

    If it cant be done how easy would it be for a developer to code a solution. I envisage a simple extra field when one creates the achievement type.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I imagine it can be done, but we don’t have much, if anything at all, set up for setting granular permissions per achievement type. So that’s going to be a developer task there.

    Thread Starter kcuming

    (@kcuming)

    Cheers Kevin

    Hi Michael (and Kevin)
    I have a follow up question to the multisite issue. I simply want to have the same badges, quests, steps etc. on one of my sites that I have on my original site.

    I’m using Content Copier plugin to try and copy things over but I’m not exactly sure if it is giving me the correct results. What is the best way for copying the same BadgeOS info to another site?? (not necessary to award badges on a network wide basis)

    Thank you!
    Matt

    Just more specific info:

    1. When I copy over certain achievements as custom posts they do not show up in the BadgeOS menu on the new site.

    2. When I access a badge via the short code it is unable to be found as the url has been updated with the new site info.

    Hope that helps to explain more clearly

    Thank you!
    matt

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    1. Are you getting the post meta as well?

    2. Are you flushing the permalinks at all for each site that you’re copying them over to?

    Hi Michael-
    I’m not exactly sure how to flush permalinks so I guess I’m not doing that. (Can you say how that can be done?)

    Also, I’m not sure how to tell if I’m getting the post meta.

    I’ve managed to copy over everything to a template site. However the steps for each Badge were not copied so I had to re-establish them manually.

    The main problem I’m having is this: New sites are being created from this template site and everything is copied over fine except that the steps are not being listed with each badge. Should this be working?

    Thank you for your help!

    Matt

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Visiting the permalinks page will trigger a flush. If you’re copying over everything that you need before permalinks are even set up and saved, then something else is going on that I’m not sure of at the moment.

    Now that you mention the steps part, I believe I know what you’re missing. To accurately copy over everything related to badgeos achievements, you’re going to want the following tables:

    wp_posts
    wp_postmeta
    wp_p2p
    wp_p2pmeta

    You’ll also want to look at the following option from your wp_options table:

    badgeos_settings

    the p2p tables are used to connect post types, which we definitely use with regards to step relationships, which is probably the missing piece for you.

    Thanks for this Michael.
    Can you recommend a preferred method of exporting/importing so that all of the pertinent files are copied?

    Thank you!
    Matt

    I’ve tried copying those specific tables in phpMyAdmin from the original site over to the new site and the same results: the steps are not copied.

    Is there a better way?

    UPDATE:

    Via phpMyAdmin I have successfully copied over all of the correct tables and I have a duplicate site (Site B) that contains all of the correct steps associated with each badge.

    Now my issue is this: When my students create their own sites on my network I’m using this new Site B as the template. I’m using the WPMU plug in Blog Templates. All BadgesOS info is copied correctly accept again for the steps.

    Any thoughts about how to make this work?

    Thank you so much!
    Matt

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not sure what’s going on with that. It’s technically outside the scope of what the plugin suite does, but we can still offer the best advice we can.

    A quick process I tested, and succeeded with, on localhost is this.

    Create a network that has 2 sites in it. Main site and sub-site.

    In the main site, create an achievement and assign two different steps to it.

    Open SequelPro for my sql management and export the p2p tables and post tables to an sql file.

    Opened the sql file in sublime text to change the table names to the appropriate subsite and save.

    Go back to SequelPro and import the newly saved sql file so that it imports into the correct tables.

    Switch to the sub-site and check on the badge, finding the steps in tact as well.

    It’s definitely a process that would benefit from automation, but it is one that worked for my simple case. Not sure if you’re doing other steps or missed any that I mentioned, regarding the actual database content.

    Thanks for this Michael. You can marked this resolved. I was able to copy everything over ok just using phpMyAdmin. I then had to work with the Blog Template plugin developer to copy over all of the correct tables when a new site was created.
    Everything is working now!

    Thank you for your help!

    Matt

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Glad I could help where I helped Matt.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Permissions and multisite’ is closed to new replies.