• Thank you for a great plugin!

    I’ve 8 sites on the same server, CF7 is installed on each site.

    I need that form data from all sites end up on a single database db wp_CF7DBPlugin_SUBMITS, Is this possible?

    which parts of the plugin that I need to change?

    Thanks

    Damiano

Viewing 2 replies - 1 through 2 (of 2 total)
  • This can be achieved without too much effort *if* all the sites are using the same database connection. In this configuration, each WP site has a different prefix for its table names. The ‘wp_’ prefix is the default and you could configure the next site to use ‘wp1_’, ‘wp_2’, etc. That way each WP install has its own independent set of tables in their own virtual namespace despite them being in the same database instance/login.

    The plugin simply uses whatever prefix is defined in the config (which is why the table name starts with ‘wp_’). My intention is to follow this namespace practice. Also, the plugin does not do anything specific to get a DB connection. It just uses the $wpdb object provided by WP. So it has no knowledge of what DB it is connecting to. If you wanted to send the results to different DB than the DB of the WP where the plugin is running, you would have to replace all global $wpdb; with code that specifically connect to your desired DB.

    But in the case of the first scenario, you could hack the plugin to use one specific table name, and install that version on all of your sites thereby causing them to all see the same table name. To do that, you would look for all the $tableName = $this->prefixTableName('SUBMITS'); lines of code and replace with $tableName = 'name_you_want_to_use'. If this case actually applies to you, I could quickly inject a configuration parameter to override the param name and put that version out for you to use so you don’t have to hack it.

    Thread Starter sdamy

    (@sdamy)

    Unfortunately, my scenario is this:

    http://Www.domain1.com, http://www.domain2.com, http://www.domain3.comhttp://www.domain8.com
    – All domains are installed on the same server, each domain has a different mysql db
    – Each domain therefore has a different wp-config.php.

    I think one solution might be:
    – Modify the plugin so that it has a connection to the db connection other than the standard wordpress (global $ wpdb).
    – You could then set all plugins on a single DB.

    There are commands to set the global $ wpdb to external standard configuration of wordpress (example)?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Contact Form 7 to Database Extension] one db many sites’ is closed to new replies.