Topic: Create a New Field for Marketing and / or Referral Purposes
With this post we will create a new field that is displayed on the registration page only.
Use this new field to collect Referral or Marketing information.
Once entered, the member and all other members cannot view and / or edit this new field.
Only the site admin can view and / or edit this new field.
Step 1 - Create the new field
In your control panel
[Settings]---» under the “Quick jump” menu [Custom fields]--- »[General]
[add field]
Name---» name of your new field (example: Referred By)
[Translate] if your site uses multiple languages, type in in the translated field name
Label---» label of the group (no spaces or underscores): (example :referredby)
Search label---» leave blank or enter cross search field
Group---» this field belongs to which group
Type---»input type for this field: text
Required---» [Yes] or [No] ---»indicates field must be filled in
Maximum length--- » if using “text “type” field max character allowed(example: 26)
Width--- » Width of field box (example: 160px)
Default value--- » if field is required, the default value
Load in registration ---» [Yes]
Load in simple search ---» [No]
Load in advanced search ---» [No]
Load in member lists ---» [Yes]
Load in account profile ---» [No]
Load in account separately ---» [No]
Load in public profile ---» [Yes]
Use in matchmaking ---» [No]
[Submit]
Step 2- Add new field name to your Language files.
Open your 'includes/languages/your_langauge' folder
edit your 'lang.core.php' file
insert:
"refer_by" =>
"refered by",
Note:
If your site uses multiple languages, add the new call to all your language packs.
Step 3 – Make the new field viewable to admin only.
Edit your 'member_section_card.tpl' located in your 'templates/your_template' folder.
Insert:
<!-- IF session.group_id == "1" -->
<!-- IF profile_field_referredby_value > "0" -->
<dt>{lang:"core","refer_by"}:</dt>
<dd>{profile_field_referredby_value}</dd>
<!-- ENDIF -->
<!-- ENDIF -->
Note:
a -With the above IF statement, the Refereed by field will only be displayed if the field has a name entered.
b - If your site uses multiple templates, add the new call to all your templates.
Step 4- Test your new field
a - Log in as Admin
in the control Panel
[Members] ---» goto your test member profile ---» [General]
Add a name to your new “Referred by” field then Log out
b - Visit your test member profile page
The “Referred by” field is NOT visible
c - Log in your test member account and goto 'Edit Profile'
The “Referred by” field is NOT visible then Log out
d - Log in as Admin and go to your test member Profile
The “Referred by” field IS visible
We are done
Now you have a:
1 - Custom field that is only visible to the site Admin.
2 - Custom field that members cannot see or edit after they join your site.
***Please post any questions about this tutorial in the Technical Support Forum***
Last edited by seeme101 (2009-08-08 14:42:48)