trofaste
New Member
Never deprive someone of hope; it might be all they have. — H. Jackson Brown, Jr.
Posts: 112
inherit
242415
0
Feb 27, 2017 5:43:57 GMT -8
trofaste
Never deprive someone of hope; it might be all they have. — H. Jackson Brown, Jr.
112
February 2017
trofaste
|
Post by trofaste on Apr 22, 2017 11:51:00 GMT -8
I would like to modify the user profile and mini profile templates to include the current time for the user based on their timezone beneath the post count, but I'm not sure how to go about it. Does anyone know how this could be done?
Thanks in advance, Trofaste
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 22, 2017 12:09:02 GMT -8
There's no template variable for timezone / time display that would appear in the user and mini profile display areas so this would not be possible through templates alone. It's conceivable that a plugin or H/F code in conjunction with a template modification would accomplish this, so I'd pop on over to the Plugin Request Board and see if it can be done. (:
|
|
trofaste
New Member
Never deprive someone of hope; it might be all they have. — H. Jackson Brown, Jr.
Posts: 112
inherit
242415
0
Feb 27, 2017 5:43:57 GMT -8
trofaste
Never deprive someone of hope; it might be all they have. — H. Jackson Brown, Jr.
112
February 2017
trofaste
|
Post by trofaste on Apr 22, 2017 12:49:15 GMT -8
Thank you!
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 22, 2017 12:55:49 GMT -8
|
|
Former Member
inherit
guest@proboards.com
225992
0
Nov 28, 2024 15:27:17 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 22, 2017 14:45:52 GMT -8
The proboards API does show you what timezone you have selected but it's not ideal
proboards.dataHash.timezone Will return either "1.00" but does not state if its - or + to my knowledge, regardless it super hard to create a timestamp based on this information, javascript Date object is not exactly kind.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 22, 2017 15:22:51 GMT -8
The proboards API does show you what timezone you have selected but it's not ideal proboards.dataHash.timezone Will return either "1.00" but does not state if its - or + to my knowledge, regardless it super hard to create a timestamp based on this information, javascript Date object is not exactly kind. It's not really a template mod though, it's not available as a variable.
|
|
Former Member
inherit
guest@proboards.com
225992
0
Nov 28, 2024 15:27:17 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 22, 2017 15:28:05 GMT -8
No No, you couldn't do it in the templates. You could do it in javascript, but its SUPER hard and I have not come up with a solution yet, at least not with the data provided by the API.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 22, 2017 15:49:35 GMT -8
No No, you couldn't do it in the templates. You could do it in javascript, but its SUPER hard and I have not come up with a solution yet, at least not with the data provided by the API. Fair, fair. Admittedly out of my wheelhouse w/ regards to js and plugins for the most part, haha. Would it be possible to create a plugin that doesn't necessarily work off the the PB set time zone, but have a user input a timezone manually that will display in the profile? EG: perhaps a custom profile field that states their time zone and a plugin converts that to whatever time. (I'm just throwing ideas out there, no idea if it'd actually work / if its possible)
|
|
Former Member
inherit
guest@proboards.com
225992
0
Nov 28, 2024 15:27:17 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 22, 2017 15:54:35 GMT -8
throwing me under the bus Kami :) hahaha nawh I'm tesing, yeah that could work. How did my last plugin work out for you ? lol -all requirements meet btw :P
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 22, 2017 15:55:55 GMT -8
throwing me under the bus Kami :) hahaha nawh I'm tesing, yeah that could work. How did my last plugin work out for you ? lol -all requirements meet btw :P :D it would be cool if it works haha (and the plugin is great!! sorry i forgot to get back to you i started a new job)
|
|
Former Member
inherit
guest@proboards.com
225992
0
Nov 28, 2024 15:27:17 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 22, 2017 16:03:58 GMT -8
Hey now, my mom tests all my plugins hahaha(teasing) Aww that's cool you got a new job {hifives} I was wondering why Kami was not putting her foot down here alot lately :) haha
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Apr 23, 2017 9:58:06 GMT -8
The proboards.dataHash.timezone is indeed a negative or positive value giving the difference in hours from Greenwich time. Someone living in US Central timezone would have a value of "-6.00" (or "-5.00" if DST adjusted). I recall this particular request for having the user's timezone displayed in their mini-profile under the V4 platform as having some privacy issues, some may simply not want their general location be known so there was a code implemented as an opt-in meaning the user had to flip that switch before everyone else could see their timezone (sorta like the birthday option is now).
|
|