Help: Change Forum Style according to time

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Suggested Hosts
User avatar
Dream_Surfer
Registered User
Posts: 6
Joined: Wed Jan 23, 2019 7:13 pm
Name: Chico .
Contact:

Help: Change Forum Style according to time

Post by Dream_Surfer »

Greetings from Brazil! ;)
It's a pleasure to enter in PHPBB Family! :D

Well.... This is my first post and I'd like to ask for help. :shock:

I'd like to modify the behavior of the Forum:

From 06:00 to 18:00, I need to show the "Light STYLE"
From 18:00 to 06:00, I need to show the "Dark STYLE"

So, I wanna let users set 3 Styles:
- Light
- Dark
- Automatic

Is this possible? Is ther any kind of extension? :?:

I was wondering if is possible to edit the PHP files that manage wich Style is showed and insert an "IF" ou a "SWITCH CASE"... Please, is there anyone that can help with this? :geek:

Thank you guys! :mrgreen:
:evil: "-Why, Mr. Anderson? Why, why, why? Why do you do it? Why? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know?"
...
:geek: "-Because I choose to."
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Help: Change Forum Style according to time

Post by stevemaury »

Problem is, whose timezone? The user? The server? And Guests will have different time zone too. You will end up serving different styles to different users at the same time and I don't think that is possible.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Help: Change Forum Style according to time

Post by Brf »

It would require an extension, but I do not see any problem with the concept. It would be no different than the user checking their watch, and going to their UCP and switching their style when appropriate.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: Help: Change Forum Style according to time

Post by GanstaZ »

I think it is possible, but i don't know will it raise some sort of an issue if forums are based on different styles. Extension is needed for that, but will anyone take it, it's another question.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
Dream_Surfer
Registered User
Posts: 6
Joined: Wed Jan 23, 2019 7:13 pm
Name: Chico .
Contact:

Re: Help: Change Forum Style according to time

Post by Dream_Surfer »

stevemaury wrote: Wed Jan 23, 2019 7:50 pm Problem is, whose timezone? The user? The server? And Guests will have different time zone too. You will end up serving different styles to different users at the same time and I don't think that is possible.
I'd use the Server Timezone... The priority is to have, at first, only Brazilian members... So, timezone won't be a problem.




Brf wrote: Wed Jan 23, 2019 7:59 pm It would require an extension, but I do not see any problem with the concept. It would be no different than the user checking their watch, and going to their UCP and switching their style when appropriate.
Great... I'll do this.
Btw... is that possible to move THIS Topic to avoid flood on Forum?




GanstaZ wrote: Wed Jan 23, 2019 8:01 pm I think it is possible, but i don't know will it raise some sort of an issue if forums are based on different styles. Extension is needed for that, but will anyone take it, it's another question.
Great... I'm asking now for move this Topic :P
:evil: "-Why, Mr. Anderson? Why, why, why? Why do you do it? Why? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know?"
...
:geek: "-Because I choose to."
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Help: Change Forum Style according to time

Post by stevemaury »

I note that Brazil has 4 timezones.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Help: Change Forum Style according to time

Post by Lumpy Burgertushie »

I am curious, what is the purpose/benefit of this?


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Help: Change Forum Style according to time

Post by Brf »

Lumpy Burgertushie wrote: Wed Jan 23, 2019 8:14 pm I am curious, what is the purpose/benefit of this?
Light during the day and dark at night?
User avatar
Dream_Surfer
Registered User
Posts: 6
Joined: Wed Jan 23, 2019 7:13 pm
Name: Chico .
Contact:

Re: Help: Change Forum Style according to time

Post by Dream_Surfer »

stevemaury wrote: Wed Jan 23, 2019 8:11 pm I note that Brazil has 4 timezones.
We'll use the Capital's Timezone....

Lumpy Burgertushie wrote: Wed Jan 23, 2019 8:14 pm I am curious, what is the purpose/benefit of this?


robert
Do you Know Mac OS Mojave? It changes its style according to time... So you don't get tired eyes for excessive WHITE on your face at 01:00 am for example.
:evil: "-Why, Mr. Anderson? Why, why, why? Why do you do it? Why? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know?"
...
:geek: "-Because I choose to."
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Help: Change Forum Style according to time

Post by warmweer »

I actually like the idea.
stevemaury wrote: Wed Jan 23, 2019 7:50 pm Problem is, whose timezone? The user? The server? And Guests will have different time zone too. You will end up serving different styles to different users at the same time and I don't think that is possible.
The default system allows for users to choose their style from those installed, and to change styles when they feel like it, so basically that is serving different styles to different users at the same time. Or am I missing something?

