Skip to Content Skip to Menu

[SOLVED] How to determine name format

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
12 years 5 months ago - 12 years 5 months ago #200483 by sfraise
[SOLVED] How to determine name format was created by sfraise
I'm trying to finish off an ajax radius member search component but am having trouble finding how to determine within the code what the name format value is in order to display the proper format in the results. I'm assuming there's something in the API that let's you find the selected name format.
Last edit: 12 years 5 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #200513 by krileon
Replied by krileon on topic Re: How to determine name format
Using getField API you'll want to get the formatname field. See tutorials within my signature regarding getting fields. See GJ class file for "getOwnerName" functions regarding exact usage.


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.

Please Log in or Create an account to join the conversation.

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
12 years 5 months ago #200600 by sfraise
Replied by sfraise on topic Re: How to determine name format
Ahh thanks Krileon, I didn't look at the getField as I assumed it would be a getCfg or something along those lines.

Please Log in or Create an account to join the conversation.

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
12 years 5 months ago - 12 years 5 months ago #200620 by sfraise
Replied by sfraise on topic Re: How to determine name format
Ok, now I've got one last issue regarding this.

I can get the results to show the chosen name format, but I've got a text input to search members by username/full name, whatever the chosen format is and the issue is how to determine what columns to search.

What I need is someway to do an if else or something along those lines to determine what name format is chosen and then set the code to search the username field in jos_user if it's username only, the name fields in cb if it's username only, or both if that's selected.

Using $cbUserResult->getField( 'formatname' ); is fine for pulling out the formatted name, but I need to determine what columns to search according to what format is used.

Hopefully that made sense.

The link to the component demo I'm working on is extensions.erecoverydev.com/index.php?option=com_cbajaxsearch&Itemid=3 if you want to get a better idea of what I'm talking about.
Last edit: 12 years 5 months ago by sfraise.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #200646 by krileon
Replied by krileon on topic Re: How to determine name format
You can use the below to get the current configured name format.

$ueConfig

1 = Name
2 = Name (Username)
3 = Username (Name)
4 = Username


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.

Please Log in or Create an account to join the conversation.

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
12 years 5 months ago #200688 by sfraise
Replied by sfraise on topic Re: How to determine name format
Perfect, thanks!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum