diff --git a/README b/README
index f829a4e..eac336e 100644
--- a/README
+++ b/README
@@ -18,11 +18,11 @@ Usage:
 
    * Clone an og view such as og_members or og_members_block, and add in the member title field.  Or create your own 'member list' view.
       * You will need to add in >>OG TITLES<< relationship or the cloned view will not work. This is a non-trivial issue with Og's og_uid views data.
-			* For each og_titles field, filter, or sort that you use, confirm that you do not use the relationship.
-			* For each og_uid field, filter, or sort that you use, confirm that you >>DO<< use the relationship.
+      * For each og_titles field, filter, or sort that you use, confirm that you do not use the relationship.
+      * For each og_uid field, filter, or sort that you use, confirm that you >>DO<< use the relationship.
    * Group managers can manage member titles by going to og/users/%/titles where % is the group node id.
    * Users with permissions can access their title at og/manage/%/title
-	    * Og Titles provides a view called 'og_my_titles' to replace Og's 'og_my' view. Please disable the latter.
+      * Og Titles provides a view called 'og_my_titles' to replace Og's 'og_my' view. Please disable the latter.
    * Group managers can add/modify/delete titles from a list per group at node/%/titles
    * Site administrators can configure og titles behavior by going to admin/og/og_titles
 
diff --git a/includes/views_handler_field_og_title.inc b/includes/views_handler_field_og_title.inc
index aec3601..006e417 100644
--- a/includes/views_handler_field_og_title.inc
+++ b/includes/views_handler_field_og_title.inc
@@ -1,8 +1,11 @@
 <?php
-class views_handler_field_og_title extends views_handler_field
-{
-  function options_form(&$form, &$form_state)
-  {
+//$Id$
+
+/**
+ * @class
+ */
+class views_handler_field_og_title extends views_handler_field {
+  function options_form(&$form, &$form_state) {
       parent::options_form($form, $form_state);
       $form['og_titles_manage_link'] = array(
          '#type' => 'radios',
@@ -13,8 +16,7 @@ class views_handler_field_og_title extends views_handler_field
       );
   }
 
-  function render($values)
-  {
+  function render($values) {
     global $user;
 
     //FIXME: will $values->users_uid break? It seems to be handling gracefully so far..
diff --git a/og_titles.info b/og_titles.info
diff --git a/og_titles.install b/og_titles.install
index 2ec48ce..a166afc 100644
--- a/og_titles.install
+++ b/og_titles.install
@@ -1,125 +1,118 @@
 <?php
 
- /**
-  * hook_install implementation
-  */
- function og_titles_install()
- {
-	 drupal_install_schema('og_titles');
-	 drupal_set_message('Installed og_titles and og_uid_tables into the database');
- } // function og_titles_install
-
-
- /**
-  * hook_uninstall implementation
-  */
- function og_titles_uninstall()
- {
-	 drupal_uninstall_schema('og_titles');
- } // function og_titles_uninstall
-
-
- /**
-  * hook_schema implementation -- we are just adding a simple table that adheres to the og_ table namespace
-  */
- function og_titles_schema()
- {
-	 $schema['og_uid_titles'] = array(
-	 	'description' => t('This is the og_uid_titles table for the og_titles module.'),
-	 	'fields' => array(
-			'nid' => array( 'type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Node id reference') ),
-			'uid' => array( 'type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('User id reference') ),
-			'title' => array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, 'description' => t('Arbitrary custom title or rank.') ),
-			'weight' => array( 'type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('the weight copied over from og_titles'), 'default' => '0'),
-		),
-		'primary key' => array('nid','uid')
-	 );
-
-	 $schema['og_titles'] = array(
-	 	'description' => t('This is the og_titles table, stores info. of each available title for each group'),
-		'fields' => array(
-			'nid' => array( 'type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Group node id reference') ),
-			'tlid' => array( 'type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('The unique identifier for a particular title in a particular group.') ),
-			'title' => array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, 'description' => t('Arbitrary custom title or rank.') ),
-			'weight' => array( 'type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('Weight of the title'), 'default' => '0'),
-		),
-		'primary key' => array('nid','tlid'),
-	 );
-
-	 return $schema;
- } // function og_titles_schema
-
-
- /** 
-  * hook_update_N implementaiton
-  */
- function og_titles_update_6001()
- {
-	$ret = array();
-	$ogt = array(
-	 	'description' => t('This is the og_titles table, stores info. of each available title for each group'),
-		'fields' => array(
-			nid => array( 'type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Group node id reference') ),
-			tlid => array( 'type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('The unique identifier for a particular title in a particular group.') ),
-			title => array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, 'description' => t('Arbitrary custom title or rank.') )
-		),
-		'primary key' => array('nid','tlid'),
-	 );
-
-	db_create_table($ret,'og_titles',$ogt);
-
-	return $ret;
- } // function og_titles_update_6001
+/**
+ * hook_install implementation
+ */
+function og_titles_install() {
+  drupal_install_schema('og_titles');
+  drupal_set_message('Installed og_titles and og_uid_tables into the database');
+} // function og_titles_install
+
+
+/**
+ * hook_uninstall implementation
+ */
+function og_titles_uninstall() {
+  drupal_uninstall_schema('og_titles');
+} // function og_titles_uninstall
+
+
+/**
+ * hook_schema implementation -- we are just adding a simple table that adheres to the og_ table namespace
+ */
+function og_titles_schema() {
+  $schema['og_uid_titles'] = array(
+    'description' => t('This is the og_uid_titles table for the og_titles module.'),
+    'fields' => array(
+      'nid' => array( 'type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Node id reference') ),
+      'uid' => array( 'type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('User id reference') ),
+      'title' => array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, 'description' => t('Arbitrary custom title or rank.') ),
+      'weight' => array( 'type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('the weight copied over from og_titles'), 'default' => '0'),
+    ),
+    'primary key' => array('nid','uid')
+  );
+
+  $schema['og_titles'] = array(
+    'description' => t('This is the og_titles table, stores info. of each available title for each group'),
+    'fields' => array(
+      'nid' => array( 'type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Group node id reference') ),
+      'tlid' => array( 'type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('The unique identifier for a particular title in a particular group.') ),
+      'title' => array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, 'description' => t('Arbitrary custom title or rank.') ),
+      'weight' => array( 'type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('Weight of the title'), 'default' => '0'),
+    ),
+    'primary key' => array('nid','tlid'),
+  );
+
+  return $schema;
+} // function og_titles_schema
+
+
+/** 
+ * hook_update_N implementaiton
+ */
+function og_titles_update_6001() {
+  ret = array();
+  $ogt = array(
+    'description' => t('This is the og_titles table, stores info. of each available title for each group'),
+    'fields' => array(
+      'nid' => array( 'type' => 'int', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('Group node id reference') ),
+     'tlid' => array( 'type' => 'serial', 'size' => 'normal', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('The unique identifier for a particular title in a particular group.') ),
+     'title' => array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, 'description' => t('Arbitrary custom title or rank.') )
+     ),
+     'primary key' => array('nid','tlid'),
+  );
+
+  db_create_table($ret,'og_titles',$ogt);
+
+  return $ret;
+} // function og_titles_update_6001
 
  
- function og_titles_update_6002()
- {
-	 $ret = array();
+function og_titles_update_6002() {
+  $ret = array();
 
-	 db_add_field($ret,'og_titles','weight', array('type' => 'int', 'size' => 'normal', 'not null' => TRUE));
+  db_add_field($ret,'og_titles','weight', array('type' => 'int', 'size' => 'normal', 'not null' => TRUE));
 
-	 return $ret;
- } // function og_titles_update_6002
+  return $ret;
+} // function og_titles_update_6002
  
- function og_titles_update_6003()
- {
-	 $ret = array();
+function og_titles_update_6003() {
+  $ret = array();
 
-	 db_add_field($ret,'og_uid_titles','weight', array('type' => 'int', 'size' => 'normal' , 'not null' => TRUE));
+  db_add_field($ret,'og_uid_titles','weight', array('type' => 'int', 'size' => 'normal' , 'not null' => TRUE));
 
-	 return $ret;
- } // function og_titles_update_6003
+  return $ret;
+} // function og_titles_update_6003
 
- function og_titles_update_6004()
- {
- 	 $ret = array();
+function og_titles_update_6004() {
+  $ret = array();
 
-	 db_change_field($ret, 'og_titles', 'weight', 'weight', array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('Weight of the title'), 'default' => '0'));
-	 db_change_field($ret, 'og_uid_titles', 'weight', 'weight', array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('the weight copied over from og_titles'), 'default' => '0'));
+  db_change_field($ret, 'og_titles', 'weight', 'weight', array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('Weight of the title'), 'default' => '0'));
+  db_change_field($ret, 'og_uid_titles', 'weight', 'weight', array('type' => 'int', 'size' => 'normal', 'not null' => TRUE, 'description' => t('the weight copied over from og_titles'), 'default' => '0'));
 
-	 return $ret;
- }
+  return $ret;
+}
 
- function og_titles_update_6005()
- {
-     $ret = array();
+function og_titles_update_6005() {
+  $ret = array();
 
-     menu_rebuild();
-     drupal_set_message("Menu system rebuilt.");
+  menu_rebuild();
+  drupal_set_message("Menu system rebuilt.");
 
-     return $ret;
- }
+  return $ret;
+}
 
- function og_titles_update_6006()
- {
-     $ret = array();
+function og_titles_update_6006() {
+  $ret = array();
 
-     $option = variable_get('og_titles_selection', 0);
+  $option = variable_get('og_titles_selection', 0);
 
-     if ($option == 0)
-       variable_set('og_titles_selection', 'og_titles_text_input');
-     else
-       variable_set('og_titles_selection', 'og_titles_select_input');
+  if ($option == 0) {
+    variable_set('og_titles_selection', 'og_titles_text_input');
+  }
+  else {
+    variable_set('og_titles_selection', 'og_titles_select_input');
+  }
 
-     return $ret;
- }
+  return $ret;
+}
diff --git a/og_titles.module b/og_titles.module
index 702e083..887a278 100644
--- a/og_titles.module
+++ b/og_titles.module
@@ -1,778 +1,721 @@
 <?php
 
