function content_profile_install in Content Profile 6
Implementation of hook_install().
File
- ./
content_profile.install, line 21 - Content profile installation file.
Code
function content_profile_install() {
// Set the module weight to -1, so content_profile_user() gets called before
// node_user(), so that one can't set a node's uid to 0 on user deletion
// before the profile nodes are deleted.
db_query("UPDATE {system} SET weight = -1 WHERE name = 'content_profile'");
content_profile_import();
//create a profile type, if it doesn't exist yet
if (!node_get_types('type', 'profile')) {
$info = array(
'type' => 'profile',
'name' => t('Profile'),
'module' => 'node',
'description' => t('A user profile built as content.'),
'locked' => FALSE,
'custom' => TRUE,
);
$info = _node_type_set_defaults($info);
node_type_save((object) $info);
}
}