Day Night Switcher

Day Night Switcher 1.0.0 (RC 3)

No permission to download

CMTV

Well-known member
CMTV submitted a new resource:

Day Night Switcher - This addon automatically changes forum style depending on part of the day

View attachment 162492
With this addon forum style will be changing automatically depending on part of the day. So users that come at 13:24 will see "day style" and users that come at 02:51 will see "night style".

It is useful because light styles with prevailing white color are very uncomfortable at night (or at early morning).

Opening your forum with this addon at night will not cause eye irritation and there will be no need to change the style directly...

Read more about this resource...
 
You have a fixed time for the change.
Does it take account of the timezone the users are in or is this only based on the server time?
 
Does it take account of the timezone the users are
Yes, it does.

There is no point to use server time only as some users may live far away from default forum timezone.

But default forum timezone will be used for guests (if addon is enabled for guests)
 
Last edited:
I have a feature request I believe would make this addon far more superior then it already is.
Having an option for 2 different header logos changing with the day and night styles to help avoid contrast conflicts or whatever.
 
This can be achieved by setting different logos for different styles inside styles properties. No need to add to addon I think.
 
Would be great that if your an admin you can still change the style on the style selector on the index.

Would Also be great to have an option for users to enable and disable this feature so they can chose to pick whatever style they like without it changing every few hours.

Thanks
 
Last edited:
If i have a custom style/css for my homepage then how to apply my CSS to understand your Mod and work according to your mod?
 
@CMTV I hope you are still around? I would like to request some custom work, the same as below, but primarily I want to limit this feature to my Upgraded members:

Would be great that if your an admin you can still change the style on the style selector on the index.

Would Also be great to have an option for users to enable and disable this feature so they can chose to pick whatever style they like without it changing every few hours.

Thanks
 
@CMTV
Thank you very much for this addon. I have two things:
1st I translated the phrases into German and would give you a SQL-Dump of the German phrases.
2nd Saving the settings is not possible. if I hit save, it seems to do the job. Reloading the page with [CTRL]+[F5] aka Kill cache and reload, just thorws me back to default with default style selected for day AND night. Neither are timechanges saved.
197233
 
Hello, I use your addon with 2.1.8 and it works fine. I would like to use it on 2.2 but the "Automatic Day Night Setting" checkbox does not appear in preferences.

There is only this problem, I made a new installation is OK and the options and the permissions are available, only checkbox not visible.
Thanks in advance !!!
 
Fixed and working in 2.2.5

Enable development mode and change the template modifications per the below.

daynightswitcher_account_preferences
Find:
Code:
            <xf:if is="$xf.visitor.canChangeStyle()">

                <xf:selectrow name="user[style_id]" value="{$xf.visitor.style_id}"
                    label="{{ phrase('style') }}">

                    <xf:option value="0">{{ phrase('use_default_style:') }} {$defaultStyle.title}</xf:option>
                    <xf:foreach loop="$styles" value="$style">
                        <xf:option value="{$style.style_id}">{$style.title}{{ !$style.user_selectable ? ' *' : '' }}</xf:option>
                    </xf:foreach>
                </xf:selectrow>
            <xf:else />
                <xf:hiddenval name="user[style_id]">{$xf.visitor.style_id}</xf:hiddenval>
            </xf:if>
Replace:
Code:
$0

<xf:if is="{{ $xf.visitor.hasPermission('general', 'daynightswitcher_disable') }}">
    <xf:checkboxrow>
        <xf:option value="daynightswitcher_enabled"
                   name="option[daynightswitcher_enabled]"
                   checked="{{ $xf.visitor.Option.daynightswitcher_enabled }}"
                   label="{{ phrase('daynightswitcher_account_preferences_checkbox') }}" />
    </xf:checkboxrow>
</xf:if>



daynightswitcher_account_preferences_disable_style
Find:
Code:
                <xf:selectrow name="user[style_id]" value="{$xf.visitor.style_id}"
                    label="{{ phrase('style') }}">

                    <xf:option value="0">{{ phrase('use_default_style:') }} {$defaultStyle.title}</xf:option>
                    <xf:foreach loop="$styles" value="$style">
                        <xf:option value="{$style.style_id}">{$style.title}{{ !$style.user_selectable ? ' *' : '' }}</xf:option>
                    </xf:foreach>
                </xf:selectrow>
Replace:
Code:
<xf:if is="$xf.options.daynightswitcher_globalEnabled">
    <xf:if is="{{ !$xf.visitor.hasPermission('general', 'daynightswitcher_disable') || $xf.visitor.Option.daynightswitcher_enabled }}">
                <xf:selectrow name="user[style_id]" value="{$xf.visitor.style_id}"
                    label="{{ phrase('style') }}" disabled="true"
                    explain="{{ phrase('daynightswitcher_can_not_change_style') }}">

                    <xf:option value="0">{{ phrase('use_default_style:') }} {$defaultStyle.title}</xf:option>
                    <xf:foreach loop="$styles" value="$style">
                        <xf:option value="{$style.style_id}">{$style.title}{{ !$style.user_selectable ? ' *' : '' }}</xf:option>
                    </xf:foreach>
                </xf:selectrow>
    <xf:else />
        $0
    </xf:if>
<xf:else />
    $0
</xf:if>
 
Back
Top Bottom