--- token_realname.inc	2010-10-27 09:29:16.000000000 +0200
+++ token_realnamenew.inc	2011-04-12 11:28:58.000000000 +0200
@@ -9,6 +9,7 @@ function realname_token_list($type = 'al
   $tokens = array();
   switch ($type) {
     case 'user':
+      $tokens[$type]['realname-user-page'] = t('The realname of the user\'s page you are looking at');
     case 'node':
       $tokens[$type]['realname-node-author'] = t('The realname of node author.');
 
@@ -31,6 +32,11 @@ function realname_token_values($type, $o
   }
   switch ($type) {
     case 'user':
+      //If you are in a user's page
+      if( arg(0)=='user' && is_numeric(arg(1)) ){
+        $tokens['realname-user-page'] = db_result(db_query("SELECT realname FROM {realname} WHERE uid = %d", arg(1)));
+      }
+
     case 'node':
       // If there's a nid, then create a token with the realname of
       // author of the node.
