Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

What would be the best way to add custom code to register.profile.php

11 years 9 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi,

I need to add some Constant Contact contact list integration to the registration page. So far:

1. I have overridden the register.profile.php in my template.

2. I have a few registration fields that allow the user to opt in to a few CC mailing lists (Yes/No radio boxes).

3. I have added custom Javascript functions to register.profile.php that gets the value of the opt-in fields and attempts to add the user to a CC contact list (via CC's ajax API).

The problem I have is: I am unable to get the registering user's details since they were entered on the previous page. JFactory::getUser() returns null. I am guessing this is so because the user is not really authenticated at this point.

How can I get the registered user's Joomla user details at this point? Is there a better place to attempt this integration?

Thanks
Chris

11 years 9 months ago
Licenses:

HI.

JFactory::getUser(); will always return null for not logged in user. User is not automatically logged in during registration process. So any data entered need to be catched from form on the flow.

In this issue you need a developer support which is beyond our technical support. Sou you'll need help of professional developer in this integration.

But what I understand you want to incorporate mailing lists into registration form. Well, you can try to use Acymailing that has such an integration already: www.acyba.com/acymailing/143-acymailing-...cial-acymailing.html


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
11 years 9 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi Michal and thank you for the reply.

I understand that a solution is beyond your assistance. We have a good idea of what code needs to be added, but just need a little guidance on what hooks to the registration system JomSocial provides:

1. At the profile registration page, what details does the profile know about the user that we might be able to pull from one on of the Jomsocial objects? Just userid? I just don't understood the JomSocial hooks well enough.

2. If we were to attempt this logic after the user has authenticated, what would be the correct object or api to call to retrieve the user's completed profile? We need to check a few custom profile fields.

Thanks

11 years 9 months ago
Licenses:

Hi.

During registration no user data could be pulled using API as no data is collected yet.
User is not registered - is still a guest and data could be only saved into database.
After first step only Joomla obligatory data is collected but I don't think there is a easy way to pull it. In registration you don't have any valid parameters that based on which you could pull any data.

So only option will be to use some ajax scripts that catch and store data on the fly and send them to variables.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
11 years 9 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Understood. So is there any objects that JomSocial exposes to, let's say, a module or plugin that would allow an authenticated user or admin to JomSocial profile data? I am looking for a PHP hook to the profile data.

Thanks
Chris

11 years 9 months ago
Licenses:

Hi.

You always could create a direct query to database and acquire necessary data... but you need a something that query could start with e.g user ID or profile ID. So it's impossible to display user related data for not logged in user (except data related to any other user/profile). So data based on current logged in user ID will be not displayed to guest as guest has always ID = 0.

The only user related data that could be displayed for guest are those related (based upon) with profile ID.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW