Advertisement:

Author Topic: [Tip] Adding A Biography Section To A Users Profile  (Read 41480 times)

Offline Alan S

  • Sophist Member
  • *****
  • Posts: 1,250
  • Gender: Male
  • Monkey see Monkey do
[Tip] Adding A Biography Section To A Users Profile
« on: September 22, 2006, 06:10:58 PM »
Been working on this for most of the day. Adds a simple biography section to a users profile. BBC code is allowed in the biography section.

File = $themedir/languages/Profile.english.php

Find

Code: [Select]
$txt[80] = 'You are not allowed to change this person's profile.';
Add on a new line

Code: [Select]
$txt['bionotice'] = 'BBC code is allowed in the biography box.';
$txt['bio'] = 'Biography';

File = $themedir/Profile.template.php

Find

Code: [Select]
// Can they add this member as a buddy?
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
echo '
&nbsp;&nbsp;<a href="', $scripturl, '?action=buddy;u=', $context['member']['id'], ';sesc=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';

echo '
</td>
</tr><tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr><tr>
<td><b>', $txt[231], ': </b></td>
<td>', $context['member']['gender']['name'], '</td>
</tr><tr>
<td><b>', $txt[420], ':</b></td>
<td>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/bdaycake.gif" width="40" alt="" />' : ''), '</td>
</tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
<td><b>', $txt['local_time'], ':</b></td>
<td>', $context['member']['local_time'], '</td>
</tr><tr>';

if (!empty($modSettings['userLanguage']))
echo '
<td><b>', $txt['smf225'], ':</b></td>
<td>', $context['member']['language'], '</td>
</tr><tr>';
     echo '
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr>';


Add After

Code: [Select]
//Show the box for the biography

    echo '
<td><b>Biography:</b></td>
<td>', parse_bbc($context['member']['options']['bio']), '</td>
</tr><tr>';

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



Find

Code: [Select]
// Website details.
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[83], ': </b><div class="smalltext">', $txt[598], '</div></td>
<td><input type="text" name="websiteTitle" size="50" value="', $context['member']['website']['title'], '" /></td>
</tr><tr>
<td width="40%"><b>', $txt[84], ': </b><div class="smalltext">', $txt[599], '</div></td>
<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>

Add After

Code: [Select]
; <td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
    </tr>

<td><b>Biography:</b> <div class="smalltext">', $txt['bionotice'], '</div></td> <td><textarea name="default_options[bio]" rows="7" cols="70">', @$context['member']['options']['bio'], '</textarea></td>

I'll most likely make it into mod form if enough people want it on there forum.

Preview Attached.

SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

Offline Zenigata

  • Jr. Member
  • **
  • Posts: 237
  • Gender: Male
    • Il sito di Zenigata
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #1 on: September 26, 2006, 03:45:48 PM »
Nice, thank you! Does this work in 1.0 or 1.1?


Thanks

Offline Alan S

  • Sophist Member
  • *****
  • Posts: 1,250
  • Gender: Male
  • Monkey see Monkey do
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #2 on: September 26, 2006, 04:08:49 PM »
I coded it for 1.1 but it should work on 1.0 aswell since not much has changed in the profile. The search code might be a bit different but it will still work.
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

Offline mersindost

  • SMF Hero
  • ******
  • Posts: 1,999
  • Gender: Male
  • Since 11 Years
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #3 on: October 22, 2007, 06:41:44 PM »
Thanks so Much.

This mod is working in 1.1.4  :-*

