PDA

View Full Version : Assign Style based on Viewer's Time of Day


kall
07-16-2006, 10:00 PM
Force Style based on Viewer's Time of Day

Description
Requested by Solace-City (https://vborg.vbsupport.ru/member.php?u=125927) here, this Modification allows you to assign a specific Style for Users, based on their Timezone.

It will display the 'Day Style' between the hours you specify, and the 'Day Style' in all other times.

You can turn it on and off, assign Style IDs and choose the time to display the Night Style from the AdminCP - Style and Language Settings page.

Details
1 Product XML (1 Plugin, 5 Settings)

(If you Downloaded this prior to the timestamp on this edit, Uninstall the Product and start anew with the attached file in the .zip).

kall
07-17-2006, 09:59 AM
And lets just reserve the first post, for no reason whatsover.

Azhrialilu
07-17-2006, 10:24 AM
oh now, that's a novel idea.... nice one, Kall :D

kall
07-17-2006, 10:25 AM
Solace-City came up with the concept... I just cobbled together the code. :)

Solace-City
07-17-2006, 10:26 AM
Woow! Thanks man! This is awesome. I've got vBulletin 3.6.0 RC1, so I'll test away to see if it works with that version.

Trialing it on solace-city.com/forum/

kall
07-17-2006, 10:28 AM
No problemo at all!

Just doing my bit to foster closer Australo-Kiwi relations. ;)

Solace-City
07-17-2006, 10:37 AM
Darn, the options do not show when installed for 3.6.0 RC1 :(

Perhaps someone else with this vB version could test it to see if it is the version of vBulletin, or a conflicting hack that is installed?

kall
07-17-2006, 10:45 AM
You're quite right.. they didn't come out with the xml.. let me try again.

kall
07-17-2006, 10:53 AM
OK.. try it now.

Seems I had to set 'Allow overwrite' in the Settings. Bit of a silly title for a setting, but there you go. :)

Solace-City
07-17-2006, 11:03 AM
Ok, its showing up under the options now! :)

Although, when viewing as a guest I still see the daytime skin. Does the "Allow Users To Change Styles" have to be enabled for this plugin to function?

The way we work with styles at the moment is control them all through the admincp (eg change it for a special event or whatnot) so if we were to enable users to select a skin they wish, they would not see the special skin.

Nevertheless, thank you for all your work, and time you put in.

EDIT: OOPS!! My mistake I feel dumb. I had the Start/Stop figures around the wrong way... Thanks for this wonderful hack!

D.Ilyin
07-17-2006, 11:07 AM
thank's!! Installed :)

Atakan KOC
07-17-2006, 12:29 PM
Hımmmmm... Very nice. Thanks :)

Snake
07-17-2006, 12:49 PM
I will check this out in a minute. Thanks! ;)

projectego
07-17-2006, 04:03 PM
This mod sounds pretty cool... :)

rjordan
07-17-2006, 07:04 PM
Very nice! Could you by chance modify it a bit more to allow for 4 time periods? Morning, Afternoon, Evening, and Night? I would love to see that. If not, I will try to modify it myself, but thought I would at least suggest it.

kall
07-17-2006, 07:07 PM
I'll see about adding that in the next release.. it should be doable.

Barakat
07-18-2006, 05:37 AM
just love it .

Harley77
07-18-2006, 12:00 PM
If I may add another suggestion. The ability to have people override the style selection by setting it in their profile. So, if their style was never set or set to use forum default, then the Day/Night cycle would be in effect, otherwise they would simply see whatever style they "hard set" in their profile options.

Great mod, I wanted something exactly like this when our forums went to a two style setup, A day style and night style coincidentally.

GremlinPrince
07-18-2006, 05:49 PM
Doesnt seem to change the theme when it is set to :(

Great idea though I had this idea for a CMS.

Solace-City
07-19-2006, 03:18 AM
Yeah, I've just noticed it is not switching the style. It only stays on the daytime theme. However, I can tell it is doing something, as it has overridden the admins ability to pick any style ;)

From your profile, I guess it isnt just a vB 3.6.0 problem then.

kall
07-19-2006, 03:37 AM
Yeah, I've just noticed it is not switching the style. It only stays on the daytime theme. However, I can tell it is doing something, as it has overridden the admins ability to pick any style ;)

From your profile, I guess it isnt just a vB 3.6.0 problem then.
Bizarre. If you want to PM me an Admin account and password, I can have a look for you.

Scooterpig
07-19-2006, 08:46 AM
What does the latest update have in it, no post or updates in original post about changes, sorry???

kall
07-19-2006, 09:00 AM
What does the latest update have in it, no post or updates in original post about changes, sorry???
Only that it actually works now. ;)

