The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Rotate styles by day.
Say i have 7 styles made for my forums, they only differ in color. Now say i want style 1 to display on sunday, style 2 on monday etc. Would it be possible to write a script that would automaticly change the default style at 12 midnight everyday?.
|
#2
|
||||
|
||||
There are some issues to be solved like if your style will overwrite forum's forced styles or user's custom style but assuming answers are no for both here is your code:
edit global.php (in forum dir, not in Admin dir!), find: PHP Code:
PHP Code:
Sunday => Style 1 Monday => Style 2 .. .. Saturday => Style 7 Enjoy.. :glasses: |
#3
|
|||
|
|||
Thanks man, ill make sure to use this when we introduce the new styles next week
|
#4
|
|||
|
|||
Last question, seeing how the code is style 1 (sunday) would be named '0' correct?
|
#5
|
||||
|
||||
I didn't get the question
|
#6
|
|||
|
|||
Well seeing out its using the date function i looked it up, heres the quote of what i read:
Quote:
Heres the question, what would the name of the styles be? 1, or style 1? Im not clear on how it works. Again thanks for all your help |
#7
|
||||
|
||||
style name does not matter. You can name styles in anyway you like.
My code is interested in style ids, not names. So it will display styleid 1 in sunday and 2 in monday etc. If your styles are not in order, instead of $styleid=date("w",time())+1; you can use this code: if (date("w",time())==0) { $styleid=X; //enter id for sunday } elseif (date("w",time())==1) { $styleid=Y; //enter id for monday } .. .. elseif (date("w",time())==6) { $styleid=Q; //enter id for saturday } see? |
#8
|
|||
|
|||
Yea, i relized it was id based when i was on my way to breakfast, thanks again
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|