function cw_config_get_category($category)
{
    global $tables, $current_language;
    $options = cw_query("\n        SELECT c.*, IFNULL(lng.value, c.comment) AS title\n        FROM {$tables['config_categories']} AS cc, {$tables['config']} AS c\n        LEFT JOIN {$tables['languages']} AS lng ON lng.code = '{$current_language}' AND lng.name = CONCAT('opt_', c.name)\n        WHERE c.config_category_id = cc.config_category_id AND cc.category = '{$category}'\n        ORDER BY orderby\n    ");
    return cw_config_process_options($options);
}
function cw_md_get_config_values($domain_id)
{
    global $tables, $current_language;
    $options = cw_query("select c.*, dc.value as domain_value, IFNULL(lng.value, c.comment) as title from {$tables['domains_config']} as dc, {$tables['config']} as c left join {$tables['languages']} as lng on lng.code = '{$current_language}' and lng.name = CONCAT('opt_', c.name) where c.name=dc.name and c.config_category_id=dc.config_category_id and dc.domain_id='{$domain_id}' order by c.orderby");
    return cw_config_process_options($options);
}