The MU forums have moved to WordPress.org

adapting the plugin output cache plugin to use with the plugin commander (5 posts)

  1. Ovidiu
    Member
    Posted 14 years ago #

    talking about this plugin: http://rmarsh.com/plugins/poc-cache/

    as I am using several widgets/plugins from that site, I'd like to make this cache plugi navailable and automatically activated for all blogs, but if I activae it for alle blogs using the plugin commander, it only generates wp_1_poc_cache table, only for blog #1

    I don't know if this is a plugin commander or plugin output cache issue, any hints?

    here is a little excerpt from the plugins code:

    define('POC_CACHE', true);
    $poc_table = $wpdb->prefix.'poc_cache';

  2. RobMarsh
    Member
    Posted 14 years ago #

    I'm the plugin author and I would be happy to do what I can to make the plugin work with WPMU but right now I know nothing at all about how WPMU differs from WP.

  3. andrea_r
    Moderator
    Posted 14 years ago #

    One big difference is that blog tables are wp_*_table name. I listed the table structure here if that helps:
    http://wpmututorials.com/basics/database-structure/

  4. Ovidiu
    Member
    Posted 14 years ago #

    the ideal implementation would be to have it auto-activated, no control panel displayed for the users, except for the siteadmin - and the cache properly separated for each blog :-)
    *nice wishlist* :-) I'll have a look at the plugin myself, and Rob if we can answer soem mroe questions for you please feel free to ask, we'll try and assist you.

  5. lunabyte
    Member
    Posted 14 years ago #

    In MU:

    In terms of creating a table correctly, and/or setting it up to be used as wpdb->table_name:

    $wpdb->prefix
    This is the prefix for individual blog tables.

    If you need a "global" table:
    $wpdb->base_prefix

    Again, this is only relevant when creating tables, or incorporating them into the wpdb object. For example:

    $wpdb->my_blog_table = $wpdb->prefix . 'my_blog_table';
    $wpdb->my_global_table = $wpdb->base_prefix . 'my_global_table';

    Now those tables for the plugin can be called as:
    $wpdb->my_blog_table or $wpdb->my_global_table

    There are plenty of other differences, and don't forget to ensure all queries are optimized, and to only load code when and if it is necessary.

About this Topic