diff -urp /root/mysite/plugins/types/aggregator.inc types/aggregator.inc
--- /root/mysite/plugins/types/aggregator.inc	2007-08-19 20:02:57.000000000 +0000
+++ types/aggregator.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: aggregator.inc,v 1.14 2007/08/19 20:02:57 agentken Exp $
+// $Id: aggregator.inc,v 1.13 2007/06/02 15:42:12 agentken Exp $
 
 /**
  * @file
@@ -25,8 +25,11 @@ function mysite_type_aggregator($get_opt
       'form' => FALSE,
       'label' => t('Add Web Headlines'),
       'help' => t('Some web feeds are combined into categories. You can add an entire category of feeds to your personal page.'),
-      'search' => TRUE
+      'search' => TRUE,
+      'link_target' => '_blank'
     );
+    $basic_settings = variable_get('mysite_basic_aggregator_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_aggregator_options();
     }
@@ -83,7 +86,7 @@ function mysite_type_aggregator_title($t
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find aggregator title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -105,11 +108,12 @@ function mysite_type_aggregator_data($ty
     $result = db_query_range($sql, $feed->cid, 0, variable_get('mysite_elements', 5));
     $items = array();
     $i = 0;
+    $type = mysite_type_aggregator(FALSE);
     while ($obj = db_fetch_object($result)) {
       $sql = "SELECT fid, title AS feedtitle FROM {aggregator_feed} WHERE fid = %d";
       $source = db_fetch_object(db_query($sql, $obj->fid));
       $items[$i]['type'] = 'aggregator';
-      $items[$i]['link'] = l($obj->title, $obj->link);
+      $items[$i]['link'] = l($obj->title, $obj->link, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($obj->title);
       $items[$i]['date'] = $obj->timestamp;
       $items[$i]['uid'] = NULL;
@@ -126,7 +130,7 @@ function mysite_type_aggregator_data($ty
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find aggregator data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
diff -urp /root/mysite/plugins/types/blog.inc types/blog.inc
--- /root/mysite/plugins/types/blog.inc	2007-08-26 19:38:51.000000000 +0000
+++ types/blog.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: blog.inc,v 1.20 2007/08/26 19:38:51 agentken Exp $
+// $Id: blog.inc,v 1.17 2007/08/08 00:16:08 agentken Exp $
 
 /**
  * @file
@@ -27,6 +27,8 @@ function mysite_type_blog($get_options =
       'help' => t('You can choose blog postings by specific users. Type a user name in the search box, or choose from the list of active bloggers.'),
       'search' => TRUE
     );
+    $basic_settings = variable_get('mysite_basic_blog_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_blog_options();
     }
@@ -82,10 +84,7 @@ function mysite_type_blog_options() {
  * Implements mysite_type_hook_title(). 
  */
 function mysite_type_blog_title($type_id = NULL, $title = NULL) {
-  if (is_numeric($type_id)) { // user id 0 is allowed
-    if ($type_id == 0) {
-      $title = variable_get('anonymous', 'anonymous user');
-    }
+  if (!empty($type_id)) {
     if (is_null($title)) {
       $blog = user_load(array('uid' => $type_id));
       $title = $blog->name;
@@ -95,7 +94,7 @@ function mysite_type_blog_title($type_id
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find blog title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -114,10 +113,11 @@ function mysite_type_blog_data($type_id 
       );
     $items = array();
     $i = 0;
+    $type = mysite_type_blog(FALSE);
     while ($nid = db_fetch_object($result)) {
       $node = node_load($nid->nid);
       $items[$i]['type'] = $node->type;
-      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid);
+      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($node->title);
       $items[$i]['subtitle'] = NULL; 
       $items[$i]['date'] = $node->changed;
@@ -130,7 +130,7 @@ function mysite_type_blog_data($type_id 
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find blog data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
@@ -209,7 +209,7 @@ function mysite_type_blog_search_form($u
 function mysite_type_blog_search_form_submit($form_id, $form_values) {
   // we use LIKE here in case JavaScript autocomplete support doesn't work.
   // or in case the user doesn't autocomplete the form
-  $result = db_query(db_rewrite_sql("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND n.type = 'blog' AND LOWER(u.name) LIKE LOWER('%s%%')"), $form_values['blog_title']);
+  $result = db_query("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND n.type = 'blog' AND u.name LIKE LOWER('%s%%')", $form_values['blog_title']);
   $count = 0;
   while ($blog = db_fetch_object($result)) {
     $data[$count]['uid'] = $form_values['uid'];
@@ -219,6 +219,7 @@ function mysite_type_blog_search_form_su
     $data[$count]['description'] = t('The blog posts of @user', array('@user' => $blog->name));
     $count++;
   }
+  // pass the $data to the universal handler
   mysite_search_handler($data, 'blog');
   return;
 }
@@ -230,7 +231,7 @@ function mysite_type_blog_search_form_su
  */
 function mysite_type_blog_autocomplete($string) {
   $matches = array();
-  $result = db_query_range(db_rewrite_sql("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND n.type = 'blog' AND LOWER(u.name) LIKE LOWER('%s%%')"), $string, 0, 10);
+  $result = db_query_range("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND n.type = 'blog' AND u.name LIKE LOWER('%s%%')", $string, 0, 10);
   while ($blog = db_fetch_object($result)) {
     $matches[$blog->name] = check_plain($blog->name);
   }
diff -urp /root/mysite/plugins/types/book.inc types/book.inc
--- /root/mysite/plugins/types/book.inc	2007-08-19 20:02:57.000000000 +0000
+++ types/book.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: book.inc,v 1.16 2007/08/19 20:02:57 agentken Exp $
+// $Id: book.inc,v 1.15 2007/08/08 00:16:08 agentken Exp $
 
 /**
  * @file
@@ -27,6 +27,8 @@ function mysite_type_book($get_options =
       'help' => t('You can track new pages for individual books. Type a book name in the search box, or choose from the list provided.'),
       'search' => TRUE
     );
+    $basic_settings = variable_get('mysite_basic_book_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_book_options();
     }
@@ -86,10 +88,11 @@ function mysite_type_book_data($type_id 
       );
     $items = array();
     $i = 0;
+    $type = mysite_type_book(FALSE);
     while ($nid = db_fetch_object($result)) {
       $node = node_load($nid->nid);
       $items[$i]['type'] = $node->type;
-      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid);
+      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($node->title);
       $items[$i]['subtitle'] = NULL; 
       $items[$i]['date'] = $node->changed;
@@ -102,7 +105,7 @@ function mysite_type_book_data($type_id 
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find book data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
@@ -120,7 +123,7 @@ function mysite_type_book_title($type_id
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find book title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
diff -urp /root/mysite/plugins/types/comment.inc types/comment.inc
--- /root/mysite/plugins/types/comment.inc	2007-08-23 00:39:06.000000000 +0000
+++ types/comment.inc	2007-08-23 13:38:48.000000000 +0000
@@ -20,13 +20,15 @@ function mysite_type_comment($get_option
       'include' => 'comment',
       'prefix' => t('Comments on'),
       'suffix' => t(''),
-      'category' => t('Content'),
-      'weight' => 1,
+      'category' => t('Comment'),
+      'weight' => 0,
       'form' => FALSE,
       'label' => t('Add Post Comments'),
       'help' => t('You can choose comments attached to specific posts. Search the list of active posts or browse from the list below.'),
       'search' => TRUE
     );
+    $basic_settings = variable_get('mysite_basic_comment_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_comment_options();
     }
@@ -58,7 +60,7 @@ function mysite_type_comment_active($typ
 function mysite_type_comment_options() {
   $options = array();
   // we are dealing with nodes, so node_access requires db_rewrite_sql here.  See http://drupal.org/node/135378.
-  $sql = db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.status = 1 ORDER BY n.title");
+  $sql = db_rewrite_sql("SELECT nid, title FROM {node} WHERE status = 1 ORDER BY title");
   $result = db_query($sql);
   $nodes = array();
   while ($item = db_fetch_object($result)) {
@@ -88,9 +90,10 @@ function mysite_type_comment_data($type_
       );
     $items = array();
     $i = 0;
+    $type = mysite_type_comment(FALSE);
     while ($comment= db_fetch_object($result)) {
       $items[$i]['type'] = 'comment';
-      $items[$i]['link'] = l($comment->subject, 'node/'. $comment->nid, array(), NULL, "comment-$comment->cid");
+      $items[$i]['link'] = l($comment->subject, 'node/'. $comment->nid, array('target' => $type['link_target']), NULL, "comment-$comment->cid");
       $items[$i]['title'] = check_plain($comment->title);
       $items[$i]['subtitle'] = NULL; 
       $items[$i]['date'] = $comment->timestamp;
@@ -108,7 +111,7 @@ function mysite_type_comment_data($type_
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find comment data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
@@ -126,7 +129,7 @@ function mysite_type_comment_title($type
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find comment title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -135,11 +138,11 @@ function mysite_type_comment_title($type
  */
 function mysite_type_comment_block_node($nid, $type) {
   // are comments enabled for this node?
-  $comment = db_result(db_query("SELECT n.comment FROM {node} n WHERE n.nid = %d", $nid));
+  $comment = db_result(db_query("SELECT comment FROM {node} WHERE nid = %d", $nid));
   if ($comment > 0) {
     global $user;
     if (user_access('access comments')) {
-      $result = db_query(db_rewrite_sql('SELECT n.nid, n.title FROM {node} n WHERE n.nid = %d'), $nid);
+      $result = db_query(db_rewrite_sql('SELECT nid, title FROM {node} WHERE nid = %d'), $nid);
       $node = db_fetch_object($result);
     }
     $data = array();
@@ -192,7 +195,7 @@ function mysite_type_comment_search_form
 function mysite_type_comment_search_form_submit($form_id, $form_values) {
   // we use LIKE here in case JavaScript autocomplete support doesn't work.
   // or in case the user doesn't autocomplete the form
-  $sql = db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE LOWER(n.title) LIKE LOWER('%s%%') AND n.status = 1");
+  $sql = db_rewrite_sql("SELECT nid, title FROM {node} WHERE LOWER(title) LIKE LOWER('%s%%') AND status = 1");
   $result = db_query($sql, $form_values['comment_title']);
   $count = 0;
   while ($node = db_fetch_object($result)) {
@@ -215,7 +218,7 @@ function mysite_type_comment_search_form
  */
 function mysite_type_comment_autocomplete($string) {
   $matches = array();
-  $sql = db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE LOWER(n.title) LIKE LOWER('%s%%') AND n.status = 1");
+  $sql = db_rewrite_sql("SELECT nid, title FROM {node} WHERE LOWER(title) LIKE LOWER('%s%%') AND status = 1");
   $result = db_query_range($sql, $string, 0, 10);
   while ($node = db_fetch_object($result)) {
     $matches[$node->title] = check_plain($node->title);
diff -urp /root/mysite/plugins/types/droplet.inc types/droplet.inc
--- /root/mysite/plugins/types/droplet.inc	2007-09-01 21:18:33.000000000 +0000
+++ types/droplet.inc	2007-09-10 09:43:16.000000000 +0000
@@ -26,8 +26,10 @@ function mysite_type_droplet($get_option
     'help' => t('Droplets are helpful tools that you can add to your personal page.  Search by name or select from the list provided.'),
     'search' => TRUE,
   );
+  $basic_settings = variable_get('mysite_basic_droplet_settings', array());
+  $type = array_merge($type, $basic_settings);  
   if ($get_options) {
-    $type['options'] = mysite_type_droplet_options();
+  	$type['options'] = mysite_type_droplet_options();
   }
   return $type;
 }
diff -urp /root/mysite/plugins/types/feed.inc types/feed.inc
--- /root/mysite/plugins/types/feed.inc	2007-08-19 20:02:57.000000000 +0000
+++ types/feed.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: feed.inc,v 1.20 2007/08/19 20:02:57 agentken Exp $
+// $Id: feed.inc,v 1.19 2007/08/08 00:16:08 agentken Exp $
 
 /**
  * These files are included as needed to reduce overhead.
@@ -25,8 +25,11 @@ function mysite_type_feed($get_options =
       'form' => TRUE,
       'label' => t('Add Web Feed'),
       'help' => t('Web feeds from other sites can be added to your personal page. Use the search box, or select from the list provided.'),
-      'search' => TRUE
+      'search' => TRUE,
+      'link_target' => '_blank'
     );
+    $basic_settings = variable_get('mysite_basic_feed_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_feed_options();
     }
@@ -130,7 +133,7 @@ function mysite_type_feed_title($type_id
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find feed title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -160,9 +163,10 @@ function mysite_type_feed_data($type_id 
     $result = db_query_range($sql, $feed->fid, 0, variable_get('mysite_elements', 5));
     $items = array();
     $i = 0;
+    $type = mysite_type_feed(FALSE);
     while ($obj = db_fetch_object($result)) {
       $items[$i]['type'] = 'feed';
-      $items[$i]['link'] = l($obj->title, $obj->link);
+      $items[$i]['link'] = l($obj->title, $obj->link, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($obj->title);
       $items[$i]['subtitle'] = NULL; 
       $items[$i]['date'] = $obj->timestamp;
@@ -180,7 +184,7 @@ function mysite_type_feed_data($type_id 
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find feed data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 
 }
diff -urp /root/mysite/plugins/types/forum.inc types/forum.inc
--- /root/mysite/plugins/types/forum.inc	2007-08-19 20:02:57.000000000 +0000
+++ types/forum.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: forum.inc,v 1.14 2007/08/19 20:02:57 agentken Exp $
+// $Id: forum.inc,v 1.13 2007/08/08 00:16:08 agentken Exp $
 
 /**
  * Implements mysite_type_hook().
@@ -22,7 +22,8 @@ function mysite_type_forum($get_options 
       'help' => t('You can track posts within a forum. Type a keyword to search for matching forum topics, or select from the list provided.'),
       'search' => TRUE
     );
-    if ($get_options) {
+    $basic_settings = variable_get('mysite_basic_forum_settings', array());
+    $type = array_merge($type, $basic_settings);    if ($get_options) {
       $type['options'] = mysite_type_forum_options();
     }
    return $type;
@@ -93,7 +94,7 @@ function mysite_type_forum_title($type_i
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find forum title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -118,11 +119,12 @@ function mysite_type_forum_data($type_id
       );
     $items = array();
     $i = 0;
+    $type = mysite_type_forum(FALSE);
     while ($nid = db_fetch_object($result)) {
       $node = node_load($nid->nid);
       $term = taxonomy_get_term($nid->tid);
       $items[$i]['type'] = $node->type;
-      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid);
+      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($node->title);
       if (count($term_list) > 1) {
         $items[$i]['subtitle'] = l(mysite_type_forum_title($term->tid, $term->name), 'forum/'. $term->tid);
@@ -137,7 +139,7 @@ function mysite_type_forum_data($type_id
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find forum data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
diff -urp /root/mysite/plugins/types/node.inc types/node.inc
--- /root/mysite/plugins/types/node.inc	2007-08-19 20:02:57.000000000 +0000
+++ types/node.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: node.inc,v 1.9 2007/08/19 20:02:57 agentken Exp $
+// $Id: node.inc,v 1.8 2007/08/08 00:16:08 agentken Exp $
 
 /**
  * Implements mysite_type_hook().
@@ -11,17 +11,19 @@ function mysite_type_node($get_options =
   if (module_exists('node')) {
     $type = array(
       'name' => t('Posts'),
-      'description' => t('<b>Post Types</b>: Content posts of a specific type.'),
+      'description' => t('<b>Posts</b>: Content posts of a specific type.'),
       'include' => 'node',
       'prefix' => t(''),
       'suffix' => t('posts'),
       'category' => t('Content'),
       'weight' => 0,
       'form' => FALSE,
-      'label' => t('Add Posts by Type'),
+      'label' => t('Add Posts'),
       'help' => t('You can add recent posts by type to your personal page. Choose from the list of available content types.'),
       'search' => FALSE
     );
+    $basic_settings = variable_get('mysite_basic_node_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_node_options();
     }
@@ -49,6 +51,14 @@ function mysite_type_node_active($type) 
     $message = l(t('No users have permission to access site content'), 'admin/user/access');
     $br = '<br />';
   }
+  // there must be at least one allowed type
+  $allowed = variable_get('mysite_node_settings', array());
+  // if this variable is saved as blank, then a 0 => 1 value is present
+  unset($allowed[0]);
+  if (empty($allowed)) {
+    $value = FALSE;
+    $message = $br . l(t('At least one content type must be configured for MySite.'), 'admin/settings/mysite/type/node');
+  }
   return array($type => $value, 'message' => $message);
 }
 
@@ -58,16 +68,11 @@ function mysite_type_node_active($type) 
 function mysite_type_node_options() {
   $options = array();
   // we have to get the allowed options and compare them to the stored options
-  $default = variable_get('mysite_node_settings', array(1));
+  $default = variable_get('mysite_node_settings', array());
   // if this variable is saved as blank, then a 0 => 1 value is present
-  if ($default[0] == 1) {
-    $content = node_get_types('names');
-    $content = array_flip($content);
-  }
-  else {
-    $content = array_flip($default);
-    unset($content[0]);
-  }
+  unset($default[0]);
+  $content = array_flip($default);
+  unset($content[0]);
   $types = mysite_get_custom('node', NULL, TRUE);
   if (!empty($content) && !empty($types)) {
     foreach ($types as $type) {
@@ -96,7 +101,7 @@ function mysite_type_node_title($type_id
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find node title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -115,10 +120,11 @@ function mysite_type_node_data($type_id 
       );
     $items = array();
     $i = 0;
+    $type = mysite_type_node(FALSE);
     while ($nid = db_fetch_object($result)) {
       $node = node_load($nid->nid);
       $items[$i]['type'] = $node->type;
-      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid);
+      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($node->title);
       $items[$i]['subtitle'] = NULL; 
       $items[$i]['date'] = $node->changed;
@@ -131,7 +137,7 @@ function mysite_type_node_data($type_id 
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find node data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
@@ -143,8 +149,8 @@ function mysite_type_node_data($type_id 
  */
 function mysite_type_node_block_node($nid, $type) {
   global $user;
-  $types = variable_get('mysite_node_settings', array(1));
-  if ($types[0] == 1 || in_array($type, $types)) {
+  $types = variable_get('mysite_node_settings', array());
+  if (in_array($type, $types)) {
     $info = mysite_get_myid('node', $type);
     if (!empty($info)) {
       $data = array();
@@ -214,31 +220,11 @@ function mysite_type_node_settings_form(
   $form['mysite_node_settings'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Allowed content types'),
-    '#prefix' => t('<h3>Content types</h3><p>Enabling the options below will allow users to add recent posts of a specific content type to their MySite page.</p><p><em>If no options are selected, then all node types will be available.</em></p>'),
+    '#prefix' => t('<h3>Content types</h3><p>Enabling the options below will allow users to add recent posts of a specific content type to their MySite page.</p>'),
     '#default_value' => $default,
     '#options' => $options,
     '#required' => FALSE,
     '#description' => t('Select the content types that users may select for their MySite page.')
   ); 
   return system_settings_form($form);     
-}
-
-/**
- * Helper function for constructing proper IN clause for node types.
- *
- * @return
- * NULL or a formatted ('one', 'two', 'three') string
- * @ingroup plugins
- */
-function mysite_type_node_in() {
-  // we have to get the allowed options and compare them to the stored options
-  $default = variable_get('mysite_node_settings', array(1));
-  // if all are selected, then array(0 => 1), so skip this routine
-  if ($default[0] == 1) {
-    return NULL;
-  }
-  // if this variable is saved as blank, then a 0 => 1 value is present
-  $content = array_flip($default);
-  unset($content[0]);  
-  return "('". implode("','", $content) ."')";
 }
\ No newline at end of file
diff -urp /root/mysite/plugins/types/popular.inc types/popular.inc
--- /root/mysite/plugins/types/popular.inc	2007-06-30 21:32:09.000000000 +0000
+++ types/popular.inc	2007-08-23 13:38:48.000000000 +0000
@@ -22,6 +22,8 @@ function mysite_type_popular($get_option
     'help' => t('Browse the list of the 100 most popular items on personal user pages.'),
     'search' => FALSE
   );
+  $basic_settings = variable_get('mysite_basic_popular_settings', array());
+  $type = array_merge($type, $basic_settings);
   if ($get_options) {
     $type['options'] = mysite_type_popular_options();
   }
Only in /root/mysite/plugins/types/: post.inc
diff -urp /root/mysite/plugins/types/profile.inc types/profile.inc
--- /root/mysite/plugins/types/profile.inc	2007-08-19 20:02:57.000000000 +0000
+++ types/profile.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: profile.inc,v 1.11 2007/08/19 20:02:57 agentken Exp $
+// $Id: profile.inc,v 1.10 2007/07/29 16:13:26 agentken Exp $
 
 /**
  * These files are included as needed to reduce overhead.
@@ -29,6 +29,8 @@ function mysite_type_profile($get_option
     'help' => t('You may add your profile to your personal page.'),
     'search' => FALSE
   );
+  $basic_settings = variable_get('mysite_basic_profile_settings', array());
+  $type = array_merge($type, $basic_settings);
   if ($get_options) {
     $type['options'] = mysite_type_profile_options();
   }
@@ -99,7 +101,7 @@ function mysite_type_profile_title($type
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find profile title.'), 'error');
+  drupal_set_message(t('Could not find title.'. $type_id), 'error');
   return;
 }
 
@@ -129,8 +131,9 @@ function mysite_type_profile_data($type_
     );
   $items = array();
   $i = 0;
+  $type = mysite_type_profile(FALSE);
   $items[$i]['type'] = 'profile';
-  $items[$i]['link'] = l($profile->name, 'user/'. $profile->uid);
+  $items[$i]['link'] = l($profile->name, 'user/'. $profile->uid, array('target' => $type['link_target']));
   $items[$i]['title'] = mysite_type_profile_title($profile->uid, $profile->name);
   $items[$i]['subtitle'] = NULL;
   $items[$i]['date'] = NULL;
@@ -141,6 +144,7 @@ function mysite_type_profile_data($type_
   $items[$i]['nid'] = NULL;
   $data['items'] = $items;
   return $data;
+
 }
 
 /**
diff -urp /root/mysite/plugins/types/README.txt types/README.txt
--- /root/mysite/plugins/types/README.txt	2007-08-19 20:02:57.000000000 +0000
+++ types/README.txt	2007-08-23 13:38:48.000000000 +0000
@@ -1,4 +1,4 @@
-// $Id: README.txt,v 1.4 2007/08/19 20:02:57 agentken Exp $
+// $Id: README.txt,v 1.3 2007/08/07 01:04:34 agentken Exp $
 
 /**
  * @file
@@ -10,7 +10,7 @@ MySite Types
 Type plugins are used by the MySite module to generate the content available to be
 added to a user's personal page.
 
-MySite ships with 15 Type files:
+MySite ships with 14 Type files:
 
  -- aggregator.inc
  -- blog.inc
@@ -21,7 +21,6 @@ MySite ships with 15 Type files:
  -- forum.inc
  -- node.inc
  -- path.inc
- -- post.inc
  -- popular.inc
  -- profile.inc
  -- term.inc
Only in types/: .svn
diff -urp /root/mysite/plugins/types/term.inc types/term.inc
--- /root/mysite/plugins/types/term.inc	2007-08-23 00:39:06.000000000 +0000
+++ types/term.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: term.inc,v 1.20 2007/08/23 00:39:06 agentken Exp $
+// $Id: term.inc,v 1.18 2007/07/22 22:59:36 agentken Exp $
 
 /**
  * Implements mysite_type_hook().
@@ -22,6 +22,8 @@ function mysite_type_term($get_options =
       'help' => t('You can track content by category. Type a keyword in the search box to find the matching category, or choose from the list provided.'),
       'search' => TRUE
     );
+    $basic_settings = variable_get('mysite_basic_term_settings', array());
+    $type = array_merge($type, $basic_settings);
     if ($get_options) {
       $type['options'] = mysite_type_term_options();
     }
@@ -43,6 +45,12 @@ function mysite_type_term_active($type) 
     $message = l(t('There are no categories defined for the site.'), 'admin/content/taxonomy');
     $br = '<br />';
   }
+  // if categories have not been configured, all values in the array are '0' 
+  $allowed = variable_get('mysite_term_vocabularies', array());
+  if (array_sum($allowed) == 0) {
+    $value = FALSE;
+    $message .= $br . l(t('The MySite Category options must be configured.'), 'admin/settings/mysite/type/term');
+  }
   return array($type => $value, 'message' => $message);
 }
 
@@ -51,16 +59,7 @@ function mysite_type_term_active($type) 
  */
 function mysite_type_term_options() {
   $options = array();
-  $default = variable_get('mysite_term_vocabularies', array(1));
-  if ($default[0] == 1) {
-    $temp = taxonomy_get_vocabularies();
-    foreach ($temp as $vocab) {
-      $vocabularies[] = $vocab->vid;
-    }
-  }
-  else {
-    $vocabularies = $default;
-  }
+  $vocabularies = variable_get('mysite_term_vocabularies', array());
   if (is_array($vocabularies) && !empty($vocabularies)) {
     foreach ($vocabularies as $vid) {
       if ($vid > 0) {
@@ -98,7 +97,7 @@ function mysite_type_term_title($type_id
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find term title'), 'error');
+  drupal_set_message(t('Could not find title'), 'error');
   return;
 }
 
@@ -118,12 +117,13 @@ function mysite_type_term_data($type_id 
 
     $items = array();
     $i = 0;
+    $type = mysite_type_term(FALSE);
     // we can't use node_view() here, because aggregator doesn't use nodes
     // and we need the same data structure for all content
     while ($nid = db_fetch_object($result)) {
       $node = node_load($nid->nid);
       $items[$i]['type'] = $node->type;
-      $items[$i]['link'] = l($node->title, 'node/'. $node->nid);
+      $items[$i]['link'] = l($node->title, 'node/'. $node->nid, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($node->title);
       $items[$i]['subtitle'] = NULL;    
       $items[$i]['date'] = $node->changed;
@@ -136,7 +136,7 @@ function mysite_type_term_data($type_id 
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find term data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
@@ -145,23 +145,15 @@ function mysite_type_term_data($type_id 
  */
 function mysite_type_term_block($arg, $op = 'view') {
   global $user;
-  // filter against the settings
-  $default = variable_get('mysite_term_vocabularies', array(1));
-  $allow = FALSE;
-  if ($default[0] == 1) {
-    $allow = TRUE;
-  }
   if (user_access('access content') &&  $arg[0] == 'taxonomy' && $arg[1] == 'term' && is_numeric($arg[2])) {
     $term = taxonomy_get_term($arg[2]);
-    if ($allow || in_array($term->vid, $default)) {
-      $data = array();
-      $data['uid'] = $user->uid;
-      $data['type'] = 'term';
-      $data['type_id'] = $term->tid;
-      $data['title'] = mysite_type_term_title($term->tid, $term->name);
-      $content = mysite_block_handler($data);
-      return $content;
-    }
+    $data = array();
+    $data['uid'] = $user->uid;
+    $data['type'] = 'term';
+    $data['type_id'] = $term->tid;
+    $data['title'] = mysite_type_term_title($term->tid, $term->name);
+    $content = mysite_block_handler($data);
+    return $content;
   }
 }
 
@@ -207,10 +199,7 @@ function mysite_type_term_search_form_su
   $in = _mysite_type_term_in();
   // we use LIKE here in case JavaScript autocomplete support doesn't work.
   // or in case the user doesn't autocomplete the form
-  $sql = db_rewrite_sql("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%s%%')", 't', 'tid');
-  if (!empty($in)) {
-    $sql = db_rewrite_sql("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%s%%') AND t.vid IN ($in)", 't', 'tid');
-  }  
+  $sql = db_rewrite_sql("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE t.name LIKE LOWER('%s%%') AND t.vid IN ($in)", 't', 'tid');
   $result = db_query($sql, strtolower($form_values['term_title']));
   $count = 0;
   while ($term = db_fetch_object($result)) {
@@ -235,10 +224,7 @@ function mysite_type_term_autocomplete($
   $matches = array();
   // exclude vocabularies not allowed by the site settings
   $in = _mysite_type_term_in();
-  $sql = db_rewrite_sql("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%s%%')", 't', 'tid');
-  if (!empty($in)) {
-    $sql = db_rewrite_sql("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%s%%') AND t.vid IN ($in)", 't', 'tid');
-  }  
+  $sql = db_rewrite_sql("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE t.name LIKE LOWER('%s%%') AND t.vid IN ($in)", 't', 'tid');
   $result = db_query_range($sql, $string, 0, 10);
   while ($term = db_fetch_object($result)) {
     $matches[$term->name] = check_plain($term->name);
@@ -252,16 +238,13 @@ function mysite_type_term_autocomplete($
  * Creates an IN() SQL statement based on allowed vocabularies.
  *
  * @return
- * NULL or An IN() modifier for SQL.
+ * An IN() modifier for SQL.
  *
  * @ingroup includes
  */
 function _mysite_type_term_in() {
   $in = NULL;
-  $vocabularies = variable_get('mysite_term_vocabularies', array(1));
-  if ($vocabularies[0] == 1) {
-    return NULL;
-  }
+  $vocabularies = variable_get('mysite_term_vocabularies', array());
   if (is_array($vocabularies) && !empty($vocabularies)) {
     foreach ($vocabularies as $vid) {
       if ($vid > 0) {
@@ -297,6 +280,9 @@ function mysite_type_term_clear($type) {
 function mysite_type_term_settings() {
   mysite_check_settings('term');
   $vocabularies = taxonomy_get_vocabularies();
+  // eliminate forums from the generic term view
+  $forum = variable_get('forum_nav_vocabulary', 0);
+  unset($vocabularies[$forum]);
   if (is_array($vocabularies) && !empty($vocabularies)) {
     return drupal_get_form('mysite_type_term_settings_form', $vocabularies);
   }
@@ -317,7 +303,6 @@ function mysite_type_term_settings_form(
   $default = variable_get('mysite_term_vocabularies', array());
   unset ($default[0]);
   $form['mysite_term']['mysite_term_vocabularies'] = array(
-      '#prefix' => t('<p>Select the vocabularies to display to MySite users.</p><p><em>If no options are selected, then all vocabularies will be made available.</em></p>'),
       '#type' => 'checkboxes', 
       '#title' => t('Allowed Vocabularies'), 
       '#default_value' => $default,
diff -urp /root/mysite/plugins/types/user.inc types/user.inc
--- /root/mysite/plugins/types/user.inc	2007-08-23 00:39:06.000000000 +0000
+++ types/user.inc	2007-08-23 13:38:48.000000000 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: user.inc,v 1.11 2007/08/23 00:39:06 agentken Exp $
+// $Id: user.inc,v 1.9 2007/08/08 00:16:08 agentken Exp $
 
 /**
  * Implements mysite_type_hook().
@@ -15,12 +15,14 @@ function mysite_type_user($get_options =
     'prefix' => t(''),
     'suffix' => t('posts'),
     'category' => t('Content'),     
-    'weight' => 2,
+    'weight' => 0,
     'form' => FALSE,
     'label' => t('Add User Posts'),
     'help' => t('You can choose to track postings by specific users. Type a user name in the search box, or choose from the list of active contributors.'),
     'search' => TRUE
   );
+  $basic_settings = variable_get('mysite_basic_user_settings', array());
+  $type = array_merge($type, $basic_settings);
   if ($get_options) {
     $type['options'] = mysite_type_user_options();
   }
@@ -95,7 +97,7 @@ function mysite_type_user_title($type_id
     $title = trim(rtrim($title));
     return $title;
   }
-  drupal_set_message(t('Could not find user title.'), 'error');
+  drupal_set_message(t('Could not find title.'. $type_id), 'error');
   return;
 }
 
@@ -114,10 +116,11 @@ function mysite_type_user_data($type_id 
       );
     $items = array();
     $i = 0;
+    $type = mysite_type_user(FALSE);
     while ($nid = db_fetch_object($result)) {
       $node = node_load($nid->nid);
       $items[$i]['type'] = $node->type;
-      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid);
+      $items[$i]['link'] = l($node->title, 'node/'. $nid->nid, array('target' => $type['link_target']));
       $items[$i]['title'] = check_plain($node->title);
       $items[$i]['subtitle'] = node_get_types('name', $node->type); 
       $items[$i]['date'] = $node->changed;
@@ -130,7 +133,7 @@ function mysite_type_user_data($type_id 
     $data['items'] = $items;
     return $data;
   }
-  drupal_set_message(t('Could not find user data'), 'error');
+  drupal_set_message(t('Could not find data'), 'error');
   return;
 }
 
@@ -216,7 +219,7 @@ function mysite_type_user_search_form($u
 function mysite_type_user_search_form_submit($form_id, $form_values) {
   // we use LIKE here in case JavaScript autocomplete support doesn't work.
   // or in case the user doesn't autocomplete the form
-  $result = db_query("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND LOWER(u.name) LIKE LOWER('%s%%')", $form_values['user_title']);
+  $result = db_query("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND u.name LIKE LOWER('%s%%')", $form_values['user_title']);
   // filter the list of allowed users by role
   $users = mysite_type_user_allowed($result);
   $count = 0;
@@ -242,7 +245,7 @@ function mysite_type_user_search_form_su
  */
 function mysite_type_user_autocomplete($string) {
   $matches = array();
-  $result = db_query_range("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND LOWER(u.name) LIKE LOWER('%s%%')", $string, 0, 10);
+  $result = db_query_range("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.status = 1 AND u.name LIKE LOWER('%s%%')", $string, 0, 10);
   // filter the list of allowed users by role -- this may cause no returns
   $users = mysite_type_user_allowed($result);
   if (!empty($users)) {
