Show donation alert 25% of the time on ebook detail pages

This commit is contained in:
Alex Cabal 2021-01-13 16:13:58 -06:00
parent 153de5d450
commit faad55ed1f
5 changed files with 20 additions and 9 deletions

View file

@ -36,9 +36,10 @@ const SOURCE_FADED_PAGE = 9;
const AVERAGE_READING_WORDS_PER_MINUTE = 275;
define('PD_YEAR', intval(gmdate('Y')) - 96);
const DONATION_ALERT_ALWAYS_ON = false;
const DONATION_ALERT_ON_DURING_HOLIDAYS = true;
define('DONATION_ALERT_ON', DONATION_ALERT_ALWAYS_ON | (DONATION_ALERT_ON_DURING_HOLIDAYS && (time() > strtotime('December 1, ' . gmdate('Y')) || time() < strtotime('January 7, ' . gmdate('Y')))));
define('DONATION_HOLIDAY_ALERT_ON', time() > strtotime('December 1, ' . gmdate('Y')) || time() < strtotime('January 7, ' . gmdate('Y')));
define('DONATION_ALERT_ON', rand(1, 4) == 2);
// No trailing slash on any of the below constants.
const SITE_URL = 'https://standardebooks.org';
const SITE_ROOT = '/standardebooks.org';