Created
May 10, 2013 09:51
-
-
Save ddnode/5553502 to your computer and use it in GitHub Desktop.
Drupal根据星期切换主题
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_custom_theme(). | |
| */ | |
| function mysite_custom_theme() { | |
| // An array of themes for each day of the week. | |
| // These themes have to be installed and enabled. | |
| $themes = array(); | |
| $themes[0] = 'garland'; | |
| $themes[1] = 'bartik'; | |
| $themes[2] = 'stark'; | |
| $themes[3] = 'seven'; | |
| $themes[4] = 'mytheme'; | |
| $themes[5] = 'sky'; | |
| $themes[6] = 'danland'; | |
| // Get the current day of the week in numerical form. | |
| $day = date("w"); | |
| // Override current theme based on day of the week. | |
| return $themes[$day]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment