The settings for the plugin do not transfer forward to new blogs that are created.
And in any plugin that has particular settings on an options page, they never will transfer to new blogs, unless you actually hardcode those values in the plugin itself.
unless you actually hardcode those values in the plugin itself.
I tried that but it didn’t work. Another post had suggested that it was necessary to add a set of defaults to the plugin that matched the values needed to connect to the external database, so I added the values, but they don’t show up when a new blog is created.
I solved my problem by adding the default values I needed to schema.php and activated the plugin site wide. Now when a new blog gets created the appropriate values get added to the options table for that blog.
May I ask how you added the default values? In a function or simply declare the value of variable? I am new to wpmu and wanted to get the external db working before we push it out..
Thanks in advance!
I should have tried it out before asking.
Simply add the values in the populate_options() function, and it will do the trick.
it should look like this:
'ext_db_type' => 'MySQL',
Thanks for pointing out the schema.php again!
And remember to not overwrite schema.php in an upgrade! 🙂
Here’s an example of what to add, just put this in the populate_options() function.
//ex_db_auth defaults
'ext_db_type'=>'MySQL',
'ext_db_mdb2_path'=>'',
'ext_host'=>'localhost',
'ext_db_port'=>'',
'ext_db'=>'drupal6',
'ext_db_user'=>'dbuser',
'ext_db_pw'=>'dbpassword',
'ext_db_table'=>'users',
'ext_db_namefield'=>'name',
'ext_db_pwfield'=>'pass',
'ext_db_first_name'=>'',
'ext_db_last_name'=>'',
'ext_db_user_url'=>'',
'ext_db_user_email'=>'mail',
'ext_db_description'=>'',
'ext_db_aim'=>'',
'ext_db_yim'=>'',
'ext_db_jabber'=>'',
'ext_db_enc'=>'MD5',
'ext_db_error_msg'=>'Please login using your Drupal website username and password.',
'ext_db_other_enc'=>'$password2 = $password;',
'ext_db_role_bool'=>'',
'ext_db_role'=>'',
'ext_db_role_value'=>'',
The result is that every blog created gets these defaults with the ext_db_auth plugin.