<?php
// Добавляем поля "Страница по умолчанию" для пользователя и для группы пользователей
run_query("ALTER TABLE  " . $config['table_prefix'] . "users ADD  default_page VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER  window_scroll");
run_query("ALTER TABLE  " . $config['table_prefix'] . "groups ADD  default_page VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");

$sqlQuery = "SELECT id,editable_fields FROM " . $config['table_prefix'] . "groups";
$result = run_query($sqlQuery);
while ($group = sql_fetch_assoc($result)) {
    if (!strpos($group['editable_fields'], '-default_page')) {
        run_query("UPDATE  " . $config['table_prefix'] . "groups SET  editable_fields =  '-default_page" . $group['editable_fields'] . "' WHERE  id =" . $group['id']);
    }
}
?>