I do see some extra work involved, because I can imagine some users not wanting a style switch: would that switch be an admin decision or could users select to use the automatic switch or to use only their selected style?
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Help: Change Forum Style according to time

Post by EA117 »

warmweer wrote: Wed Jan 23, 2019 8:42 pm I do see some extra work involved, because I can imagine some users not wanting a style switch: would that switch be an admin decision or could users select to use the automatic switch or to use only their selected style?
Maybe the "Light Style:" and "Dark Style:" selection exists for all users, but those who don't want it simply have "Style1" specified for both settings, instead of selecting an actual separate light and dark style.

I realize this is an extension discussion, but the question really makes me want to try and find some premium style that has already implemented this within itself using JavaScript and CSS color animation. That kind of functionality seems within "easy reach" (in relative terms), but if there is one out there which does an automatic animation of its CSS colors, I'm not finding it.
User avatar
Dream_Surfer
Registered User
Posts: 6
Joined: Wed Jan 23, 2019 7:13 pm
Name: Chico .
Contact:

Re: Help: Change Forum Style according to time

Post by Dream_Surfer »

warmweer wrote: Wed Jan 23, 2019 8:42 pm I actually like the idea.
stevemaury wrote: Wed Jan 23, 2019 7:50 pm Problem is, whose timezone? The user? The server? And Guests will have different time zone too. You will end up serving different styles to different users at the same time and I don't think that is possible.
The default system allows for users to choose their style from those installed, and to change styles when they feel like it, so basically that is serving different styles to different users at the same time. Or am I missing something?

I do see some extra work involved, because I can imagine some users not wanting a style switch: would that switch be an admin decision or could users select to use the automatic switch or to use only their selected style?
Sure….
We can make this extension works, or based on System Timezone, or on User Timezone… Great!


EA117 wrote: Wed Jan 23, 2019 8:55 pm
warmweer wrote: Wed Jan 23, 2019 8:42 pm I do see some extra work involved, because I can imagine some users not wanting a style switch: would that switch be an admin decision or could users select to use the automatic switch or to use only their selected style?
Maybe the "Light Style:" and "Dark Style:" selection exists for all users, but those who don't want it simply have "Style1" specified for both settings, instead of selecting an actual separate light and dark style.

I realize this is an extension discussion, but the question really makes me want to try and find some premium style that has already implemented this within itself using JavaScript and CSS color animation. That kind of functionality seems within "easy reach" (in relative terms), but if there is one out there which does an automatic animation of its CSS colors, I'm not finding it.
For this reason that I will offer 3 Styles…. Light, Dark and Auto
I didn’t see anything like this in anywhere…. So, we will start this! We’ll be the Precursors!
:evil: "-Why, Mr. Anderson? Why, why, why? Why do you do it? Why? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know?"
...
:geek: "-Because I choose to."
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Help: Change Forum Style according to time

Post by 3Di »

Twig could be used to achieve this type of result IMO, see an example here
which loads a different CSS based on the time of a certain timezone

Code: Select all

{% set time = now | date("G", "Europe/Paris") %}

{% if time >= 20 and time < 8 %}
	<link type="text/css" rel="stylesheet" href="css/style_dark.css"/>
{% else %}
	<link type="text/css" rel="stylesheet" href="css/style_light.css"/>
{% endif %}
ofcourse is not tested but just an example, instead of loading the CSS anything can be done
there within the condition, like changing style's ID, including a file, let the bells ringing out loud etc... :)

Ref.: https://twig.symfony.com/doc/2.x/filters/date.html
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
Dream_Surfer
Registered User
Posts: 6
Joined: Wed Jan 23, 2019 7:13 pm
Name: Chico .
Contact:

Re: Help: Change Forum Style according to time

Post by Dream_Surfer »

This is the way.... But I don't know how to walk on it....
So, let's wait for good souls to help us =) :roll:
:evil: "-Why, Mr. Anderson? Why, why, why? Why do you do it? Why? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know?"
...
:geek: "-Because I choose to."
User avatar
Dream_Surfer
Registered User
Posts: 6
Joined: Wed Jan 23, 2019 7:13 pm
Name: Chico .
Contact:

Re: Help: Change Forum Style according to time

Post by Dream_Surfer »

Hello!!!!
Please may somebody help me?
:evil: "-Why, Mr. Anderson? Why, why, why? Why do you do it? Why? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know?"
...
:geek: "-Because I choose to."
Post Reply

Return to “Extension Requests”