how to make user_id field show in the profile

13 years 2 months ago #155185 by krileon

How would this code need to be modified to copy the email of the profile owner into a new field in jos_comprofiler?

Not necessary, user email is stored in _users, where you can use the user_id to match the ID column.

I need to send email notification to profile-owners and I have no clue as where to find this email. I assume that it is encrypted somewhere and need to be extracted somehow.

Email, Username, Password, Name are all stored in _users. Only Name is brought to CB table via firstname, middlename, and lastname columns. The ID/user_id columns in _comprofiler will match the ID column in _users.


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: ignatius2

Please Log in to join the conversation.

13 years 2 months ago #155274 by ignatius2
Thanks Kyle

So would the following query work to copy the email of the user from the jos_users table to the jos_comprofiler in a field called cb_copied_email?

UPDATE `#__comprofiler` SET `cb_copied_email` = [email] FROM `#__users` WHERE `id` = [user_id]

Are the table names going to work as-is or should they be replaced by their actual names in the query? (in other words, should the "#__" prefix be replaced by "jos_"?)

If I use plug_cbqueryfield, will the field value be updated if the user changes is email or not? (in other words, does plug_cbqueryfield display the remote field or does it copy it?)

Thanks

John

Please Log in to join the conversation.

13 years 2 months ago #155324 by krileon

So would the following query work to copy the email of the user from the jos_users table to the jos_comprofiler in a field called cb_copied_email?

Query doesn't look right; please see below.
UPDATE `#__comprofiler` SET `cb_copied_email` = '[email]' WHERE `id` = [user_id]

At any rate I don't understand the purpose of this. There's no reason to maintain the email in 2 tables. Just query the users table for it. If working from PHP the user object already contains this information as well.

Are the table names going to work as-is or should they be replaced by their actual names in the query? (in other words, should the "#__" prefix be replaced by "jos_"?)

If you're executing from CB Queries or PHP through CBs SQL functions then leave as #__. The substitutions you're using will also only work if being done from CB Queries or if in PHP you've ran the query through the substitution replacement function.

If I use plug_cbqueryfield, will the field value be updated if the user changes is email or not? (in other words, does plug_cbqueryfield display the remote field or does it copy it?)

CB Query Field displays the RESULT of a query, this means it needs to be a SELECT query. Update queries and of the like are not valid. You need to use CB Queries; huge difference between the two.


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.

13 years 2 months ago - 13 years 2 months ago #155350 by ignatius2
Thanks Kyle,

I know that there's no reason to maintain the email in 2 tables. It is bound to create trouble. It is not either a good idea to make the profile ID visible (even if only to authorized users). This would be a temporary solution until I can modify a PHP script that fetches all the data it needs from comprofiler.

Here is the error message I get when I click on the CB Query Field plugin:

Notice: Undefined property: moscomprofilerUser::$livePath in /var/www/mywebsite.com/components/com_comprofiler/plugin/user/plug_cbqueryfield/admin.cbqueryfield.php on line 80

Notice: Undefined property: moscomprofilerUser::$xml in /var/www/mywebsite.com/components/com_comprofiler/plugin/user/plug_cbqueryfield/admin.cbqueryfield.php on line 84

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/mywebsite.com/components/com_comprofiler/plugin/user/plug_cbqueryfield/admin.cbqueryfield.php:84 Stack trace: #0 /var/www/mywebsite.com/components/com_comprofiler/plugin/user/plug_cbqueryfield/admin.cbqueryfield.php(84): SimpleXMLElement->__construct('') #1 /var/www/mywebsite.com/components/com_comprofiler/plugin/user/plug_cbqueryfield/admin.cbqueryfield.php(44): cbqueryfieldAdmin->showPlugin(Object(moscomprofilerUser), Object(stdClass)) #2 /var/www/mywebsite.com/administrator/components/com_comprofiler/controller/controller.plugin.php(278): cbqueryfieldAdmin->editPluginView(Object(moscomprofilerPlugin), 'com_comprofiler', 'editPlugin', 516, '', Object(CBSimpleXMLElement), 'editPlugin', Object(cbParamsBase)) #3 /var/www/mywebsite.com/administrator/components/com_comprofiler/controller/controller.plugin.php(179): CBController_plugin->editPluginView(Object(moscomprofilerPlugin), 'com_comprofiler', 'ed in /var/www/mywebsite.com/components/com_comprofiler/plugin/user/plug_cbqueryfield/admin.cbqueryfield.php on line 84


Thanks a lot

Please Log in to join the conversation.

13 years 2 months ago #155459 by krileon

Here is the error message I get when I click on the CB Query Field plugin:

Fixed with 1.0.3, minor issue that won't affect the plugins 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 to join the conversation.

13 years 2 months ago - 13 years 2 months ago #155473 by ignatius2
OK. will try.

Thanks

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.189 seconds

Facebook Twitter LinkedIn