251a252,301
> 
> /**
>  * Implementation of hook_link().
>  */
> function buddylist_link($type, $node = 0, $main) {
>   $links = array();
> 	global $user;
>   
>   // hook in and call the linking function
>   // this should be an option, but I'm hard coding it for now
>   
>   // basic check to see if you are the poster - if so, ignore.
>   // this would be a good place to see what kind of node this is as well, perhaps with per-node type on/off options
>   if (!($node->uid == $user->uid) && !($user->uid == 0)) {
>     $links[] = theme('buddylist_link', $node);
>   }
> 
>   return $links;
> }
> 
> /********************************************************************
>  * Module Functions :: Themeable Functions
>  ********************************************************************/
> 
> function theme_buddylist_link($node) {
>   global $user;
> 
>   $buddies = buddylist_get_buddies();
>   
>   $myquery = db_query("SELECT * FROM {users} WHERE UID = %d", $node->uid);
>   $nodeuser = db_fetch_object($myquery);
> 
> 
>   foreach ($buddies as $buser) {
> 	if ($node->uid == $buser->uid) {
> 		$links = l(t('remove %name from buddy list', array('%name' => $nodeuser->name)), "buddy/delete/$node->uid", array('title' => t('Remove this user to your buddy list')));
> 	}
>   }
>   if (!$links)
>   {
> 
> 		$links = l(t('add %name to buddy list', array('%name' => $nodeuser->name)), "buddy/add/$node->uid", array('title' => t('Add this user to your buddy list')));
>   }
>   
> 
>   return $links;
> }
> 
> 
> 
358c408
<       buddylist_goto_referrer();
---
>       drupal_goto("user/$user->uid");
379c429
<       buddylist_goto_referrer();
---
>       drupal_goto("user/$user->uid");
