By Altitudes on Saturday, 09 May 2015
Replies 5
Likes 0
Views 1.1K
Votes 0
Hello

I would like to override the following files :
- components\com_easysocial\themes\wireframe\registration\default.complete.approvals.php
(page displayed after registration, pending approval)
- components\com_easysocial\themes\wireframe\emails\html\registration\approvals.php
(mail sent after registration, pending approval)

What I want to display will depend on the Profile Type of the user. What would be the code to fetch the Profile Type of the user who just registered in each of these files?

Thanks for your help!
Hello Altitudes,

For this file components\com_easysocial\themes\wireframe\registration\default.complete.approvals.php, you can use $user->profile_id to get the ID of the profile. And as for this file components\com_easysocial\themes\wireframe\emails\html\registration\approvals.php, you can use $profileType to get the profile name. Please give it a try.
·
Monday, 11 May 2015 10:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you Nik.

In components\com_easysocial\themes\wireframe\emails\html\registration\approvals.php, how can I get the Profile Type ID rather than its name?
·
Tuesday, 12 May 2015 06:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

It is a bit tricky, you have to add extra variable from ../administrator/components/com_easysocial/models/registration.php on line 916.

.
.
'profileType' => $profile->get( 'title' ),
'profileId' => $profile->id


And you can directly call the $profileId in components\com_easysocial\themes\wireframe\emails\html\registration\approvals.php. Please give it a try.
·
Tuesday, 12 May 2015 10:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

I have an issue about this. I want that depending on the profile type selected by a new user, the mail sent is different.

So I have created a profile type "test" and a profile "test2"
In components\com_easysocial\themes\wireframe\emails\html\registration\approvals.php I added this :

<?php if( $profileType==test){ ?>
<p style="margin-bottom: 50px;font-size:15px;color:black;">
<?php echo JText::sprintf( 'COM_EASYSOCIAL_EMAILS_REGISTRATION_MODERATED_THANK_YOU_FOR_REGISTERING_TEST' , $site ); ?>
</p>
<?php } ?>

<?php if( $profileType==test2){ ?>
<p style="margin-bottom: 50px;font-size:15px;color:black;">
<?php echo JText::sprintf( 'COM_EASYSOCIAL_EMAILS_REGISTRATION_MODERATED_THANK_YOU_FOR_REGISTERING_TEST2', $site ); ?>
</p>
<?php } ?>


(I created texts for COM_EASYSOCIAL_EMAILS_REGISTRATION_MODERATED_THANK_YOU_FOR_REGISTERING_TEST2 and COM_EASYSOCIAL_EMAILS_REGISTRATION_MODERATED_THANK_YOU_FOR_REGISTERING_TEST")

The problem is when I try, if I have selected profile type "Test", in the mail I received I have the two text (Test1 and Test 2).
And if I select a third profile type, I have the two texts again.
So, that's like the code only verifies if there is a profile type who existed with this name and no if it's the profile selected.

What mistake have I made ?

Thanks a lot for your help,

Edgar
·
Tuesday, 01 September 2015 15:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Your code is wrong. Your checking should be something like this,


<?php if ($profileType == 'test') { ?>
<?php } ?>
·
Thursday, 03 September 2015 02:02
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post