Field management

13 years 4 months ago #147783 by corpdash
Field management was created by corpdash
Hi all,

I've been looking at this for quite a while and am getting nowhere - please help if you can.

Basically, I need to access a registration field value from a different plugin i.e. MetaMod. I'm not asking for MetaMod advice here though.

For example, before installing CB 1.3 I was using ExtendedReg, and with ExtendedReg, I could create a field and then use the following php as a condition to display a screen element:

if (($ismember == 0 ) && ( $user->extreg == "X01" )) return 46;

This would then display the correct screen element depending on the type of user i.e. "X01".

All I want to be able to do with CB 1.3 is create a new field cb_registrationtype and was hoping to:

use $user->cb_registrationtype == "X01"

Clearly, I can't do this since cb_registrationtype is not a $user variable.

Does CB add my variable data somewhere where I can access them?

Can anyone shed any light on how I access field data without using $db and running a SQL query. I suppose I could do it this way, but it doesn't make much sense if the data is available.

Would appreciate your help.

Many thanks, Alex

Please Log in to join the conversation.

13 years 4 months ago #147879 by krileon
Replied by krileon on topic Re:Field management

Does CB add my variable data somewhere where I can access them?

Yes to the CB user object. CB does not add CB variables to the Joomla user object.

Can anyone shed any light on how I access field data without using $db and running a SQL query. I suppose I could do it this way, but it doesn't make much sense if the data is available.

Please review tutorials within my signature concerning loading the $user object. You'll need to also load the CB library if the usage is outside of a CB plugin.

I don't know how this will help you on registration though (based off contents of post assuming you're making conditionals for registration) as the user does not exist yet so all you'll get is an empty $user object.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.184 seconds

Facebook Twitter LinkedIn