Edit: But  have problem  :(

8: Undefined index: bio
Dosya: /home/sitecom/domains/site.com/public_html/forum/Themes/default/languages/Who.turkish.php (eval?)
Satır: 297
« Last Edit: October 22, 2007, 06:44:36 PM by mersindost »
I Am Simple Machines Hero, Because I LOVE Simple Machines

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #4 on: November 14, 2007, 10:49:43 PM »
did you add it to the turkish language file as well as the english one?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"

Useful Links:
Online Manual!
How to Help us Help you   
Search
Settings Repair Tool
     

Offline mersindost

  • SMF Hero
  • ******
  • Posts: 1,999
  • Gender: Male
  • Since 11 Years
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #5 on: November 15, 2007, 05:16:50 AM »
Did you mean Profile.Turkish.php?

Yes, I added codes to the Profile.Turkish.php too.
I Am Simple Machines Hero, Because I LOVE Simple Machines

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #6 on: November 17, 2007, 06:53:13 PM »
I take this error:

Quote
Hoochie Coochie Man   15 Kasım 2007, 23:57:40 
 85.100.14.178     3d120b781e91d41587dd16021f82719c 
 http://www.istanblues.org/forum/index.php?action=profile;u=284 
8: Undefined index: bio
Dosya: /home/blues/public_html/forum/Themes/default/languages/Who.turkish.php (eval?)
Satır: 287
İnadına SMF 1.1.X

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #7 on: November 29, 2007, 05:08:55 PM »
Up
İnadına SMF 1.1.X

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #8 on: November 29, 2007, 10:47:30 PM »
you added

Code: [Select]
$txt['bionotice'] = 'BBC code is allowed in the biography box.';
$txt['bio'] = 'Biography';
?

to the turkish language file?  what abut turkish-utf8 if you use UTF8?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"

Useful Links:
Online Manual!
How to Help us Help you   
Search
Settings Repair Tool
     

Offline marinesct

  • Semi-Newbie
  • *
  • Posts: 59
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #9 on: November 29, 2007, 11:39:10 PM »
I had the same problem.  When you [add after] in the third step, make sure you don't have any extra ';' listed.  I found an extra ';' in my Forum Profile Information section and went in to delete it.

Since I had some confusion with how to place it, I coded it as below.  The ';' that was with the original code, should've been taken out.

Code: [Select]
// Website details.
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[83], ': </b><div class="smalltext">', $txt[598], '</div></td>
<td><input type="text" name="websiteTitle" size="50" value="', $context['member']['website']['title'], '" /></td>
</tr><tr>
<td width="40%"><b>', $txt[84], ': </b><div class="smalltext">', $txt[599], '</div></td>
<td><input type="text" name="websiteUrl" size="50" value="', $context['member']['website']['url'], '" /></td>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
            </tr><tr>
<td><b>Biography:</b> <div class="smalltext">', $txt['bionotice'], '</div></td>
<td><textarea name="default_options[bio]" rows="7" cols="70">', @$context['member']['options']['bio'], '</textarea></td>
</tr>';

After I fixed the problem, I hadnt had any errors...so far.

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #10 on: November 30, 2007, 07:17:01 AM »
you added

Code: [Select]
$txt['bionotice'] = 'BBC code is allowed in the biography box.';
$txt['bio'] = 'Biography';
?

to the turkish language file?  what abut turkish-utf8 if you use UTF8?

Yes I added it to "languages/Profile.turkish.php"
I'm not using "UTF8"
« Last Edit: November 30, 2007, 07:25:39 AM by HOOCHIE COOCHIE MAN »
İnadına SMF 1.1.X

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #11 on: November 30, 2007, 07:24:26 AM »
"marinesct" your conclusion is not solved my problem.
I'm still taking this error:

Quote
http://www.istanblues.org/forum/index.php?action=profile;u=341 
8: Undefined index: bio
File: /home/blues/public_html/forum/Themes/default/languages/Who.turkish.php (eval?)
Line: 305
« Last Edit: November 30, 2007, 07:26:39 AM by HOOCHIE COOCHIE MAN »
İnadına SMF 1.1.X

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #12 on: December 05, 2007, 03:30:57 PM »
I take this error:

Quote
Hoochie Coochie Man   15 Kasım 2007, 23:57:40 
 85.100.14.178     3d120b781e91d41587dd16021f82719c 
 http://www.istanblues.org/forum/index.php?action=profile;u=284 
8: Undefined index: bio
Dosya: /home/blues/public_html/forum/Themes/default/languages/Who.turkish.php (eval?)
Satır: 287



I solved my promlem myself..
Alan you must change this:
Code: [Select]
<td>', parse_bbc($context['member']['options']['bio']), '</td>
To that:
Code: [Select]
<td>', @$context['member']['options']['bio'], '</td>
and there is no error message again..
İnadına SMF 1.1.X

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #13 on: December 05, 2007, 05:05:10 PM »
without parse_bbc around it, any bbcode in a bio will appear as plaintext

the @ does not fix the error, it only suppresses it.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"

Useful Links:
Online Manual!
How to Help us Help you   
Search
Settings Repair Tool
     

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #14 on: December 05, 2007, 05:12:04 PM »
without parse_bbc around it, any bbcode in a bio will appear as plaintext

the @ does not fix the error, it only suppresses it.

Well, I don't know another way to disappear the error.
Show me if you know a way..

Beside, i don't need to BBC in bioagraphy anyway..
« Last Edit: December 05, 2007, 05:15:29 PM by Hoochie Coochie Man »
İnadına SMF 1.1.X

Offline BryanD

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,019
  • Gender: Male
    • BryanRunicDeakin on Facebook
    • @bryandeakin on Twitter
    • Bryan Deakin dot Com
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #15 on: December 15, 2007, 02:08:53 PM »
do you still require help?

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #16 on: December 15, 2007, 06:04:10 PM »
No thanks RunicWarrior
İnadına SMF 1.1.X

Offline badams

  • Semi-Newbie
  • *
  • Posts: 36
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #17 on: January 11, 2008, 01:50:51 PM »
I need help.....Getting same error as Hoochie with the exception that my error states Who.english.php and not Who.turkish.php....

Error:

8: Undefined index: bio
File: /Themes/default/languages/Who.english.php (eval?)
Line: 287

Running SMF 1.1.4

Any help would be appreciated.....




Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #18 on: January 11, 2008, 01:52:42 PM »
Same error..
Read this
İnadına SMF 1.1.X

Offline badams

  • Semi-Newbie
  • *
  • Posts: 36
Re: [Tip] Adding A Biography Section To A Users Profile
« Reply #19 on: January 11, 2008, 02:02:54 PM »
Thanks, Hoochie.  Problem is....I want to use BBC......

I'm trying to figure out why the error is specifying Who.english.php....or in your case Who.turkish.php.  Should something be added to this file?

Sorry, I'm a newbie here.....