Active
Project:
Drupal for Facebook
Version:
6.x-2.0-beta3
Component:
Facebook Connect
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2010 at 13:51 UTC
Updated:
19 Aug 2010 at 15:32 UTC
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
Comment #1
RainDruplets commentedComment #2
Dave Cohen commentedDrupal 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.
Comment #3
RainDruplets commentedHi 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
Comment #4
orfalas commentedcan you please paste this code?
Think will be very useful
Comment #5
chazz commentedWould like to have this code as well please, what do you mean by masking? Does it show real username?
Comment #6
orfalas commentedI 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;
}
Comment #7
sushylCan 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!
=)
Comment #8
orfalas commentedfile fb_connect.module
just change theme_fb_connect_fbml_username function (line 833)