Solace-City
07-19-2006, 03:02 PM
Hehe... the hack works like a charm now, since I've uninstalled it and reinstalled with a vB 3.6.x version that you have in the updated download

Thanks a bunch, its awesome!!

GremlinPrince
07-20-2006, 08:33 AM
Fantastic thanks for the fix :D

D.Ilyin
07-21-2006, 02:17 PM
well.... is it possable to add another future?
As example:
I have 3 skins - for day, for night and ..... for dial-up users :)
I mean is there any chance to exlude day\night style chenages for PPL's who has choise dial-up skin?
I.e. option:
Exlude PPL's with styleid X form that changes.

Hope you understand :)

D.Ilyin
07-29-2006, 07:31 AM
well.... is it possable to add another future?
As example:
I have 3 skins - for day, for night and ..... for dial-up users :)
I mean is there any chance to exlude day\night style chenages for PPL's who has choise dial-up skin?
I.e. option:
Exlude PPL's with styleid X form that changes.

Hope you understand :)
is you silent mean NO or ......?

kall
07-30-2006, 09:06 PM
It means 'My phone line has been out for over a week and I am only able to pop in whilst at work.. be patient. I should be able to add it.'

Kirk Y
07-31-2006, 10:44 AM
This is really clever, definitely going to install this one.

D.Ilyin
08-01-2006, 09:17 PM
It means 'My phone line has been out for over a week and I am only able to pop in whilst at work.. be patient. I should be able to add it.'
sory fo this :\. Just think you are always 'online' :rolleyes:
Thanks anyway!

Solace-City
09-27-2006, 10:08 AM
Hey kall, another suggestion for this awesome hack.

Are you able to modify this plugin to check for a forum-specific style override, and display that style instead of the day/night style if the result is true?

Over at our forums we are looking at a special forum skin for a specific category, however the day/night style changer conflicts.

So for example, Forum ID 3 Titled "Nature" could have an Nature style assigned, by which the day/night plugin is ignored in these forums, and the nature style displays at all times in this forum unless changed in the admin cp.

Is this doable? :)

kall
09-27-2006, 10:41 PM
Very doable.. logically, it would be:

if forumid=!nature forum id
{... existing code...}


I will see if I can squeeze some time in this weekend to do it.

inciarco
01-27-2008, 04:30 PM
Great Mod, I was looking for it Today!! :up::up::up:

Thank You Very Much kall For Sharing It, and also a Version for vB 3.6 in the Winzip File (inside the Winzip File there is a 3.5 and a 3.6 Version of the Mod)!! :up::up::up:

I'll Post a Link to this Thread in all the Threads asking for what this Mod do!! :up:

Works OK in vB 3.6.7 PL1!! :up:

One Additional Thing that Could be Added for Updates, and is to Exclude a list of Usergroups to be Affected by the Plugin "Time-Based Style Fetch"!! ;)

I Share with you what that Final Code of the Plugin Could Be, (in this Example Excluding Usergroups 5,6, and 7), notice the "!" to indicate "Not a Member Of", that "!" could not be Used to Indicate the Usergrups that Will be Affected (but I like more the Excluded Usergroups Logic):

if (!is_member_of($vbulletin->userinfo, explode(',','5,6,7')))
{

$nzbstyle_hour = vbdate("G");
if ($vbulletin->options['timestyle_onoff'] == 1){if( $nzbstyle_hour > $vbulletin->options['timestyle_start'] && $nzbstyle_hour < $vbulletin->options['timestyle_stop'] ) { $styleid = $vbulletin->options['timestyle_dayid']; }
else
{ $styleid = $vbulletin->options['timestyle_nightid']; }
}

}

And with an Option "excluded_groups_style_change" created for this Mod next to the Other Options in the "Style and Language Options", "$vbulletin->options['excluded_groups_style_change']":

if (!is_member_of($vbulletin->userinfo, explode(',',$vbulletin->options['excluded_groups_style_change'])))
{

$nzbstyle_hour = vbdate("G");
if ($vbulletin->options['timestyle_onoff'] == 1){if( $nzbstyle_hour > $vbulletin->options['timestyle_start'] && $nzbstyle_hour < $vbulletin->options['timestyle_stop'] ) { $styleid = $vbulletin->options['timestyle_dayid']; }
else
{ $styleid = $vbulletin->options['timestyle_nightid']; }
}

}

My Best Regards!! ;)

:)

zajeluae.com
03-30-2009, 10:51 PM
Is there a version compatible with 3.8.0
--------
ان كان هناك أحد الاعضاء العرب الذين يشاهدون هذا الموضوع الآن
اتمنى منهم مساعدتي في تركيب هذا الهاك على النسخة 3.8.0

Michlerish
08-12-2010, 11:20 PM
Is there anything like this for 4.0.6 ?

2W6+6
04-13-2012, 08:23 AM
Works with 4.1.11!