Support » Plugin: CubePoints » [Plugin: CubePoints] Multisite

  • How can you use cubepoints with a multisite? I just tested it on one of our sites and it appears that by activating it at the network provides each site to set up their own cubepoints. Our multisite provides individuals with personal blogs; they are all subscribers to main site and editors of their own sites. We want a network wide points program where our members can write their own posts and comment on other posts throughout the network for points. Is this achievable with cubepoints?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Good question, I’m hoping to find a answer on this to… I’m using multisite subdomain setup voor a 1500+ blogs setup and would love to enable cubepoints on it.

    I am using version 3.1 of Cubepoints. By investigating the code and the database I can see there is only one wp_cp database. It is true, the options are different for each site but it seems that the points system is unique, meaning that if one user earns point into a site, he will have the points into any site.

    Of course, this leaves a way for cheating, some site owners could trick the system to make points to use elswhere.

    A simple solution I think of is to hardcode the points options by editing the code, then to make configuration and managememnt panels read-only.

    Cubepoints will be unique for each site in multisite installation. If a user earn 120 points then its applicable only for

    If you want network wide points, then my suggestion will be use main site to store points instead of using individual sites database.

    So for short, I did this:
    in cp_admin_manage.php I changed the code like this:

    function cp_admin_manage() {
      global $blog_id; //add this line here


    <form method="post" name="cp_manage_form_<?php echo $result->ID; ?>" id="cp_manage_form_<?php echo $result->ID; ?>">
      <input type="hidden" name="cp_manage_form_id" value="<?php echo $result->ID; ?>" />
      <?php if (is_multisite() && $blog_id > 1) echo " disabled='disabled'"; ?>
      type="text" name="cp_manage_form_points" value="<?php echo cp_getPoints($result->ID); ?>" />
      <?php if (is_multisite() && $blog_id > 1) echo " disabled='disabled'"; ?>
      type="submit" value="<?php _e('Update', 'cp'); ?>" />
      <img src="<?php echo WP_PLUGIN_URL.'/'.str_replace(basename(__FILE__),"",plugin_basename(__FILE__)). 'assets/load.gif'; ?>" style="display: none;" />

    Did it work?

    And in cp_admin_config.php I did similar changes:

    if (get_option('cp_mypoints')) {
      $cp_mypoints_checked = " checked='checked'";
    } else {
      $cp_mypoints_checked = "";
    global $blog_id; //add this line here


    [Code moderated as per the Forum Rules. Please use the pastebin]


    Is it working?

    Actually if I give points to users the points are updated to all sites. This behavior is by default.

    Now I changed my hack above and I did this instead: with a clean Cubepoints plugin installation, I added this code to my theme’s functions.php:

    I am still testing to see if a site administrator that is not superadmin can see the Cubepoints menu in dashboard

    I still can see the menus as local admin only. Will find better code to remove the menus.

    Well, my solution now is this one:

    Use this code in functions.php from theme’s folder in order to copy all the options to all existing blogs (such as the changes can be made in any site dashboard by super-admins)

    Then use this plugin to control who has access to the Cubepoints menu. In fact the Required capability should be set to manage_network for the top menu and all submenus alike, only in that case the Cubepoint menu will dissapear.

    As a note, the logs submenu can be let alone, so site admins can see them with no harm.

    Thanks, good to know. I didnțt got so far yet…

    Code is messy in this page.
    It took half an hour to format the code.

    You can find the pastebin version here.




    Please note:

    I’m not sure what this line is (cp_hooks.php)
    echo __(‘Post on’, ‘cp’) . ‘ “guid.’”>’ . $post->post_title . ‘“‘;

    So my cp_hooks.php contains different code for the above line i mentioned.

    Hope it will help someone.

    One more thing.

    I activated “My points” module. Cubepoints -> My points I see errors in permalinks. (subdomain multisite installation).

    Also i see duplicate logs in the same page. Can someone fix it?

    Exactly what i was looking for!!!
    Thanks Yani for actual edit and Viruthagiri!!!
    I’m also wondering how to add group id and store forum id, comment id as meta (if thats possible i dont know) or just store group id in which the forum, topic or reply is created!!!
    I just need this so i can filter group based top users!!! I know this is not for Cubepoints bp but just wondering if i can get some help!!!
    Thanks in advance!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: CubePoints] Multisite’ is closed to new replies.