1

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)

Not only am I a Staff member,  I'm also a Client

2

Re: Create a New Field for Marketing and / or Referral Purposes

Great stuff!

3

Re: Create a New Field for Marketing and / or Referral Purposes

thanks ...

4

Re: Create a New Field for Marketing and / or Referral Purposes

great tuts!

Why SOB's succeeded at business when nice guys fail.

5

Re: Create a New Field for Marketing and / or Referral Purposes

I just did everything just as you said, but the referred by field is still visible to other members. how can this be fixed? Does this work for the 2.7 version? thanks

Last edited by shortcircuit (2012-12-22 16:42:02)

6

Re: Create a New Field for Marketing and / or Referral Purposes

make sure that "Load in Public profile" = No

BVI Captain Only Yacht Charters
My non-VLD site, so that if you really, really do need to contact me, you can.

7

Re: Create a New Field for Marketing and / or Referral Purposes

Thank you so much John!! Man I was getting frustrated because I was repeating the steps over and over again. The original tutorial needs to be edited so that part can say no for the public profile. Thanks to Seeme101 and thanks again to you John!