News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Real Name MOD

Started by John Slater, June 15, 2005, 05:25:56 AM

Previous topic - Next topic

John Slater

Link to Mod

This is my second package, this time i have made a small little mod using a nice tutorial [Unknown] Brackets. This mod should give all credit to [Unknown] because it was his tutorial that helped me make tis. All i did was made it in Mod Form.

This MOD adds a text feild to your profile. The feild means you can add your real name in your profile. This will only show-up IF the person has entered their real name, so you dont get "Real Name:" with nothing following.

This mod also displays "Real Name:" in bold in your mini profile along side ever post. Once again this only shows if you have something in the field.

This is a small mod and is a small work up to a whole new section to my next mod. As well as the base to a mod i'm planning which displays a Skype Icon to your post.

I must stress that the mod works on the default theme. If you change to the classic YaBBSE theme you will not see "Real Name:" along side the posts, to make this work i suggest copying the display.template.php file accross to your Yabbse theme.

To uninstall the mod use your package manager. You must uninstall before deleting the mod from your server, if you dont then you will not be able to get rid of it without entering the files.

I have tested this on both of my forums both on different versions, would like to know if it works on the new Beta version and the older versions.

Made By: John Slater [thesimpsonsjohn]

If you have any problems please tell me.

Itch™

Works on 1.1 Beta 3 Public as well.

YM

toma

#2
Thanks for making this mod, it worked fine, one small request though. If you ever decide to enhance it, it would be appreciated to add support for languages as well

I think you just need to do some modifications to:
- index.language.php
- profile.language.php

(where language could be english, finnish, swedish etc.)

e.g. add this to both of the files
$txt['real_name'] = 'Real name: ';

And then instead of <td><b>Real Name: </b></td>
add <td><b>', $txt['real_name'], '</b></td> in profile.template.php and
echo '<b>', $txt['real_name'], '</b>', in the display.template.php

This way it would be a breese to upgrade it when a new version is available (for me that is  ;D )

Oh, one more small request, if you can get it added to the registration form as well it would be nice....


Cheers
Tom

Nostraddi

Hey John and all the others,

I have installed the package, too.

It works on the Beta fine, Thank you for this nice Mod.

I have updated it like "toma" ... in german this time.

But one thing...

I need the Field in the Registration Site ... how can I do this ?

By the way, a tool to customize the whole profile-fields would be a great thing... ! But much work !

Greets Nos !

toma

HI Nos,

I think I can help you with that, I'm definitely no PHP wizard I only use copy paste and common sense  :P

Let me tell you how I did it, and got it to work, some other can propably tell you how it really should be done ;)

I added quite a lot of stuff in the registration questionnaire and I also made it so that it shows on the Profile Summary page and so that you can edit those in Forum Profile Information in your personal profile. My forum is in 3 languages Finnish Swedish and English

If you just need to get the Real Name into the registration questionnaire it is easy. I assume you have used the default template in my example.

Open and edit Register.template.php
I added the real name field after the Choose username field

Search for
<td width="40%">
<b>', $txt[98], ':</b>
<div class="smalltext">', $txt[520], '</div>
</td>
<td>
<input type="text" name="user" size="30" maxlength="30" />
</td>


Add the following after this (or in some other place of your choosing):

<tr>
<td width="40%">
<b>', $txt['firstname_lastname'], ': </b>
<div class="smalltext">', $txt['real_name_explanation'], '</div>
</td>
<td>
<input type="text" name="default_options[profile_real_name]" size="30" value="', isset($context['member']['default_options']['profile_real_name']) ?
$context['member']['default_options']['profile_real_name'] : '', '" />
</td>
</tr>


You also need to add the following to the Login_xxx.php language file (in the languages folder) where xxx is the languages you support:
e.g. open Login.english.php and add:


//Real name mod
$txt['real_name'] = 'Real name: ';
$txt['real_name_explanation] = 'Please tell us your real name, in this forum we present ourselves with our real names';


Or any other text you think is suitable for your site.

I added a lot of stuff in my registration and by following the same pattern you can add whatever you like in there as well. Just remember to add the new stuff to the Profile.template.php and the appropriate language files as well

The result of my "adds" look like this





You need to add the it in two places in the Profile.template.php. One to show the fields in the summary and the other to be able to change it in the Forum profile information. If you need more info on that I'm happy to help.

Cheers
Toma

mennou

how u add the hobby thing?

Nostraddi

Hi mennou,

thx for your post, nice.

But it wont work.

Ive searched for the code, found it, copied the register code under the searched code. saved.
done the whole thing again with the login_german.php. saved.

reoad the webpage and got a "template parse error".

The RealName Mod is present and working.

Any Idea?

Greets Nos!

toma

#7
Ni Nos and Mennou,

If you like, you can download all the templates i changed and the English language files from here
http://www.ilmailu.org/templates.zip

I did some additional modifications to them last night as I wanted not to show any of te additional fields in the summary if the user had opted not to fill in anything in them.

Let me know if it worked out, if not, I'll try to explain in more detail what I did.

PS I also got some template parse error during the alteration and the reason for that was a dot where there was supposed to be a comma...  ::)

Nostraddi

Hey,

thx for your templates, that should be a great idea, i will try now !

My Prob in the case of this template parse error is that there is no php output why there is a prob...

php out like "stands "." where "," required" - like yours...

thank you..i will reply...(sorry for the bad english, came from work after 20 hours of night work...)

Nos!

toma

Hi Nos,

Yeah I did not have any output either, but I just figured out what was wrong with the tedious trial and error method  ;)

Hope the templates work out for you, I have always found it easier to modify something already existing (and working) than do it from scratch, there is always a typo or two that screws things up  :D

Cheers
Toma

Nostraddi

Hey,

wented to france and spain...

will tell you when i was able to try !!

greets nos!

drgnfireinferno

I'm getting an error when I try installing the mod.
SMF Version: 1.1.1
Installed Mods: http://i23.photobucket.com/albums/b358/drgnfireinferno/mods.jpg
the currently uninstalled ones are the ones that are giving me errors.

Error Message:
1.     Execute Modification     ./Themes/default/Profile.template.php     Test successful
2.    Execute Modification    ./Themes/default/Display.template.php    Test failed

"How to beat yourself up, and make it look like a sporting accident too."

Brenda

Is this compatible with 1.1.4

totoy

Quote from: toma on August 17, 2005, 06:07:02 AM

You need to add the it in two places in the Profile.template.php. One to show the fields in the summary and the other to be able to change it in the Forum profile information. If you need more info on that I'm happy to help.

Cheers
Toma

What do you mean by this? can u show us how to do it pls, i have limited knowledge in coding.

thanks in advance.




Black_Paolo

Sorry I've i question...I wanted do a mod like this, something like this... But my personal question is: "the name where is saved?"
In the database? Where?
I'm an Italian boy, so I don't speak English very well.
If there are any errors in my post, please let me know, so I (hopefully) won't do it again :D

smj.terry

Hi!

My question is: I am trying to change the "Greeter" under a member's name to "Global Moderator" along with 5 starts and I can't seem to get "Greeter" removed.

Thank You for any help in this matter, I appreciate it.

Terry

Advertisement: