From 013de068044a658bb92b4a1202a9e3418bf65aa7 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Wed, 14 Feb 2018 22:19:53 -0800 Subject: [PATCH] Add TINYIB_TIMEZONE, resolves #48 --- imgboard.php | 4 ++++ inc/defines.php | 3 +++ settings.default.php | 1 + 3 files changed, 8 insertions(+) diff --git a/imgboard.php b/imgboard.php index 19d3200..d3aef17 100644 --- a/imgboard.php +++ b/imgboard.php @@ -65,6 +65,10 @@ foreach ($includes as $include) { include $include; } +if (TINYIB_TIMEZONE != '') { + date_default_timezone_set(TINYIB_TIMEZONE); +} + $redirect = true; // Check if the request is to make a post if (isset($_POST['message']) || isset($_POST['file'])) { diff --git a/inc/defines.php b/inc/defines.php index 97beeb2..9774e90 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -33,6 +33,9 @@ if (!defined('TINYIB_REQMOD')) { if (!defined('TINYIB_ALWAYSNOKO')) { define('TINYIB_ALWAYSNOKO', false); } +if (!defined('TINYIB_TIMEZONE')) { + define('TINYIB_TIMEZONE', ''); +} if (!defined('TINYIB_DBMIGRATE')) { define('TINYIB_DBMIGRATE', false); } diff --git a/settings.default.php b/settings.default.php index 055c8b3..a422a2a 100644 --- a/settings.default.php +++ b/settings.default.php @@ -24,6 +24,7 @@ define('TINYIB_LOGO', ''); // Logo HTML define('TINYIB_THREADSPERPAGE', 10); // Amount of threads shown per index page define('TINYIB_PREVIEWREPLIES', 3); // Amount of replies previewed on index pages define('TINYIB_TRUNCATE', 15); // Messages are truncated to this many lines on board index pages [0 to disable] +define('TINYIB_TIMEZONE', 'UTC'); // See https://secure.php.net/manual/en/timezones.php - e.g. America/Los_Angeles // Post control define('TINYIB_DELAY', 30); // Delay (in seconds) between posts from the same IP address to help control flooding [0 to disable]