The MU forums have moved to WordPress.org

plugin needs site-wide table (wp-cimy-data not wp-1-cimy-data) (6 posts)

  1. mrjcleaver
    Member
    Posted 15 years ago #

    The SQL calls for a plugin are being changed for make them blog-specific. While this is normally ok, for plugins that deal with user registration information this data needs to be shared across the whole site.

    I note some code in wp-db.php line 169 and repeated at 227
    also there is a hash being built in wp-settings.php 118 onwards.

    I've looked for documentation, searched to no avail and tried hacking wp-db.php and setting lines before the call to require_once ( ABSPATH . 'wpmu-settings.php' );

    $wpdb->cimy_data = $wpdb->prefix . 'cimy_data';
    $wpdb->cimy_fields = $wpdb->prefix . 'cimy_fields';

    Nothing works.

    What's the right way to do this?

    I didn't find instructions in the code explaining anything.

  2. mrjcleaver
    Member
    Posted 15 years ago #

    Turns out that I should not use the $wpdb->prefix. I should hard code it to 'wp_'

    No point me writing it the wiki. The powers that be don't want it.

  3. dbasulto
    Member
    Posted 15 years ago #

    how did you get this plugin working?

  4. mrjcleaver
    Member
    Posted 15 years ago #

  5. dbasulto
    Member
    Posted 15 years ago #

    thanks, added some info on the wiki.

    how did you implement this on signup? it appears on User Profile, but it'd be nice to prompt users for this info when registering.

  6. mrjcleaver
    Member
    Posted 15 years ago #

    You are welcome. Thanks for your addition.

    I've not made it take effect during sign up. Instead, I am in the process of only allowing them to sign up for a user name.

    When they log in WP is clever enough to take them to the profile page. The extra fields are shown there, continuing the workflow.

    On the dashboard page wp-admin/index.php I am adding something that detects whether they have a blog and offers to apply for one. I haven't finished that yet and would be grateful if you can share an approach (esp if written as a plugin).

    Also, any one happen to know which call is best for testing whether the user has a blog? I'm using get_active_blog_for_user($current_user->ID) but for users without a blog that often returns the top level blog rather than be empty.

    Regards, M.

About this Topic

  • Started 15 years ago by mrjcleaver
  • Latest reply from mrjcleaver