The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I change themes depending on time of day or day of year
#1
Is there a way to make GetSimple choose the theme based on the time of day, or the day of the year?

I would like to have a theme for Daytime and on for Night, and I also would like a special theme certain holidays. ie
Christmas, Newyears, etc.

Thanks for the help.
Reply
#2
Stompor Wrote:Is there a way to make GetSimple choose the theme based on the time of day, or the day of the year?

I would like to have a theme for Daytime and on for Night, and I also would like a special theme certain holidays. ie
Christmas, Newyears, etc.

Thanks for the help.

Create a php file like the following (a plugin) and put it in your plugins folder:
Code:
<?php
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");

# register plugin
register_plugin(
  $thisfile,
  'Day/Night Theme Switcher',  
  '0.1',    
  'My Name',
  'http://my.home.page',
  'Switch theme based on time',
  '',
  ''  
);

# activate filter
add_action('index-pretemplate','theme_switcher_process');

function theme_switcher_process() {
  global $TEMPLATE;
  # TODO determine time
  ...
  $hour = ...;
  if ($hour >= 8 && $hour < 18) {
    $TEMPLATE = 'Cardinal'; # use your theme name
  } else {
    $TEMPLATE = 'Innovation'; # use your theme name
  }
}
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
WOW!!!!
Thanks for the help and quick response.
Reply




Users browsing this thread: 3 Guest(s)