Using variables in templates?

FrozenX at 09h28
29
Oct
2011
On PunBB, what code is it, so that i can add,
Code:
Welcome { USERNAME }


I know that
Code:
{ USERNAME }
works, but i doesn't work outside, the posts... e.g. in the overall_Header, it didnt seem to be working.

any suggestions, on what it could be?

1 Raizen, on 29/10/2011 at 09h47
i have notice that the code
Code:
{ USERNAME }
has a space try it without space ... Wink
2 FrozenX, on 29/10/2011 at 10h28
I know that, but in this forums if i remove the sapce it does this:

Code:
Using php in posts is called being a smart [Language]... Stop it


thats why to show the code i did it like this:

Code:
{ USERNAME }
3 Drogba921, on 29/10/2011 at 15h47
I think that forumotion removed those codes.
4 Nera., on 29/10/2011 at 22h53
Hi,

They are not removed. They have never worked in templates.

For the space that you must add to write it here it's cause those variables have been censored on the support forum.

If you want them to work in templates you can use Etanas tut from the French forum.
http://forum.forumactif.com/t260631-astuce-utiliser-les-variables-user-et-forum-autre

All you need to do is take the script showed there http://tinyurl.com/var-fa and add it to your JS managment. Mark all pages.

Than you can use the variables she listed in the tutorial and they will work like the default ones forumotion offers.



5 FrozenX, on 30/10/2011 at 12h43
Thanks, solved + i also found out that {LOGGED_AS} works. Smile

Code:
{LOGGED_AS}
6 Nera., on 30/10/2011 at 17h41
It works if you use it in templates since it's the templates variable (the one that's already there).

Welcome.

Lock
Similar topics
Hi all, With the recent induction of the Footer links, were able to add our own links, but I'd like to use our shortened forum's URL & some of our 'site....' variables within it. For example, to "Donate" to the forum (For those who
I think that we need a few more variables. Possibly a "{userpoints}", "{userrep}", and so on. A variable that would show how many points a member has would be VERY handy for point shops, and whatnots. Edit: I've come up with a coupl
How do you put the PHP Variables in the templates to make them show up?
Replies 1 to 6 on 6 for "Using variables in templates?"
See also
more_less
Informations

6 Replies For the topic :
"Using variables in templates?"

This topic has been viewed 814 times.

Last message :
29/10/2011 at 09h28 by "FrozenX"