Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: RGSMDNR on October 02, 2004, 11:16:24 AM

Title: adding additional info in user profiles
Post by: RGSMDNR on October 02, 2004, 11:16:24 AM
I run a car based forum and thouhgt it would be neat if a user can display their track times/horse power numbers under their avatar or something,

any thoughts?
Title: Re: adding additional info in user profiles
Post by: Metho on October 02, 2004, 01:45:10 PM
You can add custom fields to the profile yourself if you follow [Unknown]'s tutorial, which is located at http://unknown.network32.net/tutorial.smf_customize-profile

And try not to post feature/modification requests in this board, it's for completed tips and tricks.

If you need help, just ask. :)

- Methonis
Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 02, 2004, 04:58:35 PM
great thanks..

;)

Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 02, 2004, 05:16:00 PM
ok well what i am trying to do is add the following,

Horsepower (enter it in the profile and display under the avatar)
Torque (enter it in the profile and display under the avatar)
Track time (enter it in the profile and display under the avatar)

this is what i have so far... not too sure why it says < br and all that..

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.darkhorses.ca%2Fimages%2F1.jpg&hash=f9c4920e38a75fc3e5350d70ec46aeeb5efcaaea)

here is what displays under the avatar
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.darkhorses.ca%2Fimages%2F2.jpg&hash=f1a644b9d5c13aba753c4e598eea48b903a8fbdd)
Title: Re: adding additional info in user profiles
Post by: Metho on October 02, 2004, 08:02:36 PM
Could you post the code you added to the files, along with a few lines above and below the added code? Looks like you have some ' out of place or something.

- Methonis
Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 02, 2004, 08:06:46 PM
Here is the display.template.php


//Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
', $message['member']['blurb'], '<br />
<br />';
                  // Show HorsePower number.
echo '
', $txt[2000], ': ', $message['member']['hpower'], '<br />
<br />';
// Show Torque number.
echo '
', $txt[2001], ': ', $message['member']['ftorque'], '<br />
<br />';

// Show track time.
echo '
', $txt[2002], ': ', $message['member']['ttime'], '<br />
<br />';



// This shows the popular messaging icons.
echo '
', $message['member']['icq']['link'], '
', $message['member']['msn']['link'], '
', $message['member']['aim']['link'], '
', $message['member']['yim']['link'], '<br />';


here is the profile.template.php

// Gender, birthdate and location.
echo '
<tr>
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" />
</td>
</tr><tr>
<td width="40%"><b>', $txt[227], ': </b></td>
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
<td>
<select name="gender" size="1">
<option value="0"></option>
<option value="1"', ($context['member']['gender']['name'] == 'm' ? ' selected="selected"' : ''), '>', $txt[238], '</option>
<option value="2"', ($context['member']['gender']['name'] == 'f' ? ' selected="selected"' : ''), '>', $txt[239], '</option>
</select>
</td>
</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';
// Horse power, torque Track times.
echo '
<tr>
<td width="40%">
<b>', $txt[780], ':</b>

</td>
<td class="smalltext">
<input type="text" name="HORSEPOWER" size="6" maxlength="6" value="', $context['member']['hpower'], '" /> HP @
<input type="text" name="HPRPM" size="4" maxlength="4" value="', $context['member']['hprpm1'], '" /> RPM
</tr></td>
<tr>
<td width="40%">
<b>', $txt[781], ':</b>
<td class="smalltext">
<b>', $txt[782], ':</b>

</td>
<td class="smalltext">
<input type="text" name="TRACKTIME" size="5" maxlength="5" value="', $context['member']['ttime'], '" /> sec
<input type="text" name="TRACKSPEED" size="6" maxlength="6" value="', $context['member']['tspeed'], '" /> MPH
</td>

</tr>
<tr>


</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';


// All the messenger type contact info.

Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 02, 2004, 09:46:03 PM
any thoughts?
Title: Re: adding additional info in user profiles
Post by: [Unknown] on October 02, 2004, 11:20:09 PM
As described in my tutorial, you need to check the value more throughly...



//Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
', $message['member']['blurb'], '<br />
<br />';
// Show HorsePower number.
echo '
', $txt[2000], ': ', empty($message['member']['hpower']) ? '' : $message['member']['hpower'], '<br />
<br />';
// Show Torque number.
echo '
', $txt[2001], ': ', empty($message['member']['ftorque']) ? '' : $message['member']['ftorque'], '<br />
<br />';

// Show track time.
echo '
', $txt[2002], ': ', empty($message['member']['ttime']) ? '' : $message['member']['ttime'], '<br />
<br />';



// This shows the popular messaging icons.
echo '
', $message['member']['icq']['link'], '
', $message['member']['msn']['link'], '
', $message['member']['aim']['link'], '
', $message['member']['yim']['link'], '<br />';


here is the profile.template.php

