<?php
// Изменение быстрого поиска в календаре
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "calendar_events LIKE 'fast_search'");
if (sql_fetch_assoc($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "calendar_events CHANGE fast_search fast_search TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL -- change field type");
}
$result = run_query("SELECT id, fast_search FROM " . $config['table_prefix'] . "calendar_events");
while ($row = sql_fetch_assoc($result)) {
    if ($row['fast_search']) {
        $value = serialize(array($row['fast_search']));
    } else {
        $value = "";
    }
    run_query("UPDATE " . $config['table_prefix'] . "calendar_events SET fast_search='" . form_sql($value) . "' WHERE id=" . intval($row['id']));
}
?>