Module: Enhanced Custom Profiles
Posted by Joe Curia
Re: Module: Enhanced Custom Profiles v5.2.1.06 - Bugfixes and More "Required" Fields October 08, 2009 12:10PM |
Registered: 14 years ago Posts: 753 |
Re: Module: Enhanced Custom Profiles October 13, 2009 06:31PM |
Registered: 18 years ago Posts: 50 |
hi joe,
Hm it seems like this doesn't work for me, at least not with php. I wanted to have a custom user field that should only be shown, if it wasn't set yet.
my scenario: Users can (optionally) select their sex on the registration page. In general the sex doesn't change anymore, so I thought it would make sense to only show this select box again in the controlcenter, if the user didn't select his sex on the registration page.
So I tried the following:
1. user_profil_sex_before:
2. user_profil_sex
3. user_profil_sex_after:
But this gives me the following error message:
any ideas? thanks!
Quote
There is also one further option when adding a new field. This is the Custom HTML option. This is not actually a custom profile field but rather it gives you the option of adding your own HTML to the Control Center page. You can also include your own php scripts in this field by using the "<?php" and "?>" tags. This will allow you to customize the Control Center page as you wish. See the attached screenshots for an example of this.
Hm it seems like this doesn't work for me, at least not with php. I wanted to have a custom user field that should only be shown, if it wasn't set yet.
my scenario: Users can (optionally) select their sex on the registration page. In general the sex doesn't change anymore, so I thought it would make sense to only show this select box again in the controlcenter, if the user didn't select his sex on the registration page.
So I tried the following:
1. user_profil_sex_before:
Language: PHP<?php if($PHORUM["DATA"]["PROFILE"]["user_profil_sex"] ==0) { ?>
2. user_profil_sex
3. user_profil_sex_after:
Language: PHP<?php } ?>
But this gives me the following error message:
Language: PHPParse error: syntax error, unexpected $end in ../forum/mods/enhanced_custom_profiles/enhanced_custom_profiles.php(125) : eval()';d code on line 1
any ideas? thanks!
October 13, 2009 10:54PM |
Moderator Registered: 16 years ago Posts: 1,301 |
Quote
noe
Hm it seems like this doesn't work for me, at least not with php. I wanted to have a custom user field that should only be shown, if it wasn't set yet.
my scenario: Users can (optionally) select their sex on the registration page. In general the sex doesn't change anymore, so I thought it would make sense to only show this select box again in the controlcenter, if the user didn't select his sex on the registration page.
So I tried the following:
1. user_profil_sex_before:
Language: PHP<?php if($PHORUM["DATA"]["PROFILE"]["user_profil_sex"] ==0) { ?>
2. user_profil_sex
3. user_profil_sex_after:
Language: PHP<?php } ?>
But this gives me the following error message:
Language: PHPParse error: syntax error, unexpected $end in ../forum/mods/enhanced_custom_profiles/enhanced_custom_profiles.php(125) : eval()';d code on line 1
The problem is that each field is evaluated separately. Please first re-download/install v5.2.1.06 of this module (or at least the settings.php file) as there was a bug which was exposed by this bit of code.
After reuploading the settings.php file, try this set of profile fields which will hide the form element from the user (but not the source code for the control center page).
1. user_profil_sex_before:
Language: PHP<?php if(!empty($PHORUM["DATA"]["PROFILE"]["user_profil_sex"])) print "<!-- "; ?>
2. user_profil_sex
3. user_profil_sex_after:
Language: PHP<?php if(!empty($PHORUM["DATA"]["PROFILE"]["user_profil_sex"])) print " -->"; ?>
One note of concern for this method, if the user accidentally selects the wrong sex during registration, they may be a bit irked that they cannot change it later. This becomes compounded by the fact that a dropdown form input may actually select the first item if no formal selection is made. Thus if you have created a user_profil_sex dropdown field with the choices "female,male" and the user does not make a selection, the browser may still send "female" as the selected choice.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Enhanced Custom Profiles October 14, 2009 08:22AM |
Registered: 18 years ago Posts: 50 |
Thanks, it works now! I now understand how it should be done correctly ;)
Yes that's right and I'm aware of this fact...
Well my first select item is "please select" with value 1, so if the user doesn't make a selection during registration, he won't be forced to male/female and can still select it afterwards....
Quote
One note of concern for this method, if the user accidentally selects the wrong sex during registration, they may be a bit irked that they cannot change it later.
Yes that's right and I'm aware of this fact...
Quote
This becomes compounded by the fact that a dropdown form input may actually select the first item if no formal selection is made. Thus if you have created a user_profil_sex dropdown field with the choices "female,male" and the user does not make a selection, the browser may still send "female" as the selected choice.
Well my first select item is "please select" with value 1, so if the user doesn't make a selection during registration, he won't be forced to male/female and can still select it afterwards....
Re: Module: Enhanced Custom Profiles October 15, 2009 01:21PM |
Registered: 14 years ago Posts: 753 |
Thanks for the update!
I don't want to bug you but imagine you have a drop-down menu of all the states and you require the user to enter his home state. At this moment your module would automatically enter the first selection of the list, in my case:"Please, select your home state.", if the user didn't make a choice. Of course, this would not be a desired result. Thanks for your consideration!
I don't want to bug you but imagine you have a drop-down menu of all the states and you require the user to enter his home state. At this moment your module would automatically enter the first selection of the list, in my case:"Please, select your home state.", if the user didn't make a choice. Of course, this would not be a desired result. Thanks for your consideration!
Re: Module: Enhanced Custom Profiles | Google Maps October 28, 2009 11:26AM |
Registered: 14 years ago Posts: 753 |
October 29, 2009 10:51PM |
Moderator Registered: 16 years ago Posts: 1,301 |
Quote
korsakov
Thanks for the update!
I don't want to bug you but imagine you have a drop-down menu of all the states and you require the user to enter his home state. At this moment your module would automatically enter the first selection of the list, in my case:"Please, select your home state.", if the user didn't make a choice. Of course, this would not be a desired result. Thanks for your consideration!
First, please note that this is not only the case with my module. This is the way most browsers handle dropdown lists. One way to get around this is to leave the first item blank in the list (ie ",AL,AK,AZ, etc." - note the starting comma). In the future, I may implement something like that to enable making a dropdown field required. This won't be happening until next week at the earliest.
Quote
I am wondering about compatibility issues with the Google Maps module. I am not able to display the map within profile.tpl. Might there be an issue? It only shows under "Edit Profile" within the Control Center if I choose the automatic module placement. Generally, {MOD_GOOGLE_MAPS} cannot be placed manually.
There should not be any compatibility issues, but please note that, because there is no built-in support for displaying custom profile fields in the default profile.tpl, this module implements its own profile.tpl file which can be found (and edited) in the /mods/enhanced_custom_profiles/templates/{your_template} folder.
Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Enhanced Custom Profiles October 30, 2009 09:15AM |
Registered: 14 years ago Posts: 753 |
Re: Module: Enhanced Custom Profiles November 13, 2009 04:28PM |
Registered: 14 years ago Posts: 753 |
Re: Module: Enhanced Custom Profiles November 16, 2009 11:38PM |
Registered: 14 years ago Posts: 753 |
Sorry, only registered users may post in this forum.