diff -Naur wordpress-2.1.3/wp-admin/admin-db.php wordpress-2.1.3-p-cat_scope/wp-admin/admin-db.php
--- wordpress-2.1.3/wp-admin/admin-db.php	2007-03-23 03:18:00.000000000 +0000
+++ wordpress-2.1.3-p-cat_scope/wp-admin/admin-db.php	2007-05-03 14:30:36.000000000 +0100
@@ -111,6 +111,11 @@
 	if ( empty($category_parent) || !get_category( $category_parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $category_parent) ) )
 		$category_parent = 0;
 
+	if ( isset($cat_scope) ) // *** Patch Category Scope ***
+		$cat_scope = (int) $cat_scope;
+	else
+		$cat_scope = 0; // *** Patch End ***
+
 	if ( isset($posts_private) )
 		$posts_private = (int) $posts_private;
 	else
@@ -121,12 +126,12 @@
 	else
 		$links_private = 0;
 
-	if (!$update) {
-		$wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private')");
+	if (!$update) { // *** Patch Category Scope ***
+		$wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private, cat_scope) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private', '$cat_scope')");
 		$cat_ID = (int) $wpdb->insert_id;
 	} else {
-		$wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent', links_private = '$links_private', posts_private = '$posts_private' WHERE cat_ID = '$cat_ID'");
-	}
+		$wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent', links_private = '$links_private', posts_private = '$posts_private', cat_scope = '$cat_scope' WHERE cat_ID = '$cat_ID'");
+	} // *** Patch End ***
 
 	if ( $category_nicename == '' ) {
 		$category_nicename = sanitize_title($cat_name, $cat_ID );
diff -Naur wordpress-2.1.3/wp-admin/admin-functions.php wordpress-2.1.3-p-cat_scope/wp-admin/admin-functions.php
--- wordpress-2.1.3/wp-admin/admin-functions.php	2007-03-28 00:46:21.000000000 +0100
+++ wordpress-2.1.3-p-cat_scope/wp-admin/admin-functions.php	2007-05-03 14:55:04.000000000 +0100
@@ -634,8 +634,10 @@
 }
 
 function return_categories_list( $parent = 0 ) {
-	global $wpdb;
-	return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( link_count = 0 OR category_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY category_count DESC" );
+	global $wpdb; 
+	// *** Patch Category Scope ***
+	return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND (cat_scope = 0 OR cat_scope = 1) ORDER BY category_count DESC" );
+	// *** Patch End ***
 }
 
 function sort_cats( $cat1, $cat2 ) {
@@ -709,7 +711,9 @@
 
 function return_link_categories_list( $parent = 0 ) {
 	global $wpdb;
-	return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( category_count = 0  OR link_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY link_count DESC" );
+	// *** Patch Category Scope ***
+	return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND (cat_scope = 0 OR cat_scope = 2) ORDER BY link_count DESC" );
+	// *** Patch End
 }
 
 function get_nested_link_categories( $default = 0, $parent = 0 ) {
diff -Naur wordpress-2.1.3/wp-admin/edit-category-form.php wordpress-2.1.3-p-cat_scope/wp-admin/edit-category-form.php
--- wordpress-2.1.3/wp-admin/edit-category-form.php	2006-12-21 10:10:04.000000000 +0000
+++ wordpress-2.1.3-p-cat_scope/wp-admin/edit-category-form.php	2007-05-03 13:35:55.000000000 +0100
@@ -33,6 +33,14 @@
 			<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->category_nicename); ?>" size="40" /></td>
 		</tr>
 		<tr>
+			<th scope="row" valign="top"><label for="cat_scope"><?php _e('Category scope:') ?></label></th>
+			<td>
+				<label for="cat_scope-0"><input id="cat_scope-0" name="cat_scope" type="radio" value="0" <?php checked($category->cat_scope, '0'); ?> /> <?php _e('Both') ?></label>
+				<label for="cat_scope-1"><input id="cat_scope-1" name="cat_scope" type="radio" value="1" <?php checked($category->cat_scope, '1'); ?> /> <?php _e('Post') ?></label>
+				<label for="cat_scope-2"><input id="cat_scope-2" name="cat_scope" type="radio" value="2" <?php checked($category->cat_scope, '2'); ?> /> <?php _e('Link') ?></label>
+		    </td>
+		</tr>
+		<tr>
 			<th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th>
 			<td>        
 	  			<?php wp_dropdown_categories('hide_empty=0&name=category_parent&selected=' . $category->category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
