--- realname.module	Wed May 13 06:29:58 2009
+++ realname.module	Wed May 27 23:26:51 2009
@@ -188,12 +188,27 @@
  */
 function realname_user_view($account) {
   realname_check_breadcrumbs($account);
-  // Retrieve all profile fields and attach to $account->content.
-  user_build_content($account);
-
-  // To theme user profiles, copy modules/user/user_profile.tpl.php
-  // to your theme directory, and edit it as instructed in that file's comments.
-  return theme('user_profile', $account);
+  
+  if (module_exists('ctools')) {
+    // Load my task plugin:
+    $task = delegator_get_task('user_view');
+
+    // Load the account into a context.
+    ctools_include('context');
+    ctools_include('context-task-handler');
+    $contexts = ctools_context_handler_get_task_contexts($task, '', array($account));
+
+    $output = ctools_context_handler_render($task, '', $contexts, array($account->uid));
+  }
+  if ($output === FALSE) {
+    // Retrieve all profile fields and attach to $account->content.
+    user_build_content($account);
+
+    // To theme user profiles, copy modules/user/user_profile.tpl.php
+    // to your theme directory, and edit it as instructed in that file's comments.
+    $output = theme('user_profile', $account);
+  }
+  return $output;
 }
 
 /**
