2017-01-23, 07:10 PM
(This post was last modified: 2017-01-23, 07:14 PM by thelovelyone.)
Hello there,
always wanted to add a custom profile field to the show team page? This is how you do it.
In this example we add the "location" field to the forum team page.
1. A core edit (using filezilla for example)
Open showteam.php and on line 173, find:
Below that, add:
Save and upload.
2. Figure out the custom profile field ID
Go to AdminCP -> Configuration -> Custom Profile fields -> Click on the Custom Profile Field you want to add ->
At the end of the url, you'll see 'fidx', x is the number u need.
Since we took 'Location' as tutorial example, Location got fid1.
3. Editing showteam templates
Go to AdminCP -> Templates & Style -> Templates -> Your Template -> Show Forum Team Template
Open showteam_usergroup and change colspan="4" to colspan="5"
Then find
Add below (Of course you give the name of your custom profile field, if you aren't adding the Location)
Save the template.
3.2 Editing showteam templates
Open showteam_usergroup_user
Find
Add below (Here you use the fid1 we found before, so change it to your fid, if you aren't adding the location)
Save and Done! : )
Since Location names can be long, i'd also recommend to reduce the width of the username. For that just change the 75% to 50%.
Then you could increase the width of Location, so e.g. from 15% to 25%, whatever. Edit it to your needs.
Demo:
Another useful tutorial
Avatar on ShowTeam page
always wanted to add a custom profile field to the show team page? This is how you do it.
In this example we add the "location" field to the forum team page.
1. A core edit (using filezilla for example)
Open showteam.php and on line 173, find:
$bgcolor = alt_trow();
Below that, add:
// Fetch custom profile fields
$query = $db->query("
SELECT *
FROM ".TABLE_PREFIX."userfields
WHERE ufid='".$user['uid']."'");
$profilefields = $db->fetch_array($query);
Save and upload.
2. Figure out the custom profile field ID
Go to AdminCP -> Configuration -> Custom Profile fields -> Click on the Custom Profile Field you want to add ->
At the end of the url, you'll see 'fidx', x is the number u need.
Since we took 'Location' as tutorial example, Location got fid1.
3. Editing showteam templates
Go to AdminCP -> Templates & Style -> Templates -> Your Template -> Show Forum Team Template
Open showteam_usergroup and change colspan="4" to colspan="5"
Then find
<td class="tcat"><span class="smalltext"><strong>{$lang->pm}</strong></span></td>
Add below (Of course you give the name of your custom profile field, if you aren't adding the Location)
<td class="tcat"><span class="smalltext"><strong>Location</strong></span></td>
Save the template.
3.2 Editing showteam templates
Open showteam_usergroup_user
Find
<td width="5%" class="{$bgcolor}"><div class="postbit_buttons">{$pmcode}</div></td>
Add below (Here you use the fid1 we found before, so change it to your fid, if you aren't adding the location)
<td width="15%" class="{$bgcolor}"><div class="postbit_buttons">{$profilefields['fid1']}</div></td>
Save and Done! : )
Since Location names can be long, i'd also recommend to reduce the width of the username. For that just change the 75% to 50%.
Then you could increase the width of Location, so e.g. from 15% to 25%, whatever. Edit it to your needs.
Demo:
Another useful tutorial
Avatar on ShowTeam page