Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

[SOLVED] Replace Characters in Username on Display

  • korireed
  • korireed
  • OFFLINE
  • Posts: 9
  • Thanks: 1
  • Karma: 0
9 years 11 months ago - 9 years 10 months ago #257651 by korireed
Hello,

I'm still a newbie dev in the J! and CB world. The usernames on my website come from members' Xbox Live gamertags (which stupidly allow spaces).

In order to create quick links to certain things, I need to be able to replace the underscores in the usernames (which get inserted in place of spaces upon registration automatically by J!) with the URL space %20 when generated to the profile. I don't want to actually change the usernames in the database or anything of the sort. So for example when outputting a link to the profile through a field: a_gamertag would be changed into a%20gamertag.

Is this possible somehow? A plugin or some kind of regex in a Custom HTML field? I haven't had much luck finding anything through Google. Any guidance is appreciated!
Last edit: 9 years 10 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
9 years 10 months ago #257699 by krileon
Replied by krileon on topic Replace Characters in Username on Display
If you're using Joomla 3.3 I believe the username issue with spaces was fixed already (CB was adding the underscores as Joomla would error, this behavior is gone now). It was kind of a oops to implement that and was quickly removed. So it should only be bugged like that for 1 or 2 Joomla releases.

As you're wanting the URL to even conform to the change you have no choice, but to change the stored database value. This can be done with CB 2.0.5 and CB Auto Actions 6.2.1 with a Field action as the new format functions include a replace function, but I strongly advise just updating Joomla so you can have spaces in usernames.


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.

  • korireed
  • korireed
  • OFFLINE
  • Posts: 9
  • Thanks: 1
  • Karma: 0
9 years 10 months ago #257718 by korireed
Replied by korireed on topic Replace Characters in Username on Display
Thanks, krileon!

I am using the fully updated versions of all plugins, components, and J!.

I'm struggling to figure out the proper way to setup the auto action so that it does the parse.

How would you setup the action to update the database on profile display?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
9 years 10 months ago #257725 by krileon
Replied by krileon on topic Replace Characters in Username on Display
Ensure you've CB 2.0.5 and Joomla 3.3.6 or Joomla 2.5.28. I've just confirmed spaces in username work fine. So you shouldn't have any issues with this assuming you're up to date. There's no need to configure a complicated auto action for something already supported by the core. You'll of course need to manually fix the existing usernames, but aside from that future usernames shouldn't have any problems.


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.
The following user(s) said Thank You: korireed

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

  • korireed
  • korireed
  • OFFLINE
  • Posts: 9
  • Thanks: 1
  • Karma: 0
9 years 10 months ago #257727 by korireed
Replied by korireed on topic Replace Characters in Username on Display
Okay, great. I went ahead and manually edited the usernames and all is well. Thank you!

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

Moderators: beatnantkrileon
Powered by Kunena Forum