function hosting_platform_update_6004 in Hosting 7.4
Same name and namespace in other branches
- 6.2 platform/hosting_platform.install \hosting_platform_update_6004()
- 7.3 platform/hosting_platform.install \hosting_platform_update_6004()
File
- platform/
hosting_platform.install, line 170 - Define database schema and update functions for the Platforms module.
Code
function hosting_platform_update_6004() {
if (!variable_get('hosting_platform_update_6004_run', false)) {
$result = db_query("SELECT n.nid, n.title FROM {node} n LEFT JOIN {hosting_platform} p ON p.nid=n.nid WHERE p.status <> -2 AND n.type='platform'");
while ($object = db_fetch_object($result)) {
$records[$object->nid] = 'platform_' . preg_replace("/[!\\W]/", "", $object->title);
}
foreach ($records as $nid => $name) {
hosting_context_register($nid, $name);
}
variable_set('hosting_platform_update_6004_run', true);
}
}