get_results("SELECT * FROM $wpdb->terms ORDER BY name");
if ($categories) {
foreach ($categories as $category) {
if ($category->category_parent == $parent) {
$category->name = wp_specialchars($category->name);
$pad = str_repeat('— ', $level);
if ( current_user_can('manage_categories') ) {
$catvis = $wpdb->get_results("SELECT * FROM $cat_visibility WHERE cat_ID=$category->term_id LIMIT 1");
$catvis = $catvis[0];
if ($catvis->front == 1 || $catvis == 0) $catvis_front = "checked"; else $catvis_front = "";
if ($catvis->list == 1 || $catvis == 0) $catvis_list = "checked"; else $catvis_list = "";
if ($catvis->search == 1 || $catvis == 0) $catvis_search = "checked"; else $catvis_search = "";
if ($catvis->feed == 1 || $catvis == 0) $catvis_feed = "checked"; else $catvis_feed = "";
if ($catvis->archives == 1 || $catvis == 0) $catvis_archives = "checked"; else $catvis_archives = "";
$catvis_user_level = ($catvis->cv_user_level) ? $catvis->cv_user_level : 0;
$edit = "