FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Getting a value at different templates
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Getting a value at different templates [message #3649] Tue, 02 July 2002 21:14 Go to next message
smike is currently offline  smike   Germany
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #3655 is a reply to message #3651] Tue, 02 July 2002 21:24 Go to previous messageGo to next message
smike is currently offline  smike   Germany
Messages: 182
Registered: April 2002
Location: Munich/Germany
Karma: 0
Senior Member
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?

Re: Getting a value at different templates [message #3658 is a reply to message #3655] Tue, 02 July 2002 21:29 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
smike is currently offline  smike   Germany
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! Razz

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! Very Happy

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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
smike is currently offline  smike   Germany
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 Go to previous message
Ilia is currently offline  Ilia   Canada
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fud <-> email gateway
Next Topic: Current Time
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 22:27:12 GMT 2024

Total time taken to generate the page: 0.02908 seconds