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)
Anti-Spam Guide
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 » Wed Jan 23, 2019 7:31 pm

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: 50488
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 » 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.
For REALLY good and VERY inexpensive hosting CLICK HERE

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: 51716
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Help: Change Forum Style according to time

Post by Brf » 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.

User avatar
GanstaZ
Registered User
Posts: 804
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: Help: Change Forum Style according to time

Post by GanstaZ » 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.
"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 » Wed Jan 23, 2019 8:05 pm

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: 50488
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 » Wed Jan 23, 2019 8:11 pm

I note that Brazil has 4 timezones.
For REALLY good and VERY inexpensive hosting CLICK HERE

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: 66320
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Help: Change Forum Style according to time

Post by Lumpy Burgertushie » Wed Jan 23, 2019 8:14 pm

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


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51716
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Help: Change Forum Style according to time

Post by Brf » Wed Jan 23, 2019 8:16 pm

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 » Wed Jan 23, 2019 8:19 pm

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
Registered User
Posts: 2126
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Help: Change Forum Style according to time

Post by warmweer » 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?
My board's not broken, it just went peculiar

User avatar
EA117
Registered User
Posts: 634
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Help: Change Forum Style according to time

Post by EA117 » 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.

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 » Wed Jan 23, 2019 11:13 pm

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
Former Team Member
Posts: 13769
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Help: Change Forum Style according to time

Post by 3Di » Thu Jan 24, 2019 11:19 am

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
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

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 » Thu Jan 24, 2019 12:47 pm

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 » Tue Jan 29, 2019 6:27 pm

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”