Topic: Using member_profile and account_home for an affiliate link (2.5.3)
A special thanks to vlad for helping me solve this issue.


There are times I will want to use a custom field to put a download link, instructions, etc, in the members profile. The following project explains how I accomplished this.
---------------------------------------------
Create your custom filed in your CP
---------------------------------------------
1. CP
2. Settings
3. Custom Fields
4. Add Group
I created a group called Ebook. The group label is request. All group settings were set to NO except for "Load in account profile" = Yes and "Load in public profile" = Yes
Please note that since fields are not needed for this project, do NOT add any fields to the Group.
------------------------
Coding Templates
------------------------
Since the above Group called Ebook is set to load in the account profile and public profile, I coded the following templates.
FIRST I WILL CODE MEMBER_PROFILE.TPL
OPEN: member_profile.tpl
FIND: <dl class="datainfo"> (in 2.5.3 there are two instances of this coding -- you want the 2nd one)
AFTER ADD:
<!-- IF group_label == "request" -->
Here you put your html, links or content.
<!-- ENDIF -->
NOTE: In the above, the label "request" is used in the coding. Whatever label name you assign to your Group name when you created the group in your CP, you would use that label name.
Now I need to Style the Group Name Ebook so it stands out from the other Group Names
As you can see in the above image, I make the group name Ebook blue, bold and a larger font. Here is how I did it.
OPEN: member_profile.tpl
FIND: <!-- BEGIN profile_groups --> (in 2.5.3 there are two instances of this coding -- you want the 1st one)
AFTER <!-- BEGIN profile_groups -->: you will see the <li> tag. In 2.5.3 it looks like this:
<li><a href="javascript:void(0)" id="profile_data_{rowcnt}_tab" onclick="switch_tabs('profile_data', {rowcnt})">{group_name}</a></li>
CHANGE: I will use inline css to style the group name so Ebook is in blue and the font is larger. Below is what the above coding will look like after I made the inline CSS changes:
<li><a href="javascript:void(0)" id="profile_data_{rowcnt}_tab" onclick="switch_tabs('profile_data', {rowcnt})"<!-- IF group_label == "request" -->style="font-size:18px; font-weight: bolder; color: #3300FF;"<!-- ENDIF -->>{group_name}</a></li>
NOTE: In the above code, the code in red is the coding I added. Again note that the label name in the above is "request" You need to change it to whatever label you used for your Group Name.
NOW I WILL CODE ACCOUNT_HOME.TPL
Coding account_home.tpl is just like member_profile.tpl. Below is the steps.
OPEN: account_home.tpl
FIND: <dl class="datainfo"> (in 2.5.3 there are two instances of this coding -- you want the 2nd one)
AFTER ADD:
<!-- IF group_label == "request" -->
Here you put your html, links or content.
<!-- ENDIF -->
Now I need to Style the Group Name Ebook so it stands out from the other Group Names
OPEN: account_home.tpl
FIND: <!-- BEGIN profile_groups --> (in 2.5.3 there are two instances of this coding -- you want the 1st one)
AFTER <!-- BEGIN profile_groups -->: you will see the <li> tag. In 2.5.3 it looks like this:
<li><a href="javascript:void(0)" id="profile_data_{rowcnt}_tab" onclick="switch_tabs('profile_data', {rowcnt})">{group_name}</a></li>
CHANGE: I will use inline css to stype the group name. Here is what the above coding will look like with inline CSS:
<li><a href="javascript:void(0)" id="profile_data_{rowcnt}_tab" onclick="switch_tabs('profile_data', {rowcnt})"<!-- IF group_label == "request" -->style="font-size:18px; font-weight: bolder; color: #3300FF;"<!-- ENDIF -->>{group_name}</a></li>
THAT'S IT. YOU CAN PUT WHATEVER YOU WANT. I USED IT FOR AN AFFILIATE LINK, BUT YOU COULD USE IT TO PUT A MESSAGE FROM THE ADMIN, A TABLE OF IMPORTANT LINKS, ETC.
Last edited by db3204 (2010-12-15 15:37:19)