Getting a value at different templates [message #3649] |
Tue, 02 July 2002 21:14 |
smike
Messages: 182 Registered: April 2002 Location: Munich/Germany
Karma: 0
|
Senior Member |
|
|
I saw at the register.tmpl that {VAR: reg_name} is used for the username.
If I add this value to the drawmsg.tmpl I only receive an empty entry.
Can anybody tell me, what to do, that the content of this variable would be shown?
Thanks, Mike
[Updated on: Tue, 02 July 2002 21:15] Report message to a moderator
|
|
|
Re: Getting a value at different templates [message #3651 is a reply to message #3649] |
Tue, 02 July 2002 21:18 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
sMike wrote on Tue, 02 July 2002 17:14 | I saw at the register.tmpl that {VAR: reg_name} is used for the username.
If I add this value to the drawmsg.tmpl I only receive an empty entry.
Can anybody tell me, what to do, that the content of this variable would be shown?
Thanks, Mike
|
{VAR: user_login} will display the login of the user.
FUDforum Core Developer
|
|
|
|
Re: Getting a value at different templates [message #3658 is a reply to message #3655] |
Tue, 02 July 2002 21:29 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
sMike wrote on Tue, 02 July 2002 17:24 |
prottoss wrote on Die, 02 Juli 2002 23:18 | {VAR: user_login} will display the login of the user.
|
Thanks for your answer, but what I needed was the real-name, not the login-name.
Is it right, that the real-name would also be stored in such a variable?
|
Realname is more complex, heh
{VAR-HTML: GLOBALS['usr']->name}
FUDforum Core Developer
|
|
|
Re: Getting a value at different templates [message #3660 is a reply to message #3658] |
Tue, 02 July 2002 21:40 |
smike
Messages: 182 Registered: April 2002 Location: Munich/Germany
Karma: 0
|
Senior Member |
|
|
prottoss wrote on Die, 02 Juli 2002 23:29 | Realname is more complex, heh
{VAR-HTML: GLOBALS['usr']->name}
|
You made me real laughing, right now!
English is such a nice language, if you can speak it the right way!
You told me exact that, what I asked you for, but unlucky this wasn't what I meant.
Ok, now I try doing it in a more detailed way.
I told you, that I'm editing the drawmsg.tmpl.
All I want to do is put the real-name of the person who wrote a message below his login-name.
At the moment the table data looks something like this:
<td valign="middle" class="GenText">{TEMPLATE-DATA: user_link}<br>{VAR-HTML: GLOBALS['usr']->name}<br>{TEMPLATE-DATA: level_name}{TEMPLATE-DATA: level_image}</td>
The red part was added by me.
Very nice, but now every message was written by me!
Can you help me a last time?
|
|
|
Re: Getting a value at different templates [message #3661 is a reply to message #3660] |
Tue, 02 July 2002 21:45 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Well, what you are trying to do is a little more complex.
You need to modify the PHP source code to select the real name of the author besides just their login name.
In order to do this, you'll need to edit 1 BIG query inside msg.php & tree.php which selects the message data and make it grab the 'name' field from the users table.
Once you make that change, then the realname can be echoed as:
{VAR-HTML: obj->name}
FUDforum Core Developer
|
|
|
Re: Getting a value at different templates [message #3664 is a reply to message #3661] |
Tue, 02 July 2002 21:49 |
smike
Messages: 182 Registered: April 2002 Location: Munich/Germany
Karma: 0
|
Senior Member |
|
|
Are there any parallel queries, where I could try to understand how they work, and then try to learn and modify it step by step?
Update:
Oh oh, I looked at the mentioned files and I think this would be hard work, but I'll try it.
I hope, it wouldn't be to annoying to you (not only prottoss) if I ask sometimes anything about php.
[Updated on: Tue, 02 July 2002 22:07] Report message to a moderator
|
|
|
Re: Getting a value at different templates [message #3665 is a reply to message #3664] |
Tue, 02 July 2002 22:09 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Hm... dunno..
The change is actually pretty simple, you are only telling the query to select 1 more field.
You can literarly copy the line which selects the login and replace the login with name.
FUDforum Core Developer
|
|
|