I use Facebook Connect for my drupal site and it works fine, I like the module a lot, it shows my user name in words in the blog page posts and other content but in the My Account (user profile) page it displays the id as
340000003367@facebook.com, how do I prevent it from showing the id this way.

I do not want to disable 'create local account'.

I tried the solution which Dave Cohen had given regarding the creation of a module using this code
http://drupal.org/node/626998

but I don't know how to implement the above in a new module.

Please tell me solution. This is urgent.

Regards,
RainDrupalets

Comments

RainDruplets’s picture

Version: 6.x-2.0-beta4 » 6.x-2.0-beta3
Dave Cohen’s picture

Status: Needs work » Closed (won't fix)

Drupal 7 introduces a function called format_username(). With that, it is possible for a module to fix this. But in Drupal 6, there is no way.

The page you linked to is the best I can do. If you have trouble building a module, just read the documentation easily found all over drupal.org.

RainDruplets’s picture

Hi Dave,

I solved the issue by going to the theme module and masking the code where it displays the registered users name. I left the internal database and other fb module code untouched.

Thanks again. great module.

Regards,
Sripreethi

orfalas’s picture

can you please paste this code?

Think will be very useful

chazz’s picture

Status: Closed (won't fix) » Active

Would like to have this code as well please, what do you mean by masking? Does it show real username?

orfalas’s picture

I have used the mask implemented in drupal for facebook module and works great, but can't take username as plain text to create content profile :_(

function theme_fb_connect_fbml_username($fbu, $object, $orig) {
if (!$fbu) {
return $orig;
}

$wrap_pre = "$orig";
$wrap_post = "\n";
if ($object->uid && user_access('access user profiles')) {
// Provide link if local account.
$wrap_pre = $wrap_pre . 'uid) . '">';
$wrap_post = '
' . $wrap_post;
$ifcantsee = 'ifcantsee="' . addslashes(check_plain($object->name)) . '"';
}

$fbml = ""; $output = $wrap_pre . $fbml . $wrap_post;

return $output;
}

sushyl’s picture

Can you please share where to put this code. (I didnt get where is theme module really.)
That would be really great help orfalas.
Thanks in advance!
=)

orfalas’s picture

file fb_connect.module

just change theme_fb_connect_fbml_username function (line 833)