// Gender, birthdate and location.
echo '
<tr>
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" />
</td>
</tr><tr>
<td width="40%"><b>', $txt[227], ': </b></td>
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
<td>
<select name="gender" size="1">
<option value="0"></option>
<option value="1"', ($context['member']['gender']['name'] == 'm' ? ' selected="selected"' : ''), '>', $txt[238], '</option>
<option value="2"', ($context['member']['gender']['name'] == 'f' ? ' selected="selected"' : ''), '>', $txt[239], '</option>
</select>
</td>
</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';
// Horse power, torque Track times.
echo '
<tr>
<td width="40%">
<b>', $txt[780], ':</b>

</td>
<td class="smalltext">
<input type="text" name="default_options[hpower]" size="6" maxlength="6" value="', empty($context['member']['hpower']) ? '' : $context['member']['hpower'], '" /> HP @
<input type="text" name="default_options[hprpm1]" size="4" maxlength="4" value="', empty($context['member']['hprpm1']) ? '' : $context['member']['hprpm1'], '" /> RPM
</tr></td>
<tr>
<td width="40%">
<b>', $txt[781], ':</b>
<td class="smalltext">
<b>', $txt[782], ':</b>

</td>
<td class="smalltext">
<input type="text" name="default_options[ttime]" size="5" maxlength="5" value="', empty($context['member']['ttime']) ? '' : $context['member']['ttime'], '" /> sec
<input type="text" name="default_options[tspeed]" size="6" maxlength="6" value="', empty($context['member']['tspeed']) ? '' : $context['member']['tspeed'], '" /> MPH
</td>

</tr>
<tr>


</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';


// All the messenger type contact info.



-[Unknown]
Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 03, 2004, 01:26:46 PM
ok now it looks right but wont save when you hit update info or whatever...
Title: Re: adding additional info in user profiles
Post by: [Unknown] on October 03, 2004, 04:37:10 PM
Sorry, change ['member']['hpower'] (etc.) to ['member']['options']['hpower'].... in both.

-[Unknown]
Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 03, 2004, 04:48:12 PM
still wont save in the profile or show up under the avatar...

HP
TQ
Track time shows up fine.. but it wont show the numbers..

Title: Re: adding additional info in user profiles
Post by: [Unknown] on October 03, 2004, 04:51:59 PM
Display:


//Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
', $message['member']['blurb'], '<br />
<br />';

// Show HorsePower number.
echo '
', $txt[2000], ': ', empty($message['member']['options']['hpower']) ? '' : $message['member']['options']['hpower'], '<br />
<br />';
// Show Torque number.
echo '
', $txt[2001], ': ', empty($message['member']['options']['ftorque']) ? '' : $message['member']['options']['ftorque'], '<br />
<br />';

// Show track time.
echo '
', $txt[2002], ': ', empty($message['member']['options']['ttime']) ? '' : $message['member']['options']['ttime'], '<br />
<br />';



// This shows the popular messaging icons.
echo '
', $message['member']['icq']['link'], '
', $message['member']['msn']['link'], '
', $message['member']['aim']['link'], '
', $message['member']['yim']['link'], '<br />';


Profile:

// Gender, birthdate and location.
echo '
<tr>
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" />
</td>
</tr><tr>
<td width="40%"><b>', $txt[227], ': </b></td>
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
<td>
<select name="gender" size="1">
<option value="0"></option>
<option value="1"', ($context['member']['gender']['name'] == 'm' ? ' selected="selected"' : ''), '>', $txt[238], '</option>
<option value="2"', ($context['member']['gender']['name'] == 'f' ? ' selected="selected"' : ''), '>', $txt[239], '</option>
</select>
</td>
</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';
// Horse power, torque Track times.
echo '
<tr>
<td width="40%">
<b>', $txt[780], ':</b>

</td>
<td class="smalltext">
<input type="text" name="default_options[hpower]" size="6" maxlength="6" value="', empty($context['member']['options']['hpower']) ? '' : $context['member']['options']['hpower'], '" /> HP @
<input type="text" name="default_options[hprpm1]" size="4" maxlength="4" value="', empty($context['member']['options']['hprpm1']) ? '' : $context['member']['options']['hprpm1'], '" /> RPM
</tr></td>
<tr>
<td width="40%">
<b>', $txt[781], ':</b>
<td class="smalltext">
<b>', $txt[782], ':</b>

</td>
<td class="smalltext">
<input type="text" name="default_options[ttime]" size="5" maxlength="5" value="', empty($context['member']['options']['ttime']) ? '' : $context['member']['options']['ttime'], '" /> sec
<input type="text" name="default_options[tspeed]" size="6" maxlength="6" value="', empty($context['member']['options']['tspeed']) ? '' : $context['member']['options']['tspeed'], '" /> MPH
</td>

</tr>
<tr>


</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';


// All the messenger type contact info.


-[Unknown]
Title: Re: adding additional info in user profiles
Post by: RGSMDNR on October 03, 2004, 05:04:32 PM
my bad.. missed a few..

works perfect.. thanks so much!!