mirror of
https://github.com/standardebooks/web.git
synced 2025-07-18 20:36:38 -04:00
Add automatic donation drives
This commit is contained in:
parent
d8ed44e20e
commit
19cf14c1aa
10 changed files with 396 additions and 296 deletions
|
@ -1,5 +1,20 @@
|
|||
<? if($GLOBALS['User'] === null){
|
||||
// The Kindle browsers renders <aside> as an undismissable popup. Serve a <div> to Kindle instead. See https://github.com/standardebooks/web/issues/204
|
||||
<?
|
||||
// Hide this alert if...
|
||||
$donationDrive = DonationDrive::GetByIsRunning();
|
||||
|
||||
if(
|
||||
$GLOBALS['User'] !== null // If a user is logged in.
|
||||
||
|
||||
$donationDrive !== null // There is a currently-running donation drive.
|
||||
||
|
||||
rand(1, 5) <= 3 // A 3-in-5 chance occurs.
|
||||
){
|
||||
return;
|
||||
}
|
||||
|
||||
if($GLOBALS['User'] === null){
|
||||
// The Kindle browsers renders `<aside>` as an undismissable popup. Serve a `<div>` to Kindle instead.
|
||||
// See <https://github.com/standardebooks/web/issues/204>.
|
||||
$element = 'aside';
|
||||
|
||||
if(stripos($_SERVER['HTTP_USER_AGENT'] ?? '', 'kindle') !== false){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue