Hi,
I want to shorten usernames for users registered with FB-Connect.
"Rapahel Example" -> "Raphael E."
how do I realize that?
--------------- Added [DATE]1305490636[/DATE] at [TIME]1305490636[/TIME] ---------------
got it myself, here is how
- browse to /includes/
- open "class_facebook.php"
- go to
PHP Code:
public function getFbUserInfo($force_reload = false)
- find
PHP Code:
$this->fb_userinfo = $response[0];
- add next line
PHP Code:
$this->fb_userinfo['name'] = shortenFBusername( $this->fb_userinfo['name'] );
- find
PHP Code:
// now return the user info if we got any
return $this->fb_userinfo;
}
- add after
PHP Code:
function shortenFBusername( $u ) {
return substr( $u, 0, -( strlen( $u ) - strpos( $u, " " ) )+2 ) . '.';
}