We would like to synchronize Joomla user name field (composed of names separated by spaces) with Community Builder user first name and last name. Is there an option in Community Builder to take only first part of Joomla user name and put it in the Community Builder first name field and then take all the rest of the Joomla user name and put it in the last name field ?
Run the User Synchronization tool within CB > Tools and then onward do not use Joomla registration, but instead use CB registration. It can synchronize first, middle, and last separated by a space. How it's formatted can be adjusted within CB > Configuration > General using the "Name Style" parameter.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
We already tried the synchronize button but it doesn't work the way we wanted it. I build a small custom script to transfer our OSE membership first name and last name into the comprofiler table (could have been from Joomla user too). Here's the script :
Code:
<?php
$username = "";
$database = "";
$password = "";
$hostname = "";
$prefix = "";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db($database,$dbhandle)or die("Could not select examples");
mysql_set_charset('utf8',$dbhandle);
$sql = "SELECT user_id,firstname,lastname FROM `".$prefix."_osemsc_billinginfo`";
$result = mysql_query($sql) or die( mysql_error() );
while($row = mysql_fetch_assoc($result)) {
mysql_query("UPDATE ".$prefix."_comprofiler SET firstname = '".addslashes($row['firstname'])."', lastname= '".addslashes($row['lastname'])."' WHERE user_id = ".$row['user_id'].";") or die( mysql_error() );
}
?>
It won't synchronize users that already exist in CB. As long as CB registration is used you shouldn't run into this issue.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.