inherit
208996
0
Aug 21, 2024 19:31:57 GMT -8
Slain
32
May 2014
greystar
|
Post by Slain on Aug 28, 2015 17:24:44 GMT -8
It's been irritating me for so long xD I've tried moving codes and everything. Nothing is working. Is there anyway to do this so I can add the current username and avatar into the header for some forum modifications?
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Aug 29, 2015 10:57:28 GMT -8
It's been irritating me for so long xD I've tried moving codes and everything. Nothing is working. Is there anyway to do this so I can add the current username and avatar into the header for some forum modifications? Hi, $[current_user.name] $[current_user.avatar] those will show the current users Displayname & their Avatar. you can also grab these using Javascript as well. proboards.data("user").name proboards.data("user").avatar those should work.
|
|
inherit
208996
0
Aug 21, 2024 19:31:57 GMT -8
Slain
32
May 2014
greystar
|
Post by Slain on Aug 29, 2015 19:26:18 GMT -8
It's been irritating me for so long xD I've tried moving codes and everything. Nothing is working. Is there anyway to do this so I can add the current username and avatar into the header for some forum modifications? Hi, $[current_user.name] $[current_user.avatar] those will show the current users Displayname & their Avatar. you can also grab these using Javascript as well. proboards.data("user").name.value proboards.data("user").avatar.value those should work. I've tried using these: $[current_user.name]
$[current_user.avatar]
It just showed the code and no username etc.. I can try using the java. I'll edit this and tag you if I find something. EDIT: ®i©hie none of the codes have really worked. I tried setting it as a script value and it still won't work(at least the code won't show 8'D) Any suggestions/code edits?
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 29, 2015 19:37:11 GMT -8
Hi, Slain. Where did you try using the $[current_user.name] and $[current_user.avatar]? Those are template variables and can only be used in templates that they are available in. Do you have a mock-up of where, exactly, you want these to show?
|
|
inherit
208996
0
Aug 21, 2024 19:31:57 GMT -8
Slain
32
May 2014
greystar
|
Post by Slain on Aug 30, 2015 13:25:55 GMT -8
In the Global Forum header. I've tried using the codes there and it's not working. Not sure exactly where in the CSS layout the header is if that's what your saying for template variables Lynx.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 30, 2015 13:36:25 GMT -8
Yeah, template variables don't work in headers or footers - just in templates. I've managed to get an avatar and name of the current user on my CGI forum. It's on the left, but should be placeable with some CSS. Is that what you're looking for, or am I misunderstanding?
|
|
inherit
222898
0
Jan 13, 2017 12:58:34 GMT -8
Autumn
166
July 2015
exoticstarlight
|
Post by Autumn on Aug 30, 2015 14:18:07 GMT -8
Hi, as ®i©hie stated, you can use the following to display names or avatars. $[current_user.name] $[current_user.avatar] proboards.data("user").name.value proboards.data("user").avatar.value If those don't work, then we'll have to wait for a response from a proboards administrator that could know about this problem, so for now good luck.
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Aug 31, 2015 14:08:00 GMT -8
Slain if you can prvide some kind of mock-up or visual example of how you want it shown, someone can write it up for you. EDIT: here's a quick little write up: <script type="text/javascript"> <!-- var cuser=proboards.data("user").name; var cavatar=proboards.data("user").avatar; document.wtite('Hello '+cuser+', Welcome Back! '+cavatar+' '); --> </script> which will show like this: also i messed up on the js variables you don't need .value at the end.
|
|
inherit
208996
0
Aug 21, 2024 19:31:57 GMT -8
Slain
32
May 2014
greystar
|
Post by Slain on Sept 5, 2015 20:10:13 GMT -8
I actually just moved everything into the Templates. Works great now ^^ Thank you so much guys!
|
|