The site has 2 designs: for the day and night. I want the day included (for example) with 10-00 and 20-00 in night included a design.

Weácan module, if any.

Comments

kbalderson’s picture

This would seem to be the easiest way without setting up a module(not sure what Weacan module means)

You could create two pages, one to change to the day theme, and one to change to the night theme. Then set up a cron job to access each page at a particular point in the day.

The input format would have to be php (rather than Full HTML or Filtered HTML).

The page to switch to the night template would look like this:

  // Filter the IP so that only a particular server can access it. We don't want just anybody to be able to change your theme
  if ($_SERVER['REMOTE_ADDR'] == 'cron server ip address here') {
    variable_set('theme_default','night_theme'); // You would change 'night_theme' to the name of your night theme
    drupal_rebuild_theme_registry();
  }

You would set up a cron job to navigate to this page at the time you wish to switch to the night theme.

The page to switch to the day template would look like this:

  if ($_SERVER['REMOTE_ADDR'] == 'cron server ip address here') {
    variable_set('theme_default','day_theme'); // You would change 'day_theme' to the name of your day theme
    drupal_rebuild_theme_registry()
  }

The cron job for this one would be set up some time in the morning.

I have not tested this code. If you get errors, let me know.

Remember, you're setting up the cron job to navigate to these pages, not to Drupal's cron.php.