function _update_178_url_formats in Drupal 4
Same name and namespace in other branches
- 5 modules/system/system.install \_update_178_url_formats()
2 calls to _update_178_url_formats()
- system_update_178 in database/
updates.inc - Update base paths for relative URLs in node and comment content.
- system_update_179 in database/
updates.inc - Update base paths for relative URLs in custom blocks, profiles and various variables.
File
- database/
updates.inc, line 1759
Code
function _update_178_url_formats() {
$formats = array();
// Any format with the HTML filter in it
$result = db_query("SELECT format FROM {filters} WHERE module = 'filter' AND delta = 0");
while ($format = db_fetch_object($result)) {
$formats[$format->format] = true;
}
// Any format with only the linebreak filter in it
$result = db_query("SELECT format FROM {filters} WHERE module = 'filter' AND delta = 2");
while ($format = db_fetch_object($result)) {
if (db_result(db_query('SELECT COUNT(*) FROM {filters} WHERE format = %d', $format->format)) == 1) {
$formats[$format->format] = true;
}
}
// Any format with 'HTML' in its name
$result = db_query("SELECT format FROM {filter_formats} WHERE name LIKE '%HTML%'");
while ($format = db_fetch_object($result)) {
$formats[$format->format] = true;
}
return $formats;
}