- /**
-  * @File
-  * 	Organic Groups Titles
-  * add arbitrary custom titles to organic group members
-  *
-  * Matthew Radcliffe <mradcliffe@kosada.com>
-  */
-
- /**
-  * hook_help implementation
-  * @param $path
-  * @param $arg
-  */
- function og_titles_help($path,$arg)
- {
-	 switch($path)
-	 {
-		 case 'admin/help#og_titles':
-		 	return '<p>'.t('Extends Organic Groups allowing you to add arbitrary tiles or ranks per user in a group.');
-	 }
- } // function og_titles_help
-
- 
- /**
-  * hook_views_api implementation
-  */
- function og_titles_views_api()
- {
-	 return array('api' => 2, 'path' => drupal_get_path('module','og_titles'));
- } // function og_titles_views_api
-
-
- /** 
-  * hook_perm implementation
-  * @return array of permissions
-  */
- function og_titles_perm()
- {
-	 return array('manage own og title');
- } // function og_titles_perm
-
-
- /**
-  * hook_theme implementation
-  * @eturn array of theme hooks
-  */
- function og_titles_theme()
- {
-	 return array(
-	 	'og_titles_group_settings' => array(
-			'arguments' => array( 'form' => NULL )
-		)
-	 );
- } // function og_titles_theme
-
-
- /**
-  * hook_menu implementation
-  */
- function og_titles_menu()
- {
-	$items['og/users/%node/titles'] = array(
-		'title' => 'Member Titles',
-		'description' => 'Manage custom member titles',
-		'page callback' => 'drupal_get_form',
-		'page arguments' => array('og_titles_view_titles',2),
-		'access callback' => 'og_titles_is_group_admin',
-		'access arguments' => array(2),
-		'type' => MENU_LOCAL_TASK,
-		'weight' => 5,
-	);
-	$items['admin/og/og_titles'] = array(
-		'title' => 'Organic groups titles configuration',
-		'description' => 'Select options for OG Titles',
-		'page callback' => 'drupal_get_form',
-		'page arguments' => array('og_titles_admin_settings'),
-		'access callback' => 'user_access',
-		'access arguments' => array('administer site configuration'),
-		'type' => MENU_NORMAL_ITEM,
-	);
-
-	// should i local task it to the group or the og/users/% path?
-	if (variable_get('og_titles_selection','og_titles_text_input') <> 'og_titles_text_input')
-	{
-		$items['node/%node/titles'] = array(
-			'title' => 'Manage titles',
-			'description' => 'Administer titles for this group',
-			'page callback' => 'drupal_get_form',
-			'page arguments' => array('og_titles_group_settings',1),
-			'access callback' => 'og_titles_is_group_admin',
-			'access arguments' => array(1),
-			'type' => MENU_LOCAL_TASK,
-			'weight' => 5,
-		);
-
-		$items['node/%node/titles/edit'] = array(
-			'title' => 'Add title',
-			'description' => 'Add additional title to this group',
-			'page callback' => 'drupal_get_form',
-			'page arguments' => array('og_titles_add_title',1),
-			'access callback' => 'og_titles_is_group_admin',
-			'access arguments' => array(1),
-			'type' => MENU_LOCAL_TASK,
-			'weight' => 0,
-		);
+/**
+ * @File
+ *   Organic Groups Titles
+ * add arbitrary custom titles to organic group members
+ *
+ * Matthew Radcliffe <mradcliffe@kosada.com>
+ */
+
+/**
+ * hook_help implementation
+ * @param $path
+ * @param $arg
+ */
+function og_titles_help($path, $arg) {
+  switch($path) {
+    case 'admin/help#og_titles':
+      return '<p>'.t('Extends Organic Groups allowing you to add arbitrary tiles or ranks per user in a group.');
+  }
+} // function og_titles_help
+
+
+/**
+ * hook_views_api implementation
+ */
+function og_titles_views_api() {
+  return array('api' => 2, 'path' => drupal_get_path('module','og_titles'));
+} // function og_titles_views_api
+
+
+/** 
+ * hook_perm implementation
+ * @return array of permissions
+ */
+function og_titles_perm() {
+  return array('manage own og title');
+} // function og_titles_perm
+
+
+/**
+ * hook_theme implementation
+ * @eturn array of theme hooks
+ */
+function og_titles_theme() {
+  return array(
+    'og_titles_group_settings' => array(
+      'arguments' => array( 'form' => NULL )
+    ),
+  );
+} // function og_titles_theme
+
+
+/**
+ * hook_menu implementation
+ */
+function og_titles_menu() {
+  $items['og/users/%node/titles'] = array(
+    'title' => 'Member Titles',
+    'description' => 'Manage custom member titles',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('og_titles_view_titles',2),
+    'access callback' => 'og_titles_is_group_admin',
+    'access arguments' => array(2),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 5,
+  );
+  $items['admin/og/og_titles'] = array(
+    'title' => 'Organic groups titles configuration',
+    'description' => 'Select options for OG Titles',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('og_titles_admin_settings'),
+    'access callback' => 'user_access',
+    'access arguments' => array('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+
+  // should i local task it to the group or the og/users/% path?
+  if (variable_get('og_titles_selection','og_titles_text_input') <> 'og_titles_text_input') {
+    $items['node/%node/titles'] = array(
+      'title' => 'Manage titles',
+      'description' => 'Administer titles for this group',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('og_titles_group_settings',1),
+      'access callback' => 'og_titles_is_group_admin',
+      'access arguments' => array(1),
+      'type' => MENU_LOCAL_TASK,
+      'weight' => 5,
+    );
+
+    $items['node/%node/titles/edit'] = array(
+      'title' => 'Add title',
+      'description' => 'Add additional title to this group',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('og_titles_add_title',1),
+      'access callback' => 'og_titles_is_group_admin',
+      'access arguments' => array(1),
+      'type' => MENU_LOCAL_TASK,
+      'weight' => 0,
+    );
 
     $items['node/%node/titles/delete/%'] = array(
       'title' => 'Delete',
       'desciption' => 'Delete a title by tlid',
       'page callback' => 'og_titles_delete_title',
-      'page arguments' => array(1,4),
+      'page arguments' => array(1, 4),
       'access callback' => 'og_titles_is_group_admin',
       'access arguments' => array(1),
       'type' => MENU_CALLBACK,
       'weight' => 0,
     );
-	}
-
-	$items['og/manage/%node/title'] = array(
-		'title' => 'My title',
-		'description' => 'Change your title for this group',
-		'page callback' => 'drupal_get_form',
-		'page arguments' => array('og_titles_change_title',2),
-		'access callback' => 'og_titles_manage_own_title',
-		'access arguments' => array(2),
-		'type' => MENU_CALLBACK,
-	);
-
-	return $items;
- } // funtion og_titles_menu
-
- /**
-  * Implementation of hook_nodeapi().
-  */
- function og_titles_nodeapi(&$node, $op, $a3, $a4)
- {
-   if (! og_is_group_type($node->type))
-     return;
-
-   switch($op)
-   {
-     case 'delete':
-       // we need to clean up and remove all titles for this group
-       db_query("DELETE RFOM {og_titles} WHERE nid = %d", $node->nid);
-       break;
-   }
- }
-
- /**
-  * Implementation of hook_og().
-  */
- function og_titles_og($op, $gid, $uid, $args)
- {
-   switch($op)
-   {
-     case 'user delete':
-       // remove title from table when user is removed from group
-       db_query("DELETE FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid);
-       break;
-   }
- }
-
- /**
-  * administration settings form page
-  * @return system_settings_form($form)
-  */
- function og_titles_admin_settings()
- {
-	 menu_rebuild(); // need to do this so that the menu disappears, sucks, but so does drupal
-
-     $options = module_invoke_all('ogt_type');
-
-	 $form['og_titles_selection'] = array(
-	 	'#type' => 'radios',
-	 	'#title' => t('Titles Selection Type'),
-		'#description' => t('Select whether titles are text input or selection-based'),
-		'#options' => $options,
-		'#default_value' => variable_get('og_titles_selection','og_titles_text_input'),
-	 );
-
-	 return system_settings_form($form);
- } // function og_Titles_admin_settings
-
-
- /**
-  * Implementation of hook_ogt_type
-  * 
-  * @return $array
-  */
- function og_titles_ogt_type()
- {
-    $options = array(
-        'og_titles_text_input' => t('Text Input'),
-        'og_titles_select_input' => t('Select Input'),
+  }
+
+  $items['og/manage/%node/title'] = array(
+    'title' => 'My title',
+    'description' => 'Change your title for this group',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('og_titles_change_title',2),
+    'access callback' => 'og_titles_manage_own_title',
+    'access arguments' => array(2),
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+} // funtion og_titles_menu
+
+/**
+ * Implementation of hook_nodeapi().
+ */
+function og_titles_nodeapi(&$node, $op, $a3, $a4) {
+  if (! og_is_group_type($node->type))
+   return;
+
+  switch($op) {
+    case 'delete':
+      // we need to clean up and remove all titles for this group
+      db_query("DELETE RFOM {og_titles} WHERE nid = %d", $node->nid);
+      break;
+  }
+}
+
+/**
+ * Implementation of hook_og().
+ */
+function og_titles_og($op, $gid, $uid, $args) {
+  switch($op) {
+    case 'user delete':
+      // remove title from table when user is removed from group
+      db_query("DELETE FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid);
+      break;
+  }
+}
+
+/**
+ * administration settings form page
+ * @return system_settings_form($form)
+ */
+function og_titles_admin_settings() {
+  menu_rebuild(); // need to do this so that the menu disappears, sucks, but so does drupal
+
+  $options = module_invoke_all('ogt_type');
+
+  $form['og_titles_selection'] = array(
+    '#type' => 'radios',
+    '#title' => t('Titles Selection Type'),
+    '#description' => t('Select whether titles are text input or selection-based'),
+    '#options' => $options,
+    '#default_value' => variable_get('og_titles_selection','og_titles_text_input'),
+  );
+
+  return system_settings_form($form);
+} // function og_Titles_admin_settings
+
+
+/**
+ * Implementation of hook_ogt_type
+ * 
+ * @return $array
+ */
+function og_titles_ogt_type() {
+  $options = array(
+    'og_titles_text_input' => t('Text Input'),
+    'og_titles_select_input' => t('Select Input'),
+  );
+  return $options;
+} // function og_titles_ogt_type
+
+
+/**
+ * og_titles_text_input form
+ * @param &$form
+ * @param &$form_state
+ * @param $gid
+ * @param $uid
+ */
+function og_titles_text_input(&$form, &$form_state, $gid, $uid = NULL) {
+  $form['#type'] = 'textfield';
+  $form['#size'] = 60;
+  $form['#maxlength'] = 64;
+
+  if (isset($uid)) {
+    $res = db_query("SELECT title FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid);
+    $to = db_fetch_object($res);
+  }
+
+  if (isset($form_state['values']['og_title']))
+    $form['#default_value'] = $form_state['values']['og_title'];
+  else
+    $form['#default_value'] = isset($to->title) ? $to->title : '';
+} // function og_titles_text_input
+
+
+/**
+ * og_titles_select_input_save callback
+ * @param $gid
+ * @param $uid
+ * @param $title
+ * @param &$form
+ * @param &$form_state
+ * @return $success
+ */
+function og_titles_text_input_save($gid, $uid, $title, &$form, &$form_state) {
+  $to = db_fetch_object(db_query("SELECT * FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid));
+
+  if (isset($to->title))
+    return db_query("UPDATE {og_uid_titles} SET title = '%s', weight = 0 WHERE nid = %d AND uid = %d", $title, $gid, $uid);
+  else
+    return db_query("INSERT INTO {og_uid_titles} (nid, uid, title, weight) VALUES (%d, %d, '%s', 0)", $gid, $uid, $title);
+
+} // function og_titles_text_input_save
+
+
+/** 
+ * og_titles_select_input form
+ *
+ * @param &$form
+ * @param &$form_state
+ * @param $gid
+ * @param $uid
+ */
+function og_titles_select_input(&$form, &$form_state, $gid, $uid = NULL) {
+  $form['#type'] = 'select';
+  $titles = _og_titles_get_available_titles($gid);
+  $options['none'] = '<'.t('None').'>';
+  foreach($titles as $title)
+    $options[$title->title] = $title->title;
+  $form['#options'] = $options;
+
+  if (isset($uid)) {
+    $res = db_query("SELECT title FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid);
+    $to = db_fetch_object($res);
+  }
+
+  if (isset($form_state['values']['og_title']))
+    $form['#default_value'] = $form_state['values']['og_title'];
+  else
+    $form['#default_value'] = isset($to->title) ? $to->title : '';
+
+} // function og_titles_select_input
+
+
+/**
+ * og_titles_select_input_save callback
+ *
+ * @param $gid
+ * @param $uid
+ * @param $title
+ * @param &$form
+ * @param &$form_state
+ * @return $success
+ */
+function og_titles_select_input_save($gid, $uid, $title, &$form, &$form_state) {
+  $tl = _og_titles_get_title(NULL, $gid, $uid);
+  $to = db_fetch_object(db_query("SELECT * FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid));
+
+  if ($title == 'none')
+    $title = '';
+  if (isset($to->title))
+    return db_query("UPDATE {og_uid_titles} SET title = '%s', weight = %d WHERE nid = %d AND uid = %d", $title, $tl->weight, $gid, $uid);
+  else
+    return db_query("INSERT INTO {og_uid_titles} (nid, uid, title, weight) VALUES (%d, %d, '%s', %d)", $gid, $uid, $title, $tl->weight);
+} // function og_titles_select_input_save
+
+
+/**
+ * manage a group's titles, draggable table form
+ * @param $form_state
+ * @param $node
+ * @return $form
+ */
+function og_titles_group_settings(&$form_state, $node) {
+  if (!isset($node->nid) || !is_numeric($node->nid)) {
+    if (!is_numeric(arg(1))) {
+      drupal_set_message(t('error: gid is not numeric: !node or !arg', array('!node' => $node->nid, '!arg' => arg(1))), 'error');
+      return;
+    }
+    else
+      $gid = arg(1);
+  }
+  else
+    $gid = $node->nid;
+
+  $titles = _og_titles_get_available_titles($gid);
+
+  foreach ($titles as $title) {
+    $form[$title->tlid] = array(
+      '#tree' => TRUE,
+    );
+    $form[$title->tlid]['weight'] = array(
+      '#type' => 'weight',
+      '#title' => t('Weight'),
+      '#delta' => 10,
+      '#default_value' => $title->weight
+    );
+    $form[$title->tlid]['title'] = array(
+      '#type' => 'value',
+      '#value' => $title->title,
+    );
+
+    $form[$title->tlid]['tlid'] = array(
+      '#type' => 'value',
+      '#value' => $title->tlid,
     );
-    return $options;
- } // function og_titles_ogt_type
-
-
- /**
-  * og_titles_text_input form
-  * @param &$form
-  * @param &$form_state
-  * @param $gid
-  * @param $uid
-  */
- function og_titles_text_input(&$form, &$form_state, $gid, $uid = NULL)
- {
-    $form['#type'] = 'textfield';
-	$form['#size'] = 60;
-	$form['#maxlength'] = 64;
-
-    if (isset($uid))
-    {
-	    $res = db_query("SELECT title FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid);
-        $to = db_fetch_object($res);
+  }
+
+  $form['nid'] = array(
+    '#type' => 'value',
+    '#value' => $gid,
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+  );
+
+  return $form;
+
+} // og_titles_group_settings
+
+
+/**
+ * theme function for og_titles_group_settings
+ * @param $form
+ * @return what
+ */
+function theme_og_titles_group_settings($form) {
+  drupal_add_tabledrag('title-overview', 'order', 'sibling', 'weight');
+
+  $output = '';
+  $header = array('Title','Weight','Operation');
+  $rows = array();
+  $nid = $form['nid']['#value'];
+
+  $i = 1;
+
+  foreach( element_children($form) as $key) {
+    if (is_numeric($key)) {
+      $form[$key]['weight']['#attributes']['class'] = 'weight';
+
+      $row = array();
+      $row[] = $form[$key]['title']['#value'];
+      $row[] = drupal_render($form[$key]['weight']);
+      $row[] = l(t('Modify'),'node/'.$nid.'/titles/edit/'.$form[$key]['tlid']['#value']) . ', ' . l(t('Delete'),'node/'.$nid.'/titles/delete/'.$form[$key]['tlid']['#value']);
+      $rows[] = array( 'data' => $row, 'class' => 'draggable');
     }
+  }
+
+  $tabs = array(
+    'add' => array(
+      'href' => 'node/'.$nid.'/titles/edit',
+      'title' => t('Add title')
+    )
+  );
+
+  $output .= theme('links', $tabs, array('class' => 'tabs secondary'));
+  $output .= theme('table', $header, $rows, array ('id' => 'title-overview'));
+  $output .= drupal_render($form);
+
+  return $output;
 
-    if (isset($form_state['values']['og_title']))
-        $form['#default_value'] = $form_state['values']['og_title'];
+} // function theme_og_titles_group_settings
+
+
+/**
+ * og_titles_group_settings submit callback
+ * @param $form
+ * @param $form_state
+ */
+function og_titles_group_settings_submit($form, &$form_state) {
+  $nid = $form_state['values']['nid'];
+  foreach(element_children($form_state['values']) as $tlid) {
+    if (is_numeric($tlid)) {
+      db_query('UPDATE {og_titles} SET weight = %d WHERE nid = %d AND tlid = %d', $form_state['values'][$tlid]['weight'], $nid, $form_state['values'][$tlid]['tlid']);
+
+      // now to change in og_uid_titles as well
+      db_query("UPDATE {og_uid_titles} SET weight = %d WHERE nid = %d AND title = '%s'", $form_state['values'][$tlid]['weight'], $nid, $form_state['values'][$tlid]['title']);
+    }
+  }
+
+  drupal_set_message('Sorting data saved.');
+} // function og_titles_group_settings_submit
+
+
+/**
+ * Add a title to this group
+ * @param $form_state
+ * @return $form
+ */
+function og_titles_add_title(&$form_state, $node) {
+  if (!isset($node->nid) || !is_numeric($node->nid)) {
+    if (!is_numeric(arg(1))) {
+      drupal_set_message(t('error: gid is not numeric: !node or !arg', array('!node' => $node->nid, '!arg' => arg(1))), 'error');
+      return;
+    }
     else
-        $form['#default_value'] = isset($to->title) ? $to->title : '';
- } // function og_titles_text_input
-
-
- /**
-  * og_titles_select_input_save callback
-  * @param $gid
-  * @param $uid
-  * @param $title
-  * @param &$form
-  * @param &$form_state
-  * @return $success
-  */
- function og_titles_text_input_save($gid, $uid, $title, &$form, &$form_state)
- {
-     $to = db_fetch_object(db_query("SELECT * FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid));
-
-     if (isset($to->title))
-         return db_query("UPDATE {og_uid_titles} SET title = '%s', weight = 0 WHERE nid = %d AND uid = %d", $title, $gid, $uid);
-     else
-         return db_query("INSERT INTO {og_uid_titles} (nid, uid, title, weight) VALUES (%d, %d, '%s', 0)", $gid, $uid, $title);
-
- } // function og_titles_text_input_save
- 
-
- /** 
-  * og_titles_select_input form
-  *
-  * @param &$form
-  * @param &$form_state
-  * @param $gid
-  * @param $uid
-  */
- function og_titles_select_input(&$form, &$form_state, $gid, $uid = NULL)
- {
-     $form['#type'] = 'select';
-     $titles = _og_titles_get_available_titles($gid);
-     $options['none'] = '<'.t('None').'>';
-     foreach($titles as $title)
-        $options[$title->title] = $title->title;
-     $form['#options'] = $options;
-
-     if (isset($uid))
-     {
-	    $res = db_query("SELECT title FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid);
-        $to = db_fetch_object($res);
-     }
-
-     if (isset($form_state['values']['og_title']))
-        $form['#default_value'] = $form_state['values']['og_title'];
-     else
-        $form['#default_value'] = isset($to->title) ? $to->title : '';
-
- } // function og_titles_select_input
-
-
- /**
-  * og_titles_select_input_save callback
-  *
-  * @param $gid
-  * @param $uid
-  * @param $title
-  * @param &$form
-  * @param &$form_state
-  * @return $success
-  */
- function og_titles_select_input_save($gid, $uid, $title, &$form, &$form_state)
- {
-     $tl = _og_titles_get_title(NULL, $gid, $uid);
-     $to = db_fetch_object(db_query("SELECT * FROM {og_uid_titles} WHERE nid = %d AND uid = %d", $gid, $uid));
-
-     if ($title == 'none')
-         $title = '';
-     if (isset($to->title))
-         return db_query("UPDATE {og_uid_titles} SET title = '%s', weight = %d WHERE nid = %d AND uid = %d", $title, $tl->weight, $gid, $uid);
-     else
-         return db_query("INSERT INTO {og_uid_titles} (nid, uid, title, weight) VALUES (%d, %d, '%s', %d)", $gid, $uid, $title, $tl->weight);
- } // function og_titles_select_input_save
-
-
- /**
-  * manage a group's titles, draggable table form
-  * @param $form_state
-  * @param $node
-  * @return $form
-  */
- function og_titles_group_settings(&$form_state,$node)
- {
-	 if (!isset($node->nid) || !is_numeric($node->nid))
-	 {
-		 if (!is_numeric(arg(1)))
-		 {
-			 drupal_set_message(t('error: gid is not numeric: !node or !arg', array('!node' => $node->nid, '!arg' => arg(1))), 'error');
-			 return;
-		 }
-		 else
-		 	$gid = arg(1);
-	 }
-	 else
-		 $gid = $node->nid;
-
-	 $titles = _og_titles_get_available_titles($gid);
-
-	 foreach ($titles as $title)
-	 {
-		$form[$title->tlid] = array(
-			'#tree' => TRUE,
-		);
-	 	$form[$title->tlid]['weight'] = array(
-			'#type' => 'weight',
-			'#title' => t('Weight'),
-			'#delta' => 10,
-			'#default_value' => $title->weight
-		);
-		$form[$title->tlid]['title'] = array(
-			'#type' => 'value',
-			'#value' => $title->title,
-		);
-
-		$form[$title->tlid]['tlid'] = array(
-			'#type' => 'value',
-			'#value' => $title->tlid,
-		);
-	 }
-
-	 $form['nid'] = array(
-	 	'#type' => 'value',
-		'#value' => $gid,
-	 );
-
-	 $form['submit'] = array(
-	 	'#type' => 'submit',
-		'#value' => t('Save'),
-	 );
-
-	 return $form;
-
- } // og_titles_group_settings
-
-
- /**
-  * theme function for og_titles_group_settings
-  * @param $form
-  * @return what
-  */
- function theme_og_titles_group_settings($form)
- {
-	 drupal_add_tabledrag('title-overview', 'order', 'sibling', 'weight');
-
-	 $output = '';
-     $header = array('Title','Weight','Operation');
-	 $rows = array();
-	 $nid = $form['nid']['#value'];
-
-	 $i = 1;
-
-     foreach( element_children($form) as $key)
-	 {
-		 if (is_numeric($key))
-		 {
-			 $form[$key]['weight']['#attributes']['class'] = 'weight';
-
-			 $row = array();
-			 $row[] = $form[$key]['title']['#value'];
-			 $row[] = drupal_render($form[$key]['weight']);
-			 $row[] = l(t('Modify'),'node/'.$nid.'/titles/edit/'.$form[$key]['tlid']['#value']) . ', ' . l(t('Delete'),'node/'.$nid.'/titles/delete/'.$form[$key]['tlid']['#value']);
-			 $rows[] = array( 'data' => $row, 'class' => 'draggable');
-		 }
-	 }
-
-	 $tabs = array(
-	 	'add' => array(
-			'href' => 'node/'.$nid.'/titles/edit',
-			'title' => t('Add title')
-		)
-	 );
-
-	 $output .= theme('links', $tabs, array('class' => 'tabs secondary'));
-     $output .= theme('table', $header, $rows, array ('id' => 'title-overview'));
-	 $output .= drupal_render($form);
-
-	 return $output;
-
- } // function theme_og_titles_group_settings
-
- 
- /**
-  * og_titles_group_settings submit callback
-  * @param $form
-  * @param $form_state
-  */
- function og_titles_group_settings_submit($form, &$form_state)
- {
-	 $nid = $form_state['values']['nid'];
-	 foreach(element_children($form_state['values']) as $tlid)
-	 {
-		 if (is_numeric($tlid))
-		 {
-			 db_query('UPDATE {og_titles} SET weight = %d WHERE nid = %d AND tlid = %d',$form_state['values'][$tlid]['weight'],$nid,$form_state['values'][$tlid]['tlid']);
-
-			 // now to change in og_uid_titles as well
-
-			 db_query("UPDATE {og_uid_titles} SET weight = %d WHERE nid = %d AND title = '%s'",$form_state['values'][$tlid]['weight'],$nid,$form_state['values'][$tlid]['title']);
-		 }
-	 }
-
-	 drupal_set_message('Sorting data saved.');
- } // function og_titles_group_settings_submit
-
-
- /**
-  * Add a title to this group
-  * @param $form_state
-  * @return $form
-  */
- function og_titles_add_title(&$form_state,$node)
- {
-	 if (!isset($node->nid) || !is_numeric($node->nid))
-	 {
-		 if (!is_numeric(arg(1)))
-		 {
-			 drupal_set_message(t('error: gid is not numeric: !node or !arg', array('!node' => $node->nid, '!arg' => arg(1))), 'error');
-			 return;
-		 }
-		 else
-		 	$gid = arg(1);
-	 }
-	 else
-		 $gid = $node->nid;
-
-     $form['#redirect'] = 'node/'.$gid.'/titles';
-	 $form['title'] = array(
-	 	'#type' => 'textfield',
-		'#title' => t('Title'),
-		'#description' => t('Enter the title to add.'),
-		'#required' => TRUE
-	 );
-
-     if (is_numeric(arg(4)))
-	 {
-         $result = db_query("select * from {og_titles} where tlid=%d and nid=%d", arg(4), $gid);
-         $title = db_fetch_object($result);
-         $form['title']['#default_value'] = $title->title;
-
-		 $form['tlid'] = array(
-		 	'#type' => 'value',
-			'#value' => $title->tlid,
-		 );
-         $form['#redirect'] = 'node/'.$gid.'/titles/edit/'.$title->tlid;
-	 }
-
-	 $form['nid'] = array(
-	 	'#type' => 'value',
-		'#value' => $gid
-	 );
-
-	 $form['submit'] = array(
-	 	'#type' => 'submit',
-		'#value' => t('Save')
-	 );
-
-	return $form;
- }  // function og_titles_add_title
-
-
- /**
-  * og_titles_add_title submit callback
-  * @param $form
-  * @param $form_state
-  */
- function og_titles_add_title_submit($form, &$form_state)
- {
-	 $nid = $form_state['values']['nid'];
-
-	 if (isset($form_state['values']['tlid']))
-	 {
-		 db_query("UPDATE {og_titles} SET title = '%s' WHERE nid = %d AND tlid = %d",$form_state['values']['title'],$nid,$form_state['values']['tlid']);
-	 }
-	 else
-		 db_query("INSERT INTO {og_titles} (nid,title) VALUES (%d,'%s')",$nid,$form_state['values']['title']);
-	 drupal_set_message('Custom title saved.');
- } // function og_titles_group_settings_submit
-
-
- /**
-  * og_titles_delete_title - delete member title
-  * @param $node
-  * @param $tlid
-  */
- function og_titles_delete_title($node,$tlid)
- {
-	 if (!isset($node->nid) || !is_numeric($node->nid))
-	 {
-		 drupal_set_message('Error: node not specified.');
-         drupal_goto('node/'.$node->nid.'/titles');
-		 return;
-	 }
-	 if (!is_numeric($tlid))
-	 {
-		 drupal_set_message('Error: title not specified.');
-         drupal_goto('node/'.$node->nid.'/titles');
-		 return;
-	 }
-
-     if (is_object(_og_titles_get_title($tlid,$node->nid)))
-     {
-        db_query('DELETE FROM {og_titles} WHERE nid = %d and tlid = %d',$node->nid,$tlid);
-        if (isset($tl))
-          db_query("DELETE FROM {og_uid_titles} WHERE nid = %d and title = '%s'",$node->nid,$tl->title);
-        drupal_set_message('Deleted title.');
-     }
-
-     drupal_goto('node/'.$node->nid.'/titles');
-
- } // function og_titles_delete_title
-
- /**
-  *
-  *
-  */
- function og_titles_is_group_admin($node)
- {
-	 if (is_numeric($node)) 
-	 {
-		 $node = node_load($node);
-	 }
-	 else if (!is_object($node))
-	 {
-		 return FALSE;
-	 }
-
-	 return og_is_group_admin($node, NULL); 
- } // function og_titles_is_group_admin
-
- /**
-  * access callback to see if user can manage their own title and they are in the group
-  * @param $access permissions attribute
-  * @param $node node object
-  * @return boolean 
-  */
- function og_titles_manage_own_title($node)
- {
-	 global $user;
-
-	 if (!isset($node))
-		 return FALSE;
-
-	 if ( (!user_access('manage own og title')) && (!og_is_group_member($node, TRUE, $user->uid)) )
-		 return FALSE;
-	 return TRUE;
- } // function og_titles_manage_own_title
-
-
- /**
-  * form for user to manage own title for a group
-  * @param $form_state
-  * @param $node
-  */
- function og_titles_change_title($form_state, $node)
- {
-	 global $user;
-
-	 if (!isset($node->nid))
-	 {
-		 drupal_set_message('Error: No node id present');
-		 return;
-	 }
-	 $gid = $node->nid;
-
-	 $form['og_title'] = array(
-	 	'#title' => t('Member Title'),
-		'#description' => t('Please choose a member title for yourself for this group.'),
-	 );
-
-    $option = variable_get('og_titles_selection', 'og_titles_text_input');
-      if (function_exists($option))
-          $option($form['og_title'], $form_state, $gid, $user->uid);
-      else
-          drupal_set_message('This title selection option does not exist.', 'error');
-
-	 $form['nid'] = array(
-	 	'#type' => 'value',
-		'#value' => $gid,
-	 );
-
-	 $form['submit'] = array(
-	 	'#type' => 'submit',
-		'#value' => t('Save')
-	 );
-
-	 return $form;
- } // function og_titles_change_title
-
-
- /**
-  * submit callback for og_titles_change_title
-  * @param $form
-  * @param $form_state
-  */
- function og_titles_change_title_submit($form, &$form_state)
- {
-	 global $user;
-
-	 $option = variable_get('og_titles_selection','og_titles_text_input') . '_save';
-
-     $success = $option($form_state['values']['nid'], $user->uid, $form_state['values']['og_title'], $form, $form_state);
-
-     if (!$success)
-         drupal_set_message('Could not save member title.', 'error');
-     else
-         drupal_set_message('Member title saved');
- } // function og_titles_change_title_submit
-
-
- /**
-  * member titles admin page
-  * @param $form_state reference to the form
-  * @param $node hopefully the group node object or nid i.e. arg(2)
-  * @return $form the form to be returned
-  */
- function og_titles_view_titles($form_state, $node)
- {
-	 if (!isset($node->nid) || !is_numeric($node->nid))
-	 {
-	 	if (!is_numeric(arg(1)))
-		{
-		 	drupal_set_message(t('error: gid is not numeric: !node or !arg', array('!node' => $node->nid, '!arg' => arg(1))), 'error');
-		 	return;
-		}
-		else
-			$gid = arg(1);
-	 }
-	 else
-	 	$gid = $node->nid;
-
-	 $option = variable_get('og_titles_selection','og_titles_text_input');
-
-	 $form = array();
-     $form['titles'] = array(
-        '#tree' => TRUE,
+      $gid = arg(1);
+  }
+  else
+    $gid = $node->nid;
+
+  $form['#redirect'] = 'node/'.$gid.'/titles';
+  $form['title'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Title'),
+    '#description' => t('Enter the title to add.'),
+    '#required' => TRUE
+  );
+
+  if (is_numeric(arg(4))) {
+    $result = db_query("select * from {og_titles} where tlid=%d and nid=%d", arg(4), $gid);
+    $title = db_fetch_object($result);
+    $form['title']['#default_value'] = $title->title;
+
+    $form['tlid'] = array(
+      '#type' => 'value',
+      '#value' => $title->tlid,
+    );
+    $form['#redirect'] = 'node/'.$gid.'/titles/edit/'.$title->tlid;
+  }
+
+  $form['nid'] = array(
+    '#type' => 'value',
+    '#value' => $gid
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save')
+  );
+
+  return $form;
+} // function og_titles_add_title
+
+
+/**
+ * og_titles_add_title submit callback
+ * @param $form
+ * @param $form_state
+ */
+function og_titles_add_title_submit($form, &$form_state) {
+  $nid = $form_state['values']['nid'];
+
+  if (isset($form_state['values']['tlid'])) {
+    db_query("UPDATE {og_titles} SET title = '%s' WHERE nid = %d AND tlid = %d", $form_state['values']['title'], $nid, $form_state['values']['tlid']);
+  }
+  else
+    db_query("INSERT INTO {og_titles} (nid, title) VALUES (%d,'%s')", $nid, $form_state['values']['title']);
+  drupal_set_message('Custom title saved.');
+} // function og_titles_group_settings_submit
+
+
+/**
+ * og_titles_delete_title - delete member title
+ * @param $node
+ * @param $tlid
+ */
+function og_titles_delete_title($node, $tlid) {
+  if (!isset($node->nid) || !is_numeric($node->nid)) {
+    drupal_set_message('Error: node not specified.');
+    drupal_goto('node/' . $node->nid . '/titles');
+    return;
+  }
+  if (!is_numeric($tlid)) {
+    drupal_set_message('Error: title not specified.');
+    drupal_goto('node/' . $node->nid . '/titles');
+    return;
+  }
+
+   if (is_object(_og_titles_get_title($tlid, $node->nid))) {
+     db_query('DELETE FROM {og_titles} WHERE nid = %d and tlid = %d', $node->nid, $tlid);
+     if (isset($tl))
+       db_query("DELETE FROM {og_uid_titles} WHERE nid = %d and title = '%s'", $node->nid, $tl->title);
+     drupal_set_message('Deleted title.');
+   }
+
+   drupal_goto('node/'.$node->nid.'/titles');
+
+} // function og_titles_delete_title
+
+/**
+ *
+ *
+ */
+function og_titles_is_group_admin($node) {
+  if (is_numeric($node))  {
+    $node = node_load($node);
+  }
+  else if (!is_object($node)) {
+    return FALSE;
+  }
+
+  return og_is_group_admin($node, NULL); 
+} // function og_titles_is_group_admin
+
+/**
+ * access callback to see if user can manage their own title and they are in the group
+ * @param $access permissions attribute
+ * @param $node node object
+ * @return boolean 
+ */
+function og_titles_manage_own_title($node) {
+  global $user;
+
+  if (!isset($node))
+    return FALSE;
+
+  if ( (!user_access('manage own og title')) && (!og_is_group_member($node, TRUE, $user->uid)) )
+    return FALSE;
+  return TRUE;
+} // function og_titles_manage_own_title
+
+
+/**
+ * form for user to manage own title for a group
+ * @param $form_state
+ * @param $node
+ */
+function og_titles_change_title($form_state, $node) {
+  global $user;
+
+  if (!isset($node->nid)) {
+    drupal_set_message('Error: No node id present');
+    return;
+  }
+  $gid = $node->nid;
+
+  $form['og_title'] = array(
+    '#title' => t('Member Title'),
+    '#description' => t('Please choose a member title for yourself for this group.'),
+  );
+
+  $option = variable_get('og_titles_selection', 'og_titles_text_input');
+  if (function_exists($option))
+    $option($form['og_title'], $form_state, $gid, $user->uid);
+  else
+    drupal_set_message('This title selection option does not exist.', 'error');
+
+  $form['nid'] = array(
+    '#type' => 'value',
+    '#value' => $gid,
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save')
+  );
+
+  return $form;
+} // function og_titles_change_title
+
+
+/**
+ * submit callback for og_titles_change_title
+ * @param $form
+ * @param $form_state
+ */
+function og_titles_change_title_submit($form, &$form_state) {
+  global $user;
+
+  $option = variable_get('og_titles_selection','og_titles_text_input') . '_save';
+
+   $success = $option($form_state['values']['nid'], $user->uid, $form_state['values']['og_title'], $form, $form_state);
+
+   if (!$success)
+     drupal_set_message('Could not save member title.', 'error');
+   else
+     drupal_set_message('Member title saved');
+} // function og_titles_change_title_submit
+
+
+/**
+ * member titles admin page
+ * @param $form_state reference to the form
+ * @param $node hopefully the group node object or nid i.e. arg(2)
+ * @return $form the form to be returned
+ */
+function og_titles_view_titles($form_state, $node) {
+  if (!isset($node->nid) || !is_numeric($node->nid)) {
+    if (!is_numeric(arg(1))) {
+      drupal_set_message(t('error: gid is not numeric: !node or !arg', array('!node' => $node->nid, '!arg' => arg(1))), 'error');
+      return;
+    }
+    else
+      $gid = arg(1);
+  }
+  else
+    $gid = $node->nid;
+
+  $option = variable_get('og_titles_selection','og_titles_text_input');
+
+  $form = array();
+    $form['titles'] = array(
+    '#tree' => TRUE,
+   );
+
+  $qry = 'SELECT ogu.uid, u.name, ogt.title, ogu.nid FROM {og_uid} ogu LEFT OUTER JOIN {og_uid_titles} ogt ON (ogu.uid = ogt.uid AND ogu.nid = ogt.nid) INNER JOIN {users} u ON (u.uid = ogu.uid)  WHERE ogu.nid = %d';
+  $res = db_query($qry, $gid);
+
+  $form['titles'] = array( '#tree' => TRUE );
+
+  while ( $titles = db_fetch_object($res) ) {
+    $form['titles'][$titles->uid] = array(
+      '#title' => $titles->name,
+      '#description' => t('Please choose a member title for '.$titles->name),
      );
+     $option($form['titles'][$titles->uid], $form_state, $gid, $titles->uid);
+   }
+
+  $form['nid'] = array(
+    '#type' => 'value',
+    '#value' => $gid
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+  );
+
+  return $form;
+} // function og_titles_view_titles
+
+
+/**
+ * submit function for admin page
+ * @param $form
+ * @param $form_state
+ */
+function og_titles_view_titles_submit($form, &$form_state) {
+  $nid = $form_state['values']['nid'];
+  $users = _og_titles_get_uids($nid);
+
+  $option = variable_get('og_titles_selection','og_titles_text_input') . '_save';
+
+  foreach ( $users as $usr ) {
+    $success = $option($nid, $usr->uid, $form_state['values']['titles'][$usr->uid], $form, $form_state);
+
+    if (!$success)
+      drupal_set_message('Could not save title for '.$usr->name, 'error');
+  }
+} // function og_titles_view_titles_submit
+
+
+/**
+ * grab the user id and title from the og_uid_titles table (private)
+ * @param $nid the group node id
+ * @return $uids an array of og_uid_titles result objects.
+ */
+function _og_titles_get_uids($nid) {
+  $uids = array();
+
+  if ( !is_numeric($nid) )
+    return $uids;
+
+  $res = db_query("SELECT ogu.uid, ogt.title FROM {og_uid} ogu LEFT OUTER JOIN {og_uid_titles} ogt ON (ogu.uid = ogt.uid AND ogu.nid = ogt.nid) INNER JOIN {users} u ON (ogu.uid = u.uid) WHERE ogu.nid = %d", $nid);
+
+  while ( $og_usr = db_fetch_object($res) )
+    array_push($uids, $og_usr);
+  
+  return $uids;
+
+} // function _og_titles_get_uids
+
+
+/**
+ * fetches the available titles for the group (for selection-based method)
+ * @param $nid the group node id
+ * @return $titles an array of titles
+ */
+function _og_titles_get_available_titles($nid) {
+  $titles = array();
+
+  if (!is_numeric($nid) )
+    return $titles;
+
+  $res = db_query('SELECT * FROM {og_titles} WHERE nid = %d ORDER BY weight', $nid);
+
+  while ( $tl = db_fetch_object($res) )
+    $titles[$tl->title] = $tl;
+
+  return $titles;
+}  // function _og_titles_get_available_titles
+
+/**
+ * fetch a single title by title id
+ * @param $nid the group node id
+ * @param $tlid the title id
+ * @return $title object
+ */
+function _og_titles_get_title($tlid, $nid = NULL, $title = NULL) {
+  if ($tlid)
+    $res = db_query('SELECT * FROM {og_titles} WHERE tlid = %d', $tlid);
+  else
+    $res = db_query("SELECT * FROM {og_titles} WHERE nid = %d AND title = '%s'", $nid, $title);
+
+  $tl = db_fetch_object($res);
 
-	 $qry = 'SELECT ogu.uid, u.name, ogt.title, ogu.nid FROM {og_uid} ogu LEFT OUTER JOIN {og_uid_titles} ogt ON (ogu.uid = ogt.uid AND ogu.nid = ogt.nid) INNER JOIN {users} u ON (u.uid = ogu.uid)  WHERE ogu.nid = %d';
-	 $res = db_query($qry, $gid);
-
-	 $form['titles'] = array( '#tree' => TRUE );
-
-	 while ( $titles = db_fetch_object($res) )
-     {
-         $form['titles'][$titles->uid] = array(
-            '#title' => $titles->name,
-            '#description' => t('Please choose a member title for '.$titles->name),
-         );
-         $option($form['titles'][$titles->uid], $form_state, $gid, $titles->uid);
-     }
-
-	 $form['nid'] = array(
-	 	'#type' => 'value',
-		'#value' => $gid
-	 );
-
-	 $form['submit'] = array(
-	 	'#type' => 'submit',
-		'#value' => t('Save'),
-	);
-
-
-	 return $form;
- } // function og_titles_view_titles
-
-
- /**
-  * submit function for admin page
-  * @param $form
-  * @param $form_state
-  */
- function og_titles_view_titles_submit($form, &$form_state)
- {
-	 $nid = $form_state['values']['nid'];
-	 $users = _og_titles_get_uids($nid);
-
-	 $option = variable_get('og_titles_selection','og_titles_text_input') . '_save';
-
-	 foreach ( $users as $usr )
-	 {
-         $success = $option($nid, $usr->uid, $form_state['values']['titles'][$usr->uid], $form, $form_state);
-
-         if (!$success)
-             drupal_set_message('Could not save title for '.$usr->name, 'error');
-	 }
- } // function og_titles_view_titles_submit
-
-
- /**
-  * grab the user id and title from the og_uid_titles table (private)
-  * @param $nid the group node id
-  * @return $uids an array of og_uid_titles result objects.
-  */
- function _og_titles_get_uids($nid)
- {
-	 $uids = array();
-
-	 if ( !is_numeric($nid) )
-		 return $uids;
-
-	 $res = db_query("SELECT ogu.uid, ogt.title FROM {og_uid} ogu LEFT OUTER JOIN {og_uid_titles} ogt ON (ogu.uid = ogt.uid AND ogu.nid = ogt.nid) INNER JOIN {users} u ON (ogu.uid = u.uid) WHERE ogu.nid = %d",$nid);
-
-	 while ( $og_usr = db_fetch_object($res) )
-		 array_push($uids,$og_usr);
-	
-	return $uids;
-
- } // function _og_titles_get_uids
-
-
- /**
-  * fetches the available titles for the group (for selection-based method)
-  * @param $nid the group node id
-  * @return $titles an array of titles
-  */
- function _og_titles_get_available_titles($nid)
- {
-	 $titles = array();
-
-	 if (!is_numeric($nid) )
-		 return $titles;
-
-	 $res = db_query('SELECT * FROM {og_titles} WHERE nid = %d ORDER BY weight',$nid);
-
-	 while ( $tl = db_fetch_object($res) )
-	 	$titles[$tl->title] = $tl;
-
-	 return $titles;
- }  // function _og_titles_get_available_titles
-
- /**
-  * fetch a single title by title id
-  * @param $nid the group node id
-  * @param $tlid the title id
-  * @return $title object
-  */
- function _og_titles_get_title($tlid, $nid = NULL, $title = NULL)
- {
-	 if ($tlid)
-		 $res = db_query('SELECT * FROM {og_titles} WHERE tlid = %d',$tlid);
-	 else
-		 $res = db_query("SELECT * FROM {og_titles} WHERE nid = %d AND title = '%s'",$nid,$title);
-
-	 $tl = db_fetch_object($res);
-
-	 if ($tl->tlid == $tlid || $tl->title == $title)
-		 return $tl;
-	 drupal_set_message('Could not fetch title information for this node.','error');
-     return 0;
- } // function _og_titles_get_title
+  if ($tl->tlid == $tlid || $tl->title == $title)
+    return $tl;
+  drupal_set_message('Could not fetch title information for this node.','error');
+   return 0;
+} // function _og_titles_get_title
diff --git a/og_titles.views.inc b/og_titles.views.inc
index 5e47b59..b40493e 100644
--- a/og_titles.views.inc
+++ b/og_titles.views.inc
@@ -5,9 +5,9 @@
  * basic views 
  */
 function og_titles_views_data() {
-	$data['og_uid_titles']['table']['group'] = t('Organic groups');
+  $data['og_uid_titles']['table']['group'] = t('Organic groups');
 
-	$data['og_uid_titles']['table']['join'] = array(
+  $data['og_uid_titles']['table']['join'] = array(
     'users' => array(
       'left_field' => 'uid',
         'field' => 'uid',
@@ -18,20 +18,20 @@ function og_titles_views_data() {
      ),
   );
 
-	$data['og_uid_titles']['title'] = array(
-		'title' => t('Member Title'),
-		'help' => t('Display the title associated with the group member.'),
-		'field' => array(
-			'handler' => 'views_handler_field_og_title',
-			'click sortable' => TRUE,
-		),
-		'filter' => array(
-			'handler' => 'views_handler_filter_string',
-		),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		)
-	);
+  $data['og_uid_titles']['title'] = array(
+  	'title' => t('Member Title'),
+  	'help' => t('Display the title associated with the group member.'),
+  	'field' => array(
+  		'handler' => 'views_handler_field_og_title',
+  		'click sortable' => TRUE,
+  	),
+  	'filter' => array(
+  		'handler' => 'views_handler_filter_string',
+  	),
+  	'sort' => array(
+  		'handler' => 'views_handler_sort',
+  	)
+  );
 
    $data['og_uid_titles']['uid'] = array(
      'title' => t('Group Titles: Membership'),
@@ -46,13 +46,13 @@ function og_titles_views_data() {
      ),
    );
 
-	$data['og_uid_titles']['weight'] = array(
-		'title' => t('Weight'),
-		'help' => t('The weight of a group title.'),
-		'sort' => array(
-			'handler' => 'views_handler_sort',
-		),
-	);
+  $data['og_uid_titles']['weight'] = array(
+  	'title' => t('Weight'),
+  	'help' => t('The weight of a group title.'),
+  	'sort' => array(
+  		'handler' => 'views_handler_sort',
+  	),
+  );
 
   $data['og_uid_titles']['nid'] = array(
     'title' => t('Group Titles: Group id'),
@@ -70,7 +70,7 @@ function og_titles_views_data() {
     ),
   );
 
-	return $data;
+  return $data;
 
 } // function og_titles_views_data
 
diff --git a/og_titles.views_default.inc b/og_titles.views_default.inc
index d48e37e..2939536 100644
--- a/og_titles.views_default.inc
+++ b/og_titles.views_default.inc
@@ -1,410 +1,409 @@
 <?php
-	    
-function og_titles_views_default_views()
-{
-	$view = new view;
-	$view->name = 'og_member_titles';
-	$view->description = 'A simple member list of users, their groups, and their member titles.';
-	$view->tag = 'og';
-	$view->view_php = '';
-	$view->base_table = 'users';
-	$view->is_cacheable = FALSE;
-	$view->api_version = 2;
-	$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
-	$handler = $view->new_display('default', 'Defaults', 'default');
-	$handler->override_option('relationships', array(
-	  'uid' => array(
-	    'label' => 'Group Member',
-	    'required' => 1,
-	    'id' => 'uid',
-	    'table' => 'og_uid_titles',
-	    'field' => 'uid',
-	    'relationship' => 'none',
-	  ),
-	  'nid' => array(
-	    'label' => 'Group node',
-	    'required' => 0,
-	    'id' => 'nid',
-	    'table' => 'og_uid_titles',
-	    'field' => 'nid',
-	    'relationship' => 'none',
-	  ),
-	));
-	$handler->override_option('fields', array(
-	  'name' => array(
-	    'label' => '',
-	    'link_to_user' => 1,
-	    'exclude' => 1,
-	    'id' => 'name',
-	    'table' => 'users',
-	    'field' => 'name',
-	    'relationship' => 'none',
-	  ),
-	  'title' => array(
-	    'label' => '',
-	    'alter' => array(
-	      'alter_text' => 0,
-	      'text' => '',
-	      'make_link' => 0,
-	      'path' => '',
-	      'link_class' => '',
-	      'alt' => '',
-	      'prefix' => '',
-	      'suffix' => '',
-	      'help' => '',
-	      'trim' => 0,
-	      'max_length' => '',
-	      'word_boundary' => 1,
-	      'ellipsis' => 1,
-	      'strip_tags' => 0,
-	      'html' => 0,
-	    ),
-	    'exclude' => 0,
-	    'id' => 'title',
-	    'table' => 'og_uid_titles',
-	    'field' => 'title',
-	    'relationship' => 'none',
-	    'og_titles_manage_link' => '0',
-	  ),
-	  'title_1' => array(
-	    'label' => '',
-	    'alter' => array(
-	      'alter_text' => 0,
-	      'text' => '',
-	      'make_link' => 0,
-	      'path' => '',
-	      'link_class' => '',
-	      'alt' => '',
-	      'prefix' => '',
-	      'suffix' => '',
-	      'help' => '',
-	      'trim' => 0,
-	      'max_length' => '',
-	      'word_boundary' => 1,
-	      'ellipsis' => 1,
-	      'strip_tags' => 0,
-	      'html' => 0,
-	    ),
-	    'link_to_node' => 1,
-	    'exclude' => 0,
-	    'id' => 'title_1',
-	    'table' => 'node',
-	    'field' => 'title',
-	    'relationship' => 'nid',
-	  ),
-	));
-	$handler->override_option('sorts', array(
-	  'is_admin' => array(
-	    'order' => 'DESC',
-	    'id' => 'is_admin',
-	    'table' => 'og_uid',
-	    'field' => 'is_admin',
-	    'relationship' => 'uid',
-	  ),
-	  'is_active' => array(
-	    'order' => 'DESC',
-	    'id' => 'is_active',
-	    'table' => 'og_uid',
-	    'field' => 'is_active',
-	    'relationship' => 'uid',
-	  ),
-	));
-	$handler->override_option('filters', array(
-	  'status' => array(
-	    'operator' => '=',
-	    'value' => '1',
-	    'group' => '0',
-	    'exposed' => FALSE,
-	    'expose' => array(
-	      'operator' => FALSE,
-	      'label' => '',
-	    ),
-	    'id' => 'status',
-	    'table' => 'users',
-	    'field' => 'status',
-	    'relationship' => 'none',
-	  ),
-	));
-	$handler->override_option('access', array(
-	  'type' => 'none',
-	));
-	$handler->override_option('cache', array(
-	  'type' => 'none',
-	));
-	$handler->override_option('title', 'Global Member List');
-	$handler->override_option('header', 'A list of all members with their group and group title.');
-	$handler->override_option('header_format', '2');
-	$handler->override_option('header_empty', 0);
-	$handler->override_option('use_pager', '1');
-	$handler->override_option('style_plugin', 'list');
-	$handler->override_option('style_options', array(
-	  'grouping' => 'name',
-	  'type' => 'ul',
-	));
-	$handler = $view->new_display('block', 'Global Member List', 'block_1');
-	$handler->override_option('block_description', '');
-	$handler->override_option('block_caching', -1);
+      
+function og_titles_views_default_views() {
+  $view = new view;
+  $view->name = 'og_member_titles';
+  $view->description = 'A simple member list of users, their groups, and their member titles.';
+  $view->tag = 'og';
+  $view->view_php = '';
+  $view->base_table = 'users';
+  $view->is_cacheable = FALSE;
+  $view->api_version = 2;
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+  $handler = $view->new_display('default', 'Defaults', 'default');
+  $handler->override_option('relationships', array(
+    'uid' => array(
+      'label' => 'Group Member',
+      'required' => 1,
+      'id' => 'uid',
+      'table' => 'og_uid_titles',
+      'field' => 'uid',
+      'relationship' => 'none',
+    ),
+    'nid' => array(
+      'label' => 'Group node',
+      'required' => 0,
+      'id' => 'nid',
+      'table' => 'og_uid_titles',
+      'field' => 'nid',
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('fields', array(
+    'name' => array(
+      'label' => '',
+      'link_to_user' => 1,
+      'exclude' => 1,
+      'id' => 'name',
+      'table' => 'users',
+      'field' => 'name',
+      'relationship' => 'none',
+    ),
+    'title' => array(
+      'label' => '',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'exclude' => 0,
+      'id' => 'title',
+      'table' => 'og_uid_titles',
+      'field' => 'title',
+      'relationship' => 'none',
+      'og_titles_manage_link' => '0',
+    ),
+    'title_1' => array(
+      'label' => '',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'link_to_node' => 1,
+      'exclude' => 0,
+      'id' => 'title_1',
+      'table' => 'node',
+      'field' => 'title',
+      'relationship' => 'nid',
+    ),
+  ));
+  $handler->override_option('sorts', array(
+    'is_admin' => array(
+      'order' => 'DESC',
+      'id' => 'is_admin',
+      'table' => 'og_uid',
+      'field' => 'is_admin',
+      'relationship' => 'uid',
+    ),
+    'is_active' => array(
+      'order' => 'DESC',
+      'id' => 'is_active',
+      'table' => 'og_uid',
+      'field' => 'is_active',
+      'relationship' => 'uid',
+    ),
+  ));
+  $handler->override_option('filters', array(
+    'status' => array(
+      'operator' => '=',
+      'value' => '1',
+      'group' => '0',
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
+      ),
+      'id' => 'status',
+      'table' => 'users',
+      'field' => 'status',
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('access', array(
+    'type' => 'none',
+  ));
+  $handler->override_option('cache', array(
+    'type' => 'none',
+  ));
+  $handler->override_option('title', 'Global Member List');
+  $handler->override_option('header', 'A list of all members with their group and group title.');
+  $handler->override_option('header_format', '2');
+  $handler->override_option('header_empty', 0);
+  $handler->override_option('use_pager', '1');
+  $handler->override_option('style_plugin', 'list');
+  $handler->override_option('style_options', array(
+    'grouping' => 'name',
+    'type' => 'ul',
+  ));
+  $handler = $view->new_display('block', 'Global Member List', 'block_1');
+  $handler->override_option('block_description', '');
+  $handler->override_option('block_caching', -1);
 
-	$view = new view;
-	$view->name = 'og_my_titles';
-	$view->description = 'List user\'s subscribed groups, provide link to manage subscription and member title';
-	$view->tag = 'og_titles';
-	$view->view_php = '';
-	$view->base_table = 'node';
-	$view->is_cacheable = FALSE;
-	$view->api_version = 2;
-	$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
-	$handler = $view->new_display('default', 'Defaults', 'default');
-	$handler->override_option('relationships', array(
-	  'nid' => array(
-	    'label' => 'Group node',
-	    'required' => 0,
-	    'id' => 'nid',
-	    'table' => 'og_uid_titles',
-	    'field' => 'nid',
-	    'relationship' => 'none',
-	  ),
-	  'uid' => array(
-	    'label' => 'Group Member',
-	    'required' => 0,
-	    'id' => 'uid',
-	    'table' => 'og_uid_titles',
-	    'field' => 'uid',
-	    'relationship' => 'none',
-	  ),
-	));
-	$handler->override_option('fields', array(
-	  'title' => array(
-	    'id' => 'title',
-	    'table' => 'node',
-	    'field' => 'title',
-	    'label' => 'Group',
-	    'relationship' => 'none',
-	    'link_to_node' => 1,
-	  ),
-	  'name' => array(
-	    'id' => 'name',
-	    'table' => 'users',
-	    'field' => 'name',
-	    'label' => 'Manager',
-	    'link_to_user' => 1,
-	    'relationship' => 'none',
-	  ),
-	  'managelinkmy' => array(
-	    'label' => 'Manage',
-	    'alter' => array(
-	      'alter_text' => 0,
-	      'text' => '',
-	      'make_link' => 0,
-	      'path' => '',
-	      'link_class' => '',
-	      'alt' => '',
-	      'prefix' => '',
-	      'suffix' => '',
-	      'help' => '',
-	      'trim' => 0,
-	      'max_length' => '',
-	      'word_boundary' => 1,
-	      'ellipsis' => 1,
-	      'strip_tags' => 0,
-	      'html' => 0,
-	    ),
-	    'exclude' => 0,
-	    'id' => 'managelinkmy',
-	    'table' => 'og_uid',
-	    'field' => 'managelinkmy',
-	    'relationship' => 'uid',
-	  ),
-	  'title_1' => array(
-	    'label' => 'Member Title',
-	    'alter' => array(
-	      'alter_text' => 0,
-	      'text' => '',
-	      'make_link' => 0,
-	      'path' => '',
-	      'link_class' => '',
-	      'alt' => '',
-	      'prefix' => '',
-	      'suffix' => '',
-	      'help' => '',
-	      'trim' => 0,
-	      'max_length' => '',
-	      'word_boundary' => 1,
-	      'ellipsis' => 1,
-	      'strip_tags' => 0,
-	      'html' => 0,
-	    ),
-	    'exclude' => 0,
-	    'id' => 'title_1',
-	    'table' => 'og_uid_titles',
-	    'field' => 'title',
-	    'relationship' => 'none',
-	    'og_titles_manage_link' => '1',
-	  ),
-	));
-	$handler->override_option('sorts', array(
-	  'title' => array(
-	    'id' => 'title',
-	    'table' => 'node',
-	    'field' => 'title',
-	  ),
-	));
-	$handler->override_option('filters', array(
-	  'status' => array(
-	    'id' => 'status',
-	    'table' => 'node',
-	    'field' => 'status',
-	    'operator' => '=',
-	    'value' => 1,
-	    'group' => 0,
-	    'exposed' => FALSE,
-	    'expose' => array(
-	      'operator' => FALSE,
-	      'label' => '',
-	    ),
-	    'relationship' => 'none',
-	    'expose_button' => array(
-	      'button' => 'Expose',
-	    ),
-	  ),
-	  'type_groups_all' => array(
-	    'operator' => '=',
-	    'value' => '',
-	    'group' => 0,
-	    'exposed' => FALSE,
-	    'expose' => array(
-	      'operator' => FALSE,
-	      'label' => '',
-	    ),
-	    'id' => 'type_groups_all',
-	    'table' => 'og',
-	    'field' => 'type_groups_all',
-	    'relationship' => 'nid',
-	    'expose_button' => array(
-	      'button' => 'Expose',
-	    ),
-	  ),
-	  'uid' => array(
-	    'operator' => '=',
-	    'value' => '1',
-	    'group' => 0,
-	    'exposed' => FALSE,
-	    'expose' => array(
-	      'operator' => FALSE,
-	      'label' => '',
-	    ),
-	    'id' => 'uid',
-	    'table' => 'og_uid',
-	    'field' => 'uid',
-	    'relationship' => 'uid',
-	    'expose_button' => array(
-	      'button' => 'Expose',
-	    ),
-	    'override' => array(
-	      'button' => 'Override',
-	    ),
-	  ),
-	));
-	$handler->override_option('access', array(
-	  'type' => 'role',
-	  'role' => array(
-	    '2' => 2,
-	    '1' => 0,
-	  ),
-	  'perm' => 'view advanced help topic',
-	));
-	$handler->override_option('cache', array(
-	  'type' => 'none',
-	));
-	$handler->override_option('title', 'My groups');
-	$handler->override_option('empty', 'Not a member of any groups.');
-	$handler->override_option('empty_format', '1');
-	$handler->override_option('items_per_page', 50);
-	$handler->override_option('use_pager', '1');
-	$handler->override_option('use_more', 1);
-	$handler->override_option('style_plugin', 'table');
-	$handler->override_option('style_options', array(
-	  'override' => 1,
-	  'order' => 'asc',
-	  'columns' => array(
-	    'title' => 'title',
-	    'name' => 'name',
-	    'managelink' => 'managelink',
-	  ),
-	  'info' => array(
-	    'title' => array(
-	      'sortable' => 1,
-	      'separator' => '',
-	    ),
-	    'name' => array(
-	      'sortable' => 1,
-	      'separator' => '',
-	    ),
-	    'managelink' => array(
-	      'separator' => '',
-	    ),
-	  ),
-	  'default' => 'title',
-	));
-	$handler = $view->new_display('page', 'Page', 'page');
-	$handler->override_option('path', 'og/my');
-	$handler->override_option('menu', array(
-	  'type' => 'tab',
-	  'title' => 'My groups',
-	  'description' => '',
-	  'weight' => '0',
-	  'name' => 'navigation',
-	));
-	$handler->override_option('tab_options', array(
-	  'type' => 'none',
-	  'title' => '',
-	  'description' => '',
-	  'weight' => 0,
-	));
-	$handler = $view->new_display('block', 'Block', 'block_1');
-	$handler->override_option('fields', array(
-	  'title' => array(
-	    'id' => 'title',
-	    'table' => 'node',
-	    'field' => 'title',
-	    'label' => 'Group',
-	    'relationship' => 'none',
-	    'link_to_node' => 1,
-	  ),
-	  'post_count_new' => array(
-	    'label' => 'New',
-	    'set_precision' => FALSE,
-	    'precision' => 0,
-	    'decimal' => '.',
-	    'separator' => ',',
-	    'prefix' => '',
-	    'suffix' => '',
-	    'exclude' => 0,
-	    'id' => 'post_count_new',
-	    'table' => 'og',
-	    'field' => 'post_count_new',
-	    'override' => array(
-	      'button' => 'Use default',
-	    ),
-	    'relationship' => 'none',
-	  ),
-	));
-	$handler->override_option('sorts', array(
-	  'title' => array(
-	    'order' => 'ASC',
-	    'id' => 'title',
-	    'table' => 'node',
-	    'field' => 'title',
-	    'override' => array(
-	      'button' => 'Use default',
-	    ),
-	    'relationship' => 'none',
-	  ),
-	));
-	$handler->override_option('use_pager', '0');
-	$handler->override_option('block_description', 'My groups');
-	$handler->override_option('block_caching', -1);
-		
-	$views[$view->name] = $view;
-	return $views;
+  $view = new view;
+  $view->name = 'og_my_titles';
+  $view->description = 'List user\'s subscribed groups, provide link to manage subscription and member title';
+  $view->tag = 'og_titles';
+  $view->view_php = '';
+  $view->base_table = 'node';
+  $view->is_cacheable = FALSE;
+  $view->api_version = 2;
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+  $handler = $view->new_display('default', 'Defaults', 'default');
+  $handler->override_option('relationships', array(
+    'nid' => array(
+      'label' => 'Group node',
+      'required' => 0,
+      'id' => 'nid',
+      'table' => 'og_uid_titles',
+      'field' => 'nid',
+      'relationship' => 'none',
+    ),
+    'uid' => array(
+      'label' => 'Group Member',
+      'required' => 0,
+      'id' => 'uid',
+      'table' => 'og_uid_titles',
+      'field' => 'uid',
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('fields', array(
+    'title' => array(
+      'id' => 'title',
+      'table' => 'node',
+      'field' => 'title',
+      'label' => 'Group',
+      'relationship' => 'none',
+      'link_to_node' => 1,
+    ),
+    'name' => array(
+      'id' => 'name',
+      'table' => 'users',
+      'field' => 'name',
+      'label' => 'Manager',
+      'link_to_user' => 1,
+      'relationship' => 'none',
+    ),
+    'managelinkmy' => array(
+      'label' => 'Manage',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'exclude' => 0,
+      'id' => 'managelinkmy',
+      'table' => 'og_uid',
+      'field' => 'managelinkmy',
+      'relationship' => 'uid',
+    ),
+    'title_1' => array(
+      'label' => 'Member Title',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'exclude' => 0,
+      'id' => 'title_1',
+      'table' => 'og_uid_titles',
+      'field' => 'title',
+      'relationship' => 'none',
+      'og_titles_manage_link' => '1',
+    ),
+  ));
+  $handler->override_option('sorts', array(
+    'title' => array(
+      'id' => 'title',
+      'table' => 'node',
+      'field' => 'title',
+    ),
+  ));
+  $handler->override_option('filters', array(
+    'status' => array(
+      'id' => 'status',
+      'table' => 'node',
+      'field' => 'status',
+      'operator' => '=',
+      'value' => 1,
+      'group' => 0,
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
+      ),
+      'relationship' => 'none',
+      'expose_button' => array(
+        'button' => 'Expose',
+      ),
+    ),
+    'type_groups_all' => array(
+      'operator' => '=',
+      'value' => '',
+      'group' => 0,
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
+      ),
+      'id' => 'type_groups_all',
+      'table' => 'og',
+      'field' => 'type_groups_all',
+      'relationship' => 'nid',
+      'expose_button' => array(
+        'button' => 'Expose',
+      ),
+    ),
+    'uid' => array(
+      'operator' => '=',
+      'value' => '1',
+      'group' => 0,
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
+      ),
+      'id' => 'uid',
+      'table' => 'og_uid',
+      'field' => 'uid',
+      'relationship' => 'uid',
+      'expose_button' => array(
+        'button' => 'Expose',
+      ),
+      'override' => array(
+        'button' => 'Override',
+      ),
+    ),
+  ));
+  $handler->override_option('access', array(
+    'type' => 'role',
+    'role' => array(
+      '2' => 2,
+      '1' => 0,
+    ),
+    'perm' => 'view advanced help topic',
+  ));
+  $handler->override_option('cache', array(
+    'type' => 'none',
+  ));
+  $handler->override_option('title', 'My groups');
+  $handler->override_option('empty', 'Not a member of any groups.');
+  $handler->override_option('empty_format', '1');
+  $handler->override_option('items_per_page', 50);
+  $handler->override_option('use_pager', '1');
+  $handler->override_option('use_more', 1);
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option('style_options', array(
+    'override' => 1,
+    'order' => 'asc',
+    'columns' => array(
+      'title' => 'title',
+      'name' => 'name',
+      'managelink' => 'managelink',
+    ),
+    'info' => array(
+      'title' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+      'name' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+      'managelink' => array(
+        'separator' => '',
+      ),
+    ),
+    'default' => 'title',
+  ));
+  $handler = $view->new_display('page', 'Page', 'page');
+  $handler->override_option('path', 'og/my');
+  $handler->override_option('menu', array(
+    'type' => 'tab',
+    'title' => 'My groups',
+    'description' => '',
+    'weight' => '0',
+    'name' => 'navigation',
+  ));
+  $handler->override_option('tab_options', array(
+    'type' => 'none',
+    'title' => '',
+    'description' => '',
+    'weight' => 0,
+  ));
+  $handler = $view->new_display('block', 'Block', 'block_1');
+  $handler->override_option('fields', array(
+    'title' => array(
+      'id' => 'title',
+      'table' => 'node',
+      'field' => 'title',
+      'label' => 'Group',
+      'relationship' => 'none',
+      'link_to_node' => 1,
+    ),
+    'post_count_new' => array(
+      'label' => 'New',
+      'set_precision' => FALSE,
+      'precision' => 0,
+      'decimal' => '.',
+      'separator' => ',',
+      'prefix' => '',
+      'suffix' => '',
+      'exclude' => 0,
+      'id' => 'post_count_new',
+      'table' => 'og',
+      'field' => 'post_count_new',
+      'override' => array(
+        'button' => 'Use default',
+      ),
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('sorts', array(
+    'title' => array(
+      'order' => 'ASC',
+      'id' => 'title',
+      'table' => 'node',
+      'field' => 'title',
+      'override' => array(
+        'button' => 'Use default',
+      ),
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('use_pager', '0');
+  $handler->override_option('block_description', 'My groups');
+  $handler->override_option('block_caching', -1);
+  	
+  $views[$view->name] = $view;
+  return $views;
 } // function og_titles_views